vim

vim

1 add ” 1X1 ” at the beginning of each line in vim
:%s/^/ 1X1 /
% = for every line
5,19 = for line 5 until line 19
^ = beginning of the line
$ = end of the line

vimdiff
:set scrollbind scroll simultaneously/parallel on
:set scb! scroll simultaneously/parallel off
Ctrl+w+x disable parallel scrolling

shortcuts and useful
:u U undo
ctrl+R redo
123G | 123ggjump to the line 123
G jump to the last line
dG delete from current line to the end of the file
dw delete from current cursor position to the beginning of the next word
d $ | D delete from current cursor position to the end of the line
# highlight same word
ctrl+v select block of text
V+y copy active line
ctrl+h or :noh clear last search highlighting
:sp split screen
yy yank current line
p paste yanked after active line
:set list enable showing all white spaces as a character
:set nolist disable showing all white spaces as a character
:edit update file
R replace mode
/\cSEARCHword case insensitive search (upper and lower case)
* search for the word under the cursor
v + SELECT + y yank selected
v + SELECT + p paste over selected

ctrl+v VISUAL BLOCK
ctrl+v + up/down + shift+i + ABC123 + esc insert over multiple lines
ctrl+v + up/down + shift+4 + shift+a + ABC123 + esc insert over multiple lines at the end on line
ctrl+v + 0 select from begin of the lines
ctrl+v + shift+r delete selected lines
ctrl+v + caps lock + shift+r + ONEsimpbol replace selection with ONEsimbol

multiple files and windows
:ls list of current buffers
:e ../FILENAME.WITH_TAB open a new file
:b FILENAME_TAB switch between all open files
Ctrl + w + s or :split or :sp split the current window horizontally
Ctrl + w + v or :vertical split or :vs split the current window horizontally
Ctrl + w + w switch between windows

folding
zc close a fold
zo open a fold
zM close all folds

show
:set list turn on showing $
:set nolist turn off showing $

links
Inserting text in multiple lines
I want to add * to the end of each line in Vim.
How to get rid of search highlight in vim -> :noh
[Vim] Visual Mode Insert/Append over Multiple Lines
Better Experiences: Ego and Vim