Vim editor ASCII Vi:vim: fullscreen, patterned vim mode: Edit mode (Command mode) input mode last line mode mode conversion: edit--Inputi,a,o (o: Create a new row below the current cursor line and switch to input mode)I,a,o (line at beginning, end, new row above)Input--EDIT: ESC edit--Last line:: (colon) 10,20d (delete); set nu line number;! LS/ETC (External command) One, open file vim +# cursor in # line+ Open File, navigate to last line+/pattern: Open file, navigate to specified stringTwo, close file: Q:wq:q!:w:w!:wq =: x edit mode exit: ZZ Save exit three, move cursor 1.h,l,j,k left and right #h: Move the # characters 2. Move W in words: The next word, the first E: The next word ending B: the first word 3. Inline Jump: 0: Beginning of line ^: the first non-whitespace character at the beginning of the line $: absolute 4. Row jump #g: Jump to # line G: The last line in the end of the mode, direct to the travel number four, flip screen ctrl+f: down ctrl+b: Up ctrl+d: down half screen ctrl+u: Half screen up five, Delete a single character #x: delete the # word Fuliu at the cursor, delete command: d#d Combo jump command Use DW,DE,DBDD: Delete the line of the current cursor #dd: Delete the lines including the cursor, the last line mode: Str,end 1,8d., +5d; ., 100d.: Represents the current line $: Last line +#: Down # line seven, paste command pp: lowercase, if deleted or copied to the entire line of content, then paste to the cursor is below the line, the non-entire line is pasted at the bottom of the cursor P: uppercase, if deleted or copied as the entire line of content, then paste to the cursor Non-full line paste in front of the cursor eight, copy the command y usage with d command Nine, modify: First delete the content, and then convert to input mode, C: Use the same as D command 10, replace a single character RR: Replace Mode 11, undo Edit Operation U: Undo the previous action, can be undone, 50 times #u: Undo # Operations Directly Reverse undo Last Action: Ctrl+r 12, repeating the previous edit operation. Point 13, Visualize mode V: Select by character V: select 14 by Rectangle, find/pattern? PATTERNN,n Next, LastXV, find and replace using the S command in last-line mode Addr1,[email Protected]@[email protected] (I, ignoring the character case G, global mode) 16, how to open multiple files vim File1 file2 file3:next Switch to the next file: Prev Switch to the previous file: Last switch to the final file: first switch to the file exit: QA All exit 17, split screen display a file Ctrl + W, S: Split window horizontally Ctrl + W, V: Split vertically between windows toggle cursor: Ct RL + W, ARROW:QA exit all 18, sub-window edit multiple files Vim-o: Horizontal split vim-o: Vertical split 19, save part of the current file as another file: W:addr1,addr2w/path/to/somewhere 20, will be another The contents of a file are populated in the current file: R/path/to/somefile 21, interacting with the shell:! Command 22, Advanced topic 1, display or cancel line number: Set NU display line number: Set Nonu Cancel 2, display ignore or distinguish character case: Set Ic:set noic 3, set auto indent: Sets Autoindent:set Ai:set No Ai 4, found text highlighting or canceling: Set Hlsearch:set nohlsearch 5, syntax highlighting: syntax on:syntax off 23, config file/ETC/VIMRC global mode ~./VIMRCUser ConfigurationVimtutor practice Vim-r Restore Last saved rm-f. file.swp
1.vim Common methods