In Linux, the main editor is VI or VIM, this article around vim to do a simple explanation: Linux default self-contained VI (VIM) editor, its package is: [[email protected] ~]# rpm-qf ' which VI ' vim-minimal-7.2.411-1.8.el6.x86_64 [[email protected] ~]# rpm-qf ' which vim ' vim-enhanced-7.2.411-1.8.el6.x86_ 64vim Editor Mode toggle: Command mode, command line mode, edit mode command mode: Character manipulation I insert a current character before inserting a line end insert a before the current character inserted in the current mode o the next line insert o the previous line insert X backward delete one character (equivalent to delete key) x to Before removing a character (equivalent to the BACKSPACE key) U undo a walk operation home key or ^ line header $ lines end END key NDD delete n rows (n = number of rows, 1 can be ignored) Nyy copy n row (n = number of rows, 1 negligible) p copy row paste extension: cut = delete First, then paste Delete to beginning of line D + HOME or ^ Delete to end of line D + END or $ word operation DW Delete a word, delete when you want to move the cursor to the beginning of the word. Also, if the cursor is not at the beginning of the line, the letter after the cursor is deleted. YW copy a word w Toggle word block operation Large D or d+$ to the end of the line d+^ Delete to the beginning y+$ copy to the end y+^ copy to the first V mode (more for the shell multiline comments, the configuration file may also be used) into the V mode: CTRL + V programming requires multiple lines of comment: 1, note: Ctrl + V Enter column edit mode 2 move the cursor down or up 3 mark the beginning of the line that needs comment 4 and then insert the comment in the uppercase I5, such as "#". 6 Press ESC again and it will all be commented out. Delete Multiline Comment: Delete: Press CTRL + V to enter the column editing mode, move the cursor down or up, select the comment section, and then press D to delete the comment symbol. Vim command-line mode operation: W save save:q without any modifications, exit quit:q! Modified, not saved, forced exit: Wq Save and exit: wq! Force save and exit. Save: ZZ to a character: R again corresponds to the text substitution:%s/this/that The first this of each line is replaced by that:%s/this/that/g to replace all the this in the text with that% to indicate that the full-text match s replaces this Original content that modified content g aAll occurrences of a row, none replaces only the first occurrence: 2,5 s/nologin/login/g #替换第二行到第五行中的nologinn, m for the specified line number. /find:/target n search down, n looks up: Set Nu/nonu #显示行号去消高亮显示:: Noh or casually find a set of characters that are not:!ifconfig call the system command vim to navigate to a line: GG positioning to the beginning of G to navigate to the last row #g navigate to a One line: # Navigates to a row #gg navigates to a row #代表行号读取其他文件: R./sshd_config.bakvim open multiple files: [[email protected] ~]# vim-o/etc/passwd/etc/ HOSTSCTRL+WW switching between files custom Vim#vim ~/.VIMRC input: Set Nuset history=10 Besides, there are vim cursor positioning live until old, Mark Mark, Learning notes in the Linux desktop environment have gedit text editor, graphical interface (equivalent to Windows Notepad) More Vim related tutorials see the following: Vim 8.0 release http://www.linuxidc.com/Linux/ 2016-09/135178.htmvim Learning Guide Http://www.linuxidc.com/Linux/2013-08/89096.htmVim editor Configuration http://www.linuxidc.com/Linux/ 2016-09/135460.htmvim Editor uses http://www.linuxidc.com/Linux/2016-09/135043.htm quick Learn VI editor http://www.linuxidc.com/ Linux/2013-08/88586.htm powerful Vim editor http://www.linuxidc.com/Linux/2013-07/87544.htmLinux text Editor General usage of VIM/HTTP Www.linuxidc.com/Linux/2016-11/137263.htm makes Vim a good C + + IDE http://www.linuxidc.com/Linux/2016-06/132262. Htmubuntu 14.04 upgrade Vim7.4 to 8.0 http://www.linuxidc.com/Linux/2016-11/136816.htmvim Installing Youcompleteme Auto-Complete plugin http://www.linuxidc.com/Linux/2016-11/137665.htm KVM installation and snapshot management in Linux A workaround for the installation of CentOS 7 when the spare hard drive is not detected
More content: http://www.wangzhanjianshegs.com/website construction
The Linux Vim Editor uses a simple explanation