vim技巧备忘
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 经常会对一些实用的功能查了一遍又一遍,最后用的时候还要查。还是自己做个记录,生疏的方法用一个记一个。希望能熟练使用。本文不做vim命令介绍,只做个人的遗忘记录,所用内容仅供参考。 本文置顶
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
经常会对一些实用的功能查了一遍又一遍,最后用的时候还要查。还是自己做个记录,生疏的方法用一个记一个。希望能熟练使用。本文不做vim命令介绍,只做个人的遗忘记录,所用内容仅供参考。
本文置顶,长时间持续更新。
1.替换命令
使用场景:用于批量替换文件中的字符
使用命令:
替换技巧有很多,我常用的一个
:n,m s/a/b/g
意思是把从第n行到第m行查找到的所有a都替换成b
2.取消高亮
使用场景:有时查找一个单词或者替换一个单词后,整个文件中会出现查找匹配高亮,想要取消高亮使用下面这条命令
使用命令:
:nohl
3.格式化代码
使用场景:格式化程序代码
使用命令:
在普通模式(normal)下输入 gg=G 格式化全文
在普通模式(normal)下输入 == 逐行格式化代码
待续……

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The steps to start a Redis server include: Install Redis according to the operating system. Start the Redis service via redis-server (Linux/macOS) or redis-server.exe (Windows). Use the redis-cli ping (Linux/macOS) or redis-cli.exe ping (Windows) command to check the service status. Use a Redis client, such as redis-cli, Python, or Node.js, to access the server.

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

The five pillars of the Linux system are: 1. Kernel, 2. System library, 3. Shell, 4. File system, 5. System tools. The kernel manages hardware resources and provides basic services; the system library provides precompiled functions for applications; the shell is the interface for users to interact with the system; the file system organizes and stores data; and system tools are used for system management and maintenance.

How to restart the Redis service in different operating systems: Linux/macOS: Use the systemctl command (systemctl restart redis-server) or the service command (service redis-server restart). Windows: Use the services.msc tool (enter "services.msc" in the Run dialog box and press Enter) and right-click the "Redis" service and select "Restart".

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

Linux is suitable for servers, development environments, and embedded systems. 1. As a server operating system, Linux is stable and efficient, and is often used to deploy high-concurrency applications. 2. As a development environment, Linux provides efficient command line tools and package management systems to improve development efficiency. 3. In embedded systems, Linux is lightweight and customizable, suitable for environments with limited resources.

The PHP community provides rich resources and support to help developers grow. 1) Resources include official documentation, tutorials, blogs and open source projects such as Laravel and Symfony. 2) Support can be obtained through StackOverflow, Reddit and Slack channels. 3) Development trends can be learned by following RFC. 4) Integration into the community can be achieved through active participation, contribution to code and learning sharing.

The methods to check whether Redis is started successfully are: check the process status through terminal commands: Linux/Unix: ps -ef | grep redis: ps aux | grep redis connects through the Redis client tool and ping: redis-cli ping access Redis web interface: http://[Redis instance IP]:6379/info
