Vim¶
Very good documentation → vim tips and tricks: registers
noremap ; l
noremap l k
noremap k j
noremap j h
Clipboard¶
"*y
copy current line/selection to clipboard register
Use :set paste
to avoid autoindent when pasting snippets.
Then revert back using :set nopaste
.
Registers¶
Very handy when you want to get back what you've --deleted--
:reg
to see all of them"3p
to paste content to 3rd register
Buffers¶
:ls
will show your open buffers:b
will open the specified buffer in the current pane.
Search and replace¶
%s
: all liness
: current line onlyea,bs
: line a to b (inclusive).,$s
: current line (.) to end.,+ns
: current line (.) to n line below
Autocompletion¶
C-n
: Display autocomplete
Editing a stream¶
:! find . | vim -
in a shell get content and send it to vim then :w filename
to save the file
Git (Vim Fugitive)¶
Gdiff
view diffGstatus
view status:-
add/reset fileEnter
view the file current windowC
invoke:Gcommit
C-p
andC-n
to move between file
Gwrite
to stage current fileGBrowser
to view on GithubGlog
display all commit for current file\[q
previous\]q
next- Do not forget
:cw
for quick view
Glog --
display all commitsGgrep finds