- Install MacVim and use Iterm2 if something is not working right
- See
_machine_specific.vim
- Install
cmake
- Run
sudo python3 [your vim folder]/plugged/install.py
- For python:
sudo pip3 install pylint autopep8 yapf
- Install
ctags
for function/class/variable list
k
: to switch to INSERT
: mode, equals to key i
Q
: quit current vim window, equals to command :q
S
: save the current file, equals to command :w
IMPORTANT
Since the i
key has been mapped to k
, every command (combination) that involves i
should use k
instead (for example, ciw
should be ckw
).
Command | What it does | Equivalent (QWERTY) |
---|---|---|
u |
cursor up a terminal line | k |
e |
cursor down a terminal line | j |
n |
cursor left | h |
i |
cursor right | l |
U |
cursor up 5 terminal lines | 5k |
E |
cursor down 5 terminal lines | 5j |
N |
cursor to the start of the line | 0 |
I |
cursor to the end of the line | $ |
Ctrl u |
move the view port up 5 lines without moving the cursor | Ctrl y |
Ctrl e |
move the view port down 5 lines without moving the cursor | Ctrl e |
w |
next word | |
h |
move to the end of this word | e |
b |
previous word |
Command | What it does |
---|---|
<C-i> |
Go to the next cursor position |
<C-o> |
Go to the previous cursor position |
<C-a> |
Increase the number under cursor by 1 |
<C-x> |
Decrease the number under cursor by 1 |
z= |
Show spell suggestions |
Command | What it does |
---|---|
su |
Create a new horizontal split screen and place it above the current window |
se |
Create a new horizontal split screen and place it below the current window |
sn |
Create a new vertical split screen and place it left to the current window |
si |
Create a new vertical split screen and place it right to the current window |
sv |
Set the two splits to be vertical |
`sh | Set the two splits to be horizontal |
Action | Shortcut | Command |
---|---|---|
Move cursor to the next window | <SPACE>w |
<C-w>w |
Action | Shortcut | Command |
---|---|---|
Toggle NerdTree | tt |
:NERDTreeToggle |
Action | Shortcut | Command |
---|---|---|
Active CtrlP | Ctrl p |
:CtrlP<CR> |
Move up 1 item | Ctrl u |
|
Move down 1 item | Ctrl e |
|
Action | Shortcut | Command |
---|---|---|
Go to definition | gd |
:YcmCompleter GoToDefinitionElseDeclaration<CR> |
Get documentation | g/ |
:YcmCompleter GetDoc<CR> |
Get type | gt |
:YcmCompleter GetType<CR> |
Go to references | gr |
:YcmCompleter GoToReferences |
Press Shift
+ L
to open Undotree
Action | Shortcut | Command |
---|---|---|
Add/remove mark at current line | m<letter> |
|
List all marks | m/ |
|
Jump to the next mark in buffer | m<SPACE> |
For more commands, see here
Toggle "Table Editing Mode" with <SPACE>tm
(equals to command :TableModeToggle<CR>
)
tx Hello<Enter>
_ _ _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
| _ | __/ | | (_) |
|_| |_|\___|_|_|\___/