0 evaluări0% au considerat acest document util (0 voturi)
86 vizualizări2 pagini
This document is a Vim cheat sheet that provides basic commands for navigating and editing text in Vim. It outlines commands for inserting and deleting text, copying and pasting, searching and replacing text, and saving and quitting files. Movement basics include keys to move the cursor left, down, up, right, to the beginning or end of lines, words, and files.
This document is a Vim cheat sheet that provides basic commands for navigating and editing text in Vim. It outlines commands for inserting and deleting text, copying and pasting, searching and replacing text, and saving and quitting files. Movement basics include keys to move the cursor left, down, up, right, to the beginning or end of lines, words, and files.
This document is a Vim cheat sheet that provides basic commands for navigating and editing text in Vim. It outlines commands for inserting and deleting text, copying and pasting, searching and replacing text, and saving and quitting files. Movement basics include keys to move the cursor left, down, up, right, to the beginning or end of lines, words, and files.
i to enter insert mode & enter text normally dw to delete a word o to enter insert mode & open a line below cursor d0 to delete from the cursor to the beginning of the line O to enter insert mode & open a line above cursor d$ to delete from the cursor to the end of the line dgg to delete to the beginning of the file Command mode: dG to delete to the end of the file Escape to enter command mode u to undo CTRL-r to redo the last undo Lat-line mode: Copying and Pasting : from command mode to enter last-line mode v will highlight one character at a time V will highlight one line at a time Movement basics in Vim CTRL-v will highlith by colummns p will paste text after the current line h moves the cursor left P will paste text on the current line j moves the cursor down one line y will yank text into the copy buffer k moves the cursor up one line l moves the cursor to the right “+y will yank text into the copy to the clipboard 0 moves the cursor to the beginning of the line “+p $ moves the cursor to the end of the line w moves the cursor forward one word b moves the cursor backwards one word Saving and Quitting G moves to the end of file :w [filename] to write gg moves to the beginning of the file :wq [filename] to write and then quit :q! to quit without saving Searching and replacing :w! [filename] to write over a file CTRL-z Can leave Vim in the background / to search forward ? to search backwards n to move to the next instance of the search term use N to move to the previous instance
%s/text/replacement/g to search and replace
%s/text/replacement/gc with confirmation (recommended) Vim Cheat Sheet Basic Commands