- Presentation
- Installation
- Updates
- Learn VIM
- Key mapping
- Modules
- vim-cursor
- vim-solarized8
- gruvbox
- vim-airline
- vim-airline-themes
- vim-indent-guides
- vim-startify
- vim-signature
- auto-pairs
- vim-multiple-cursors
- matchit.zip
- vim-easy-align
- vim-easymotion
- vim-surround
- vim-repeat
- wildfire.vim
- nerdcommenter
- syntastic
- nerdtree
- vim-fugitive
- vim-signify
- ctrlp.vim
- rainbow
- HTML-AutoCloseTag
- gundo.vim
- tagbar
- YouCompleteMe
- vim-snippets
- ultisnips
- Tips
- Troubleshooting
Plugins and customization for VIM.
Inspired by spf13-vim.
- More reactive
- More fast to load
If you have Docker installed on your system you can build or installed the Docker image.
docker build -t vim-gigix http://raw.githubusercontent.com/gigi206/docker/master/Dockerfile/vim-gigix_tmux-gigix/Dockerfile
docker run --rm -it --name vim-gigix -e TERM=xterm-256color vim-gigix tmux -2u new -s vim-gigix 'vim'
docker pull gigi206/vim-gigix
docker run --rm -it --name vim-gigix -e TERM=xterm-256color gigi206/vim-gigix tmux -2u new -s vim-gigix 'vim'
yes Y | bash <(curl http://raw.githubusercontent.com/gigi206/vim-gigix/master/install.sh -s -L -o -)
For vim with python
compatibility plugins, install :
vim-nox
on Debianvim-enhanced
on Fedora
curl https://raw.githubusercontent.com/gigi206/vim-gigix/master/.vimrc -s -L -o ~/.vimrc && vim -c "try | call dein#update() | call dein#recache_runtimepath() | finally | qall! | endtry" -N -u .vimrc -U NONE -i NONE -V1 -e -s
Keystrokes | Mode | Description |
---|---|---|
yi( or yi) or ya( or ya) or yib or yab |
N | Copy ( <text> ) block |
yi[ or yi] or ya[ or ya] |
N | Copy [ <text> ] block |
yi{ or yi} or ya{ or ya} or yiB or yaB |
N | Copy { <text> } block |
yi< or yi> or ya< or ya> |
N | Copy < <text> > block |
yi" or ya" |
N | Copy " <text> " block |
yi' or ya' |
N | Copy ' <text> ' block |
yi` or ya` |
N | Copy ` <text> ` block |
yit or yat |
N | Copy <tag> <text> </tag> block |
yy or Y |
N | Copy line to the register |
yf<letter> |
N | Copy from cursor to <letter> |
yw or yiw or yaw or yW or yaW or yiW or ye or yE |
N | Copy from cursor to the end word |
yb or yB |
N | Copy from cursor to the begin word |
yap or yip |
N | Copy the current block |
y or Y |
V | Copy highlight text |
Keystrokes | Mode | Description |
---|---|---|
cgn |
N | Change the previous search |
cf<letter> |
N | Change from cursor to <letter> |
cw or ciw or caw or cW or caW or ciW or ce or cE |
N | Change from cursor to the end word |
cb or cB |
N | Change from cursor to the begin word |
cap or cip |
N | Change the current block |
ci( or ci) or ca( or ca) or cib or cab |
N | Change ( <text> ) block |
ci[ or ci] or ca[ or ca] |
N | Change [ <text> ] block |
ci{ or ci} or ca{ or ca} or ciB or caB |
N | Change { <text> } block |
ci< or ci> or ca< or ca> |
N | Change < <text> > block |
ci" or ca" |
N | Change " <text> " block |
ci' or ca' |
N | Change ' <text> ' block |
ci` or ca` |
N | Change ` <text> ` block |
cit or cat |
N | Change <tag> <text> </tag> block |
c or s or C or S |
V | Change the slected text in buffer et go to insert mode |
c |
V | Change the highlight text |
Keystrokes | Mode | Description |
---|---|---|
df<letter> |
N | Delete from cursor to <letter> |
dw or diw or daw or dW or daW or diW or de or dE |
N | Delete from cursor to the end word |
db or dB |
N | Delete from cursor to the begin word |
dap or dip |
N | Delete the current block |
di( or di) or da( or da) or dib or dab |
N | Delete ( <text> ) block |
di[ or di] or da[ or da] |
N | Delete [ <text> ] block |
di{ or di} or da{ or da} or diB or daB |
N | Delete { <text> } block |
di< or di> or da< or da> |
N | Delete < <text> > block |
di" or da" |
N | Delete " <text> " block |
di' or da' |
N | Delete ' <text> ' block |
di` or da` |
N | Delete ` <text> ` block |
dit or dat |
N | Delete <tag> <text> </tag> block |
dd |
N | Delete the current line |
S |
N | Delete the current line and change to insert mode |
D |
N | Delete from cursor to end end of line |
C |
N | Same as D but change in insert mode |
x or Del |
N | Delete char |
<C-u> |
I | Delete from cursor to start of the line |
<C-w> |
I | Delete previous word |
d or D or x or X |
V | Delete hightlith text |
Keystrokes | Mode | Description |
---|---|---|
{ or } or a{ or iw or aB or iB |
V | Highlight from cursor to the start or end of block or hilight text between { or } |
i[ or i] or a[ or a] |
V | Highlight [ <text> ] block |
i( or i) or a( or a) or ib or ab |
V | Highlight ( <text> ) block |
i< or i> or a< or a> |
V | Highlight < <text> > block |
ip or ap |
V | Highlight the current block |
it or at |
V | Highlight <tag> <text> </tag> block |
i" or i' or a" or a' |
V | Highlight " <text> " block |
w or aw or W or aW |
V | Highlight the current word |
e or iw or iW |
V | Highlight from cursor to the end of word |
b |
V | Highlight from cursor to the begin of word |
is or as |
V | Highlight sentence |
V |
V | Highlight the current line |
f<letter> |
V | Highlight from cursor to <letter> |
Keystrokes | Mode | Description |
---|---|---|
i |
N | Change normal to insert mode |
R |
N | Change normal to replace mode |
v |
N | Change normal to visual mode |
V |
N | Change normal to visual line mode |
<C-v> |
N | Change normal to visual block |
gh |
N | Change to select mode |
Keystrokes | Mode | Description |
---|---|---|
A |
N | Move the cursor after the end of line and change in insert mode |
^ or ` |
or _` |
N |
$ |
N | Move the cursor at the end of line |
I |
N | Add the cursor at the start of the line and change normal to insert mode |
W |
N | Jump to the next word (separate by a space) |
w or e |
N | Jump after the next separator ( , . , / , : , - , ` |
b |
N | Inverse of w |
B |
N | Inverse of W |
f<letter> or F<letter> |
N | Goto the next <letter> |
( or ) |
N | Sentence backword or forward |
{ or } |
N | Paragraph backward or forward |
[[ or ]] |
N | Goto the previous { or next } |
gg or H |
N | Move cursor to the first line and first column |
G |
N | Move the cursor to the last line and first colomn |
M |
N | Move cursor to the midle line on screen |
L |
N | Move cursor to the last line on screen |
/<search> or ?/<search> |
N | Jump forward/backward cursor to |
n or N |
N | Jump cursor to next or previous |
:<number> |
N | Goto line |
; |
N | Repeat last f, F, t, or T command |
% |
N | Jump between the nearest ( ) , [``] , or { } characters on the line. |
o or O |
V | Inverse cursor position |
Keystrokes | Mode | Description |
---|---|---|
r |
N | Replace single character at cursor |
r<letter> |
V | Replace the highlight text by <letter> |
:.,+2s/foo/bar/g |
N | Change each foo to bar for the current line . and the two next lines +2 |
:s/original_text_to_replace/new_text/g |
V | Replace original_text_roreplace by new_text for the highlight text |
Keystrokes | Mode | Description |
---|---|---|
p or P |
N | Paste the register |
<S-RightMouseClick |
I | Paste text |
o |
N | Add line below and change to insert mode |
O |
N | Add line above and change to insert mode |
a |
N | Change to insert mode after the cursor |
J |
N | Join lines |
u |
N | Undo |
<C-r> |
N | Redo |
. |
N | Repeat the last change |
< or > |
N | Indent current line |
< or > |
V | Indent highlight lines |
A or I |
V block | Add texte at the begin or end of the selected lines |
Keystrokes | Mode | Description |
---|---|---|
"ayy |
N | Copy current line into register a |
ip"by |
V | Copy current block into register b |
ip"cd |
V | Copy current block into register c and delete the block |
"d3dd |
N | Delete the next 3 lines and copy them in the register d |
"ap |
N | Paste the register a |
"_diw |
N | Prefix with "_ for without saving a copy in a register. In this exemple erase current word without saving a copy in the register |
:reg |
N | Show registers |
:reg a b c d |
N | Show registers a , b , c and d |
Keystrokes | Mode | Description |
---|---|---|
ma |
N | Register mak a |
'b |
N | Goto mark b at the begin of the line |
`c |
N | Goto mark c at the coulumn where the mark where registered |
'. |
N | Move the cursor to the line and column where the last edit was made |
`. |
N | Move the cursor to the line where the last edit was made |
:marks |
N | Show all marks |
:marks a b c |
N | Show marks a , b and c |
Keystrokes | Mode | Description |
---|---|---|
<C-w>s |
N | Split current screen horizontally |
<C-w>v |
N | Split current screen vertically |
<C-w>w |
N | Move cursor to the next split window |
<C-w>j or <C-w>↓ |
N | Move cursor to the bottom split window |
<C-w>k or <C-w>↑ |
N | Move cursor to the top split window |
<C-w>h or <C-w>← |
N | Move cursor to the left split window |
<C-w>l or <C-w>→ |
N | Move cursor to the right split window |
<C-w>q |
N | Close current split window |
<C-w>o |
N | Close all splits except the current split |
<C-w>9+ or :resize +9 |
N | Add 9 lines to the current horizontally split window |
<C-w>- or :resize -1 |
N | Remove a line to the current horizontally split window |
<C-w>9> or :vertical resize +9 |
N | Add 9 lines to the current vertically split window |
<C-w>2< or :vertical resize -2 |
N | Add 2 lines to the current vertically split window |
<C-w>_ |
N | Maximize current window |
<C-w>= |
N | Resize all windows to equal size |
:sp [file] |
N | Open new horizontally split window |
:vsp [file] |
N | Open new vertically split window |
Keystrokes | Mode | Description |
---|---|---|
setlocal foldmethod=<method> |
N | Use methods indent for python for example or syntax for other languages |
zi |
N | Switch folding on or off |
za |
N | Toggle current fold open/closed |
zA |
N | Recursively open/close current fold |
zc |
N | Close current fold |
zR |
N | Open all folds |
zr |
N | Increase foldlevel by one |
Zm |
N | Reduce foldlevel by one |
zM |
N | Close all folds |
zv |
N | Expand folds to reveal cursor |
zj |
N | Move down to top of next fold |
zk |
N | Move down to top of next fold |
zo |
N | Open current fold |
zO |
N | Recursively open current fold |
Main key mapping (read officials documentations plugins for all key mapping) :
Plugin | Mode | Keystrokes | Description |
---|---|---|---|
Alias (builtin) | N | <Leader>/ |
Toggle inlight search |
Alias (builtin) | N | <Tab> |
Next buffer |
Alias (builtin) | N | <S-Tab> |
Previous buffer |
Alias (builtin) | N | <C-d> |
Delete Buffer |
Alias (builtin) | N | <F9> |
Toggle wrap lines |
Alias (builtin) | N | <F10> or <Leader><Leader>l |
Toggle cursorline |
Alias (builtin) | N | <F11> or <Leader><Leader>n |
Toggle line number |
Alias (builtin) | N | <F12> |
Toggle paste mode |
Alias (builtin) | N | <Space> |
Toggle folding |
ultisnips and vim-nippets | I | <Tab> |
Execute the snippet |
vim-multiple-cursors | N | <C-n> |
Highlights the current word. Press more for select the same next word |
vim-multiple-cursors | N | <C-x> |
Skip the current word |
matchit.zip | N | % |
Select next/previous bracket |
vim-easymotion | N | <Leader></Leader>s |
Search word begin by... |
vim-easymotion | N | <Leader></Leader>w |
Print all word backward / forward |
wildfire.vim | N | <CR> |
Select text |
nerdtree | N | <Leader>e |
Open NerdTree |
ctrlp.vim | N | <C-p> |
Open ctrlp for search file |
gundo.vim | N | <Leader>u |
Open Gundo for show all undo |
youcompleteme | N | <F2> |
Load YouCompleteMe (disable at load because too heavy). Load also the (vim-snippets)[#vim-snippets] and ultisnips plugin. |
tagbar | N | <F3> |
Open Tagbar for show all vars, functions, classes... |
vim-solarized8 / gruvbox | N | <F5> |
Switch dark/ligh background |
rainbow | N | <Leader><Leader>r |
Toggle plugin Rainbow |
HTML-AutoCloseTag | N | <Leader>ac |
Toggle plugin HTML-AutoCloseTag |
vim-indent-guides | N | <Leader>ig |
Toggle plugin vim-indent-guides |
vim-signify | N | <Leader>gg |
Toggle plugin vim-signigy |
vim-signify | N | <Leader>gh |
Toggle text highlighting |
vim-signify | N | <Leader>gj |
Goto next diff |
vim-signify | N | <leader>gk |
Goto previous diff |
- vim-easy-align key mapping :
- official plugin key mapping
- Examples
After have pressed <Leader>aip
/ gaip
or selected text in visual mode and pressed <Leader>
/ ga
:
Keystrokes | Description | Equivalent command |
---|---|---|
<Space> |
Around 1st whitespaces | :'<,'>EasyAlign\ |
2<Space> |
Around 2nd whitespaces | :'<,'>EasyAlign2\ |
-<Space> |
Around the last whitespaces | :'<,'>EasyAlign-\ |
-2<Space> |
Around the 2nd to last whitespaces | :'<,'>EasyAlign-2\ |
: |
Around 1st colon (key: value ) |
:'<,'>EasyAlign: |
<Right>: |
Around 1st colon (key : value ) |
:'<,'>EasyAlign:>l1 |
= |
Around 1st operators with = | :'<,'>EasyAlign= |
3= |
Around 3rd operators with = | :'<,'>EasyAlign3= |
*= |
Around all operators with = | :'<,'>EasyAlign*= |
**= |
Left-right alternating around = | :'<,'>EasyAlign**= |
<Enter>= |
Right alignment around 1st = | :'<,'>EasyAlign!= |
<Enter>**= |
Right-left alternating around = | :'<,'>EasyAlign!**= |
Key | Option | Values |
---|---|---|
CTRL-F |
filter |
Input string ([gv]/.*/? ) |
CTRL-I |
indentation |
shallow, deep, none, keep |
CTRL-L |
left_margin |
Input number or string |
CTRL-R |
right_margin |
Input number or string |
CTRL-D |
delimiter_align |
left, center, right |
CTRL-U |
ignore_unmatched |
0, 1 |
CTRL-G |
ignore_groups |
[] , ['String'] , ['Comment'] , ['String', 'Comment'] |
CTRL-A |
align |
Input string (/[lrc]+\*{0,2}/ ) |
<Left> |
stick_to_left |
{ 'stick_to_left': 1, 'left_margin': 0 } |
<Right> |
stick_to_left |
{ 'stick_to_left': 0, 'left_margin': 1 } |
<Down> |
*_margin |
{ 'left_margin': 0, 'right_margin': 0 } |
- vim-surround key mapping :
- Tutorial
Key | Description |
---|---|
ds" |
Delete " |
dst |
Delete tag |
cs"' |
Change " by ' |
cS'<p> |
Change ' by <p> on separate lines |
ys$" |
Add " around some text at the end of a line |
ys3w) |
Add ( ) arround 3 next words |
ySf"t |
Add a tag on a separate line around " |
viwS* |
Add * arround the current word |
Shift-v<highlight the text>S<p> |
Add tag <p></p> arround the text on a separate line |
Ctrl-v<highlight the text>S<li> |
Add tag <li></li> arround each line |
Target | Explanation |
---|---|
( or ) |
Bracket. Using an open bracket adds additional spaces. Using a closed bracket doesn't add space. |
{ or } |
Squiggly brackets. Using an open one ({) adds additional spaces. Using a closed one doesn't add space. |
[ or ] |
Square brackets. Using an open bracket ie [ adds additional spaces. A closed one doesn't add spaces. |
< or > |
Diamond bracket. Using an open one (<) adds additional spaces. A closed one doesn't add spaces. |
b |
Bracket, alternative to ( |
B |
Bracket, alternative to ) |
r |
Alias for } |
a |
Alias for ] |
` |
A backtick |
" |
A quote |
' |
A single quote |
t |
A pair of HTML or XML tags |
w |
A word |
s |
A sentence. I avoid as it's a bit confusing, it only works with cs and it mentally conflicts with yss meaning to work on the current line. |
p |
A paragraph. |
- vim-fugitive key mapping :
Keystoke | Command |
---|---|
gs | :Gstatus |
gd | :Gdiff |
gc | :Gcommit |
gb | :Gblame |
gl | :Glog |
gp | :Git push |
gr | :Gread |
gw | :Gwrite |
ge | :Gedit |
gi | :Git add -p % |
- vim-signature key mapping :
Keystroke | Action |
---|---|
mx |
Toggle mark x and display it in the leftmost column |
dmx |
Remove mark called x |
m, | Place the next available mark |
m. | If no mark on line, place the next available mark. Otherwise, remove (first) existing mark |
m- | Delete all marks from the current line |
m<space> |
Delete all marks from the current buffer |
]` | Jump to next mark |
[` | Jump to prev mark |
]' | Jump to start of next line containing a mark |
[' | Jump to start of prev line containing a mark |
`] | Jump by alphabetical order to next mark |
`[ | Jump by alphabetical order to prev mark |
'] | Jump by alphabetical order to start of next line having a mark |
'[ | Jump by alphabetical order to start of prev line having a mark |
m/ | Open location list and display marks from current buffer |
m[0-9] | Toggle the corresponding marker !@#$%^&*() |
m<S-[0-9]> |
Remove all markers of the same type |
]- | Jump to next line having a marker of the same type |
[- | Jump to prev line having a marker of the same type |
]= | Jump to next line having a marker of any type |
[= | Jump to prev line having a marker of any type |
m? | Open location list and display markers from current buffer |
<BS> |
Remove all markers |
vim-cursor go to previous position when opening a vim buffer.
vim-solarized8 is the dark vim theme.
If you use vim with Putty, you should install this reg file for compatibility colors.
Use Putty 0.71 minimal release to have true color compatibility. At the time I wrote these lines, Putty 0.71 was not been released and you must download the snapshot release that contain the true (24-bit) color patch.
gruvbox is the light vim theme.
If you use vim with Putty, you should install this reg file for compatibility colors.
Use Putty 0.71 minimal release to have true color compatibility. At the time I wrote these lines, Putty 0.71 was not been released and you must download the snapshot release that contain the true (24-bit) color patch.
vim-airline is a color status/tabline bar.
If you use vim with Putty, you must install compatible fonts like DejaVuSansMono and apply this reg file.
vim-airline-themes are themes for vim-airline.
vim-indent-guides is a plugin for visually displaying indent levels in Vim.
vim-startify is a plugin that provides a start screen.
vim-signature display and navigate between marks.
auto-pairs insert or delete brackets, parens, quotes in pair.
vim-multiple-cursors is a multiple selection feature into Vim.
matchit.zip script allows you to configure % to match more than just single characters.
vim-easy-align is a simple, easy-to-use Vim alignment plugin.
vim-easymotion provides a much simpler way to use some motions in vim.
vim-surround is all about "surroundings": parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change and add such surroundings in pairs.
vim-repeat remaps .
in a way that plugins can tap into it. (Compatibility for vim-surround)
wildfire.vim can quickly select the closest text object among a group of candidates.
nerdcommenter can do comments for some filetype.
syntastic is a syntax checking.
nerdtree allows you to explore your filesystem and to open files and directories. It presents the filesystem to you in the form of a tree which you manipulate with the keyboard and/or mouse. It also allows you to perform simple filesystem operations.
vim-fugitive add git functionalities to Vim.
vim-signify uses signs to indicate added, modified and removed lines based on data of an underlying version control system.
ctrlp.vim is a full path fuzzy file, buffer, mru, tag, ... finder for Vim.
rainbow help you read complex code by showing diff level of parentheses in diff color.
HTML-AutoCloseTag automatically closes HTML tag once you finish typing it with >
.
gundo.vim is Vim plugin to visualize your Vim undo tree.
tagbar is a Vim plugin that provides an easy way to browse the tags of the current file and get an overview of its structure. It does this by creating a sidebar that displays the ctags-generated tags of the current file, ordered by their scope. This means that for example methods in C++ are displayed under the class they are defined in.
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim.
- for use : Vim compiled with
python
+python
+Exuberant Ctags
- for compilation :
python
+python-devel
+cmake
+g++
YCM has been compile with ./install.py
. If you want more see below :
- If you want YCM with semantic support for C-family languages :
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
- To simply compile with everything enabled, there's a
--all
flag. So, to install with all language features, ensurexbuild
,go
,tsserver
,node
,npm
,rustc
, andcargo
tools are installed and in yourPATH
, then simply run :
cd ~/.vim/bundle/YouCompleteMe
./install.py --all
vim-snippets contains snippets files for various programming languages.
ultisnips is the ultimate solution for snippets in Vim. It has tons of features and is very fast.
- Write
set undofile
andset undodir
in .vimrc file for have persistent undo
- Disable cursorline
:set nocursorline
(or pressF10
or press<Leader><Leader>l
) if you have some lags. - If you have some prblems with plugins, try to delete ~/.vim/bundle/.cache directory or under vim run :
call map(dein#check_clean(), "delete(v:val, 'rf')")
call dein#recache_runtimepath()