voir l'article Vim folding tips.
zf: create a manual fold
zd: remove a manual fold
zM: overview
zR: detail
zo: open fold
zc: close fold
:mkview save fold
:loadview load fold
http://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun
voir l'article Vim folding tips.
zf: create a manual fold
zd: remove a manual fold
zM: overview
zR: detail
zo: open fold
zc: close fold
:mkview save fold
:loadview load fold
http://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun
Redo the last substitute or command by : in Vim
@:
For more repeats, it can be done by
@@
To change two vertically split windows to horizontally split
Ctrl-W t Ctrl-W K
Horizontally to vertically:
Ctrl-W t Ctrl-W H
Explanations:
Ctrl-W t makes the first (topleft) window current
Ctrl-W K moves the current window to full-width at the very top
Ctrl-W H moves the current window to full-height at far left
http://stackoverflow.com/questions/1269603/to-switch-from-vertical-split-to-horizontal-split-fast-in-vim
Convert all tabs to spaces and vice versa.
You can use the :retab command to convert all existing tabs to spaces. You can do both in one command:
:set et|retab
You can also convert spaces to tabs:
:set noet|retab!
http://vim.wikia.com/wiki/Super_retab
Vim plugin surround
Normal mode
———–
ds – delete a surrounding
cs – change a surrounding
ys – add a surrounding
yS – add a surrounding and place the surrounded text on a new line + indent it
yss – add a surrounding to the whole line
ySs – add a surrounding to the whole line, place it on a new line + indent it
ySS – same as ySs
Visual mode
———–
s – in visual mode, add a surrounding
S – in visual mode, add a surrounding but place text on new line + indent it
http://www.catonmat.net/blog/vim-plugins-surround-vim/
Surround, a VIM plugin that surrounds a word or a line.
http://www.catonmat.net/blog/vim-plugins-surround-vim/
VIM search tip.
In addition to / or ? there are more search options.
(g* or g# search the words including the word under the cursor.)
Exchange current window with the next on.
Ctrl-w x
Some Vim commands related to buffers
Show buffer list
:ls
Change to another buffer – any of these commands
:bn :bp :bCtrl-6
Close current buffer
:bd
Rotate open windows in Vim
Ctrl-w r