vim tips

python friendly ~/.vimrc

syn on
set number
set tabstop=2
set expandtab
set shiftwidth=2

editing

start edit at he beggining of the line: I
start edit at he end of the line: A
delete the rest of a line: d$
delete the begining of the line: d0
delete a word: dw
delete current line: dd
delete 5 lines: d5d
delete charater: x
swap two characters: xp
undo: u
search next: n
search previous: N
go to the last line: SHIFT+J
go up: gg
comment a block from line 10 to line 12: :10,12/s/^/#/g
uncomment a block from line 10 to line 12: :10,12/s/^#//g
delete empty lines :v/./d
delete commented lines
* %g/^;.*/d
* %g/^#.*/d
source
Case Insensitive Search:/\c string

source

pass options from command line
for copy/pasting tasks: vim “+set paste nonumber”

windows
Ctrl+W + j = buffer below
Ctrl+W + k = buffer up
source

Leave a Reply

Your email address will not be published. Required fields are marked *

this is just a draft of my work