Follows the guide in http://valloric.github.io/YouCompleteMe/, this will take very long time (around 1 hour in my PC). For short, the steps for setting up javascript auto completion are:
cd ~/.vim/bundle/YouCompleteMe
./install.py --tern-completer
You will also need to setup a tern config file if you used --tern-complete in above step.
(visual mode)Search next for the current selection
*
(normal mode) Keep search pattern at the center of the screen
#
(visual mode) Search previous for the current selection
#
(normal mode) Keep search pattern at the center of the screen
;
Enter command line, same as :
n
(normal mode) Keep search pattern at the center of the screen
N
(normal mode) Keep search pattern at the center of the screen
U
easier redo, same as Ctrl+r
v
expand selection region (Plugin: vim-expand-region)
V
shrink selection region (Plugin: vim-expand-region
w!!
sudo & write a file
Y
Yank everthing from cursor to end of line
yy
Yank the whole line
,q
Quickly close current window, same as :q
,v
Select block
,w
Fast saving, same as :w!
:w!!
Sudo write a file
{Space}
Page down
CTRL+@
Page up
Fn Keys
Key
Function
F2
Toggle Tagbar (Plugin: tagbar)
F3
Do Syntastic check
F4
Toggle Syntastic error window
F5
Toggle NERDTree (Plugin: NERDTree)
F8
Switch Color Scheme (Plugin: vim-colorscheme-switch)
F10
Quick run current file (plugin: quickrun)
F11
Toggle line number and indent line, useful when you copy screen
F12
Toggle Paste mode
CTRL+?
Key
Function
CTRL+b
Go to the beginning of line (only in INSERT mode)
CTRL+d
Scroll down half a page
CTRL+e
Go to the end of line (only in INSERT mode)
CTRL+f
Prompt in commandline to use CtrlSF to search
CTRL+i
Retrace you movement in file in forwards
CTRL+l
Jump to the previous snippet trigger (Plugin: UltiSnips)
CTRL+m
Select current word and jump to next (Plugin:vim-multiple-cursors)
CTRL+n
Jump to the next snippet trigger (Plugin: UltiSnips)
CTRL+o
Retrace your movement in file in backwards
CTRL+p
Select previous word and jump to previous (Plugin: vim-multiple-cursors)
CTRL+s
Save current file, mapping of :w!
CTRL+t
Open the command-t file window
CTRL+u
Scrool up half a page
CTRL+x
Skip current word (Plugin: vim-multiple-cursors)
CTRL+y
Format source file (plugin: vim-autoformat)
{Leader}?
Key
Function
,bb
Open a window listing all buffers (Plugin: buffergator)
,cp
toggle on/off numbers on the left
,B
Close the buffer catalog (Plugin: buffergator) ---- Disabled
,n
Toggle NERDTree
,r
Quick run current file (plugin: quickrun)
,w
Fast saving, same as :w!
,q
Quickly close current window, same as :q
,v
Select block
` Hotkey
Key
Function
`e
create a new line in the end of file and jump to it
`b
move backward to last cursor position
``
move backward to last cursor position
`f
move foreward to last cursor position
`/
remove hightlight words
Line Movement
Key
Function
,lj
Move current line to above
,lk
Move current line to below
Tab
Key
Function
,te
Open a new tab with the current buffer's path, Super useful when editing files in the same director
,tm
Tab move
,tn
Go to next tab
,to
Tab only
,tp
Go to previous tab
,tq
Close tab
,tt
Create new tab
,1
Go to 1st tab
,2
Go to 2nd tab
,3
Go to 3rd tab
,4
Go to 4th tab
,5
Go to 5th tab
,6
Go to 6th tab
,7
Go to 7th tab
,8
Go to 8th tab
,9
Go to 9th tab
,0
Go to last tab
Window
Key
Function
,wh
Go to left window
,wj
Go to above window
,wk
Go to below window
,wl
Go to right window
,wq
Close window
,ww
Switch to next window
,wz
Toggle zoom current window
Buffer
Key
Function
,bb
Open a window listing all buffers (Plugin: buffergator)
,B
Close the buffer catalog (Plugin: buffergator) --- Disabled
,bb
Create new buffer
,bn
Go to next buffer
,bp
Go to previous buffer
Misc
ref: https://www.linux.com/learn/vim-tips-folding-fun
zf#j creates a fold from the cursor down # lines.
zf/string creates a fold from the cursor to string.
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.
Misc
Key
Function
,~m
Remove the windows ^M when the encoding gets messed up
open the currently selected buffer in the previous window, but with focus remaining in the buffer catalog ("42go" will do the same, but will select buffer number 42).
{Number}{Enter}
Open buffer number in prevous window, such as 42*{Enter}, 5{Enter}*
A
Toggle zoom in/zoom out the vim-buffergator window
d
Delete the selected buffer
D
Unconditionally delete the selected buffer.
i
open the currently selected buffer in new horizontal split. "42i" will do the same
I
open the buffer in a new vertical split, but keep the focus in the buffer catalog. "42I" will do the same.
q
Quit the index/catalog window.
r
Update (rebuild/refresh) index.
s
Open the currently selected buffer in new vertical split. "42s" will do the same.
S
open the buffer in a new vertical split, but keep the focus in the buffer catalog. "42S" will do the same
t
open the currently selected buffer in new tab ("42t" will do the same, but will select buffer number 42)
x
Wipe the selected buffer.
X
Unconditionally wipe the selected buffer.
{Space} or CTRL+N
Go to the next buffer entry (or, if [count] is given, buffer with number [count]), and preview it in the previous window.
CTRL+{Space} or CTRL+P
Go to the previous buffer entry (or, if [count] is given, buffer with number [count]), and preview it in the previous window.
To support the vim-airline or vim-powerline, the terminal font must be patched. You don't need to patch by yourself, you just need to download and install the patched font from following address: