Please DO NOT just copy this config without really looking at it! Please, at least, read this README file!
- Things to Know After Installation
- Keyboard Shortcuts
- Plugin Shortcuts
- AutoComplete / Snippets
- File Browsing/Management
- Git
- Find / Replace
- Text Editing
- Editor Enhancement
- Vista.vim (Taglist)
- Undotree
- vim-startify (Startup Screen)
- vim-signiture (Bookmarks)
- vim-calc
- AutoFormat
- Goyo (Remove distractions)
- Vim Apps
- Custom Markdown Snippets
- Other Weird Stuff
- Install
pynvim
(pip) - Install
nodejs
, and donpm install -g neovim
- Install nerd-fonts (actually it's optional but it looks real good)
- Do
:checkhealth
- Well, make sure you have python
- See
_machine_specific.vim
Python:
- Do
pip3 install flake8
(for linting)
- Install
ctags
for function/class/variable list
- Install
ripgrep
- Install
fd
- Install
figlet
for inputing text ASCII art - Install
xclip
for system clipboard access (Linux
andxorg
only)
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
).
Shortcut | Action | Equivalent |
---|---|---|
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 |
h |
Move to the end of this word | e |
W |
Move cursor five words forward | 5w |
B |
Move cursor five words forward | 5b |
Shortcut | Action |
---|---|
Ctrl a |
Move cursor to the end of the line |
Ctrl u |
Move the character on the right of the cursor to the end of the line |
Shortcut | Action |
---|---|
l |
undo |
< |
Un-indent |
> |
Indent |
Ctrl a |
Increase the number under cursor by 1 |
Ctrl x |
Decrease the number under cursor by 1 |
SPACE SPACE |
Goto the next placeholder (<++> ) |
Shortcut | Action |
---|---|
r |
Compile/Run the current file |
Y |
Copy selected text to system clipboard |
z = |
Show spell suggestions |
SPACE s c |
Toggle spell suggestion a |
SPACE d w |
Find adjacent duplicated word |
SPACE t t |
Convert every 4 Spaces to a tab |
SPACE o |
Fold |
SPACE - |
Previous quick-fix position |
SPACE + |
Next quick-fix position |
\ p |
Show the path of the current file |
Shortcut | Action |
---|---|
s u |
Create a new horizontal split screen and place it above the current window |
s e |
Create a new horizontal split screen and place it below the current window |
s n |
Create a new vertical split screen and place it left to the current window |
s i |
Create a new vertical split screen and place it right to the current window |
s v |
Set the two splits to be vertical |
s h |
Set the two splits to be horizontal |
s r v |
Rotate splits and arrange splits vertically |
s r h |
Rotate splits and arrange splits horizontally |
Shortcut | Action |
---|---|
SPACE + w |
Move cursor to the next window |
SPACE + n |
Move cursor one window left |
SPACE + i |
Move cursor one window right |
SPACE + u |
Move cursor one window up |
SPACE + e |
Move cursor one window down |
Use the arrow keys to resize the current window.
Shortcut | Action |
---|---|
Q |
Close the current window |
SPACE q |
Close the window below the current window. (The current window will be closed if there is no window below) |
Shortcut | Action |
---|---|
t u |
Create a new tab |
t n |
Go one tab left |
t i |
Go One tab right |
t m n |
Move tab left |
t m i |
Move tab right |
Shortcut | Action |
---|---|
SPACE / |
Create a new split with a terminal below the current window |
Ctrl n |
Escape from terminal input mode |
Shortcut | Action |
---|---|
Space y |
Get yank history list |
gd |
Go to definition |
gr |
List references |
gi |
List implementation |
gy |
Go to type definition |
Space r n |
Rename a variable |
Shortcut | Action |
---|---|
Ctrl e |
Expand a snippet |
Ctrl n |
(in snippet) Previous Cursor position in snippet |
Ctrl e |
(in snippet) Next Cursor position in snippet |
Shortcut | Action |
---|---|
tt |
Toggle NerdTree |
I |
Open in new split |
O |
Open in new tab |
l |
Change root |
z h |
Toggle hidden |
, (in NERDTREE) |
Toggle menu |
Shortcut | Action |
---|---|
H |
Show git hunk at current line |
SPACE g - |
Go to previous git hunk |
SPACE g + |
Go to next git hunk |
SPACE g f |
Fold everything except hunks |
Shortcut | Action |
---|---|
SPACE t m |
Toggle table mode |
SPACE t r |
Realign table |
See :help table-mode.txt
for more.
Shortcut | Action |
---|---|
T |
toggle function and variable list |
Ctrl t |
open function/class/variable finder |
Shortcut | Action |
---|---|
Ctrl p |
Active FZF |
Ctrl u |
Move up 1 item |
Ctrl e |
Move down 1 item |
Shortcut | Action |
---|---|
Shift + L |
Open Undotree |
Shift + K |
History go up |
Shift + J |
History go down |
- Make sure you have ranger installed
Press
R
to open Ranger (file selector)
Press Space
s
t
to openup startify
Shortcut | Action | Command |
---|---|---|
m<letter> |
Add/remove mark at current line | |
m/ |
List all marks | |
mSPACE |
Jump to the next mark in buffer |
For more commands, see here
Shortcut | Action |
---|---|
Ctrl +k |
Select next word (multiple cursors) |
Ctrl +p |
Select previous word |
Ctrl +x |
Skip word |
Esc |
Quit mutiple cursors |
To add surround (string
-> "string"
):
string
press: yskw'
:
'string'
To change surround
'string'
press: cs'"
:
"string"
Shortcut | Action |
---|---|
SPACE f a |
Find in the current file |
SPACE f r |
Find and replace |
Press Space
g
i
to create a .gitignore
file
Shortcut | Action |
---|---|
g v |
Open commit browser |
q |
Quit GV window |
Press Space
+ a
to calculate the equation in the current line
Shortcut | Action |
---|---|
\ \ |
Show clock |
\ c |
Show calendar |
Press \
f
to format code
Press g
y
to toggle Goyo
Shortcut | What it creates |
---|---|
,n |
--- |
,b |
Bold text |
,s |
|
,i |
italic text |
,d |
code block |
,c |
big block of code |
,m |
- [ ] check mark |
,p |
picture |
,a |
link |
,1 |
# H1 |
,2 |
## H2 |
,3 |
### H3 |
,4 |
#### H4 |
,l |
-------- |
,f
to go to the next <++>
(placeholder)
,w
to go to the next <++>
(placeholder) and then press Enter
for you
tx Hello<Enter>
_ _ _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
| _ | __/ | | (_) |
|_| |_|\___|_|_|\___/