My neovim config for colemak users
- Backup your nvimrc:
cd ~/.config; mv nvim nvim_back
- Install npm
- Install yarn
- Install fzf
- Install ripgrep
- Install ranger
- Install lazygit
- Run in terminal:
pip install neovim sudo npm install -g neovim sudo npm -g install instant-markdown-d sudo npm -g install instant-markdown-d@next pip install --user smdv
- Clone this repository:
git clone https://github.com/2018WANZ24/nvim-colemak.git ~/.config/nvim/
- vim-plug (plugin manager) will automatically install to
~/.config/nvim/autoload/plug.vim
- In nvim, run
:PlugInstall
Shortcut | Action |
---|---|
n |
Cursor left |
e |
Cursor down |
u |
Cursor up |
i |
Cursor right |
l |
Undo |
k |
Insert mode |
K |
Insert text before the first non-blank in the line |
h |
Forward to the end of word |
H |
Forward to the end of WORD |
- |
Search previous |
= |
Search next |
<C-h> |
Go to start of the line (insert/command mode) |
<C-o> |
Go to end of the line (insert/command mode) |
<C-u> |
Up (insert mode) |
<C-e> |
Down (insert mode) |
<C-l> |
Previous command history (Command mode) |
<C-y> |
Next command history (Command mode) |
<C-u> |
Previous page |
<C-e> |
Next page |
N |
Cursor to the first non-blank of the line |
I |
Cursor to the end of the line |
W |
Move cursor 5 words forward |
B |
Move cursor 5 words backward |
> |
Indent |
< |
Un-indent |
` | Toggle case |
; |
Command mode |
j |
Go to pair |
vv |
Select non-blank of the line except \n |
<Esc> |
No highlight search |
Q |
Record typed characters into register |
q |
Quit |
S |
Save |
<A-r> |
Replace |
<A-s> |
Source nvim configuration file |
<C-c> |
cd |
<Leader>ad |
Find adjacent duplicated word |
<Ledder>as |
Spell check |
,r |
Insert placeholder <++> (Insert mode) |
,f |
Go to next placeholder <++> (Insert mode) |
Shortcut | Action |
---|---|
sN |
Split left |
sE |
Split below |
sU |
Split above |
sI |
Split right |
<Space> number |
Go to window by number |
sn |
Go one window left |
se |
Go one window below |
su |
Go one window above |
si |
Go one window right |
<Up> |
(Horizontal) Window size +5 lines |
<Down> |
(Horizontal) Window size -5 lines |
<Right> |
(Vertical) Window size +5 lines |
<Left> |
(Vertical) Window size -5 lines |
sh |
Set the two splits to be horizontal |
sv |
Set the two splits to be vertical |
srh |
Rotate splits and arrange splits horizontally |
srv |
Rotate splits and arrange splits vertically |
sf |
Go to next window |
sc |
Close other windows |
sq |
Close next window |
Shortcut | Action |
---|---|
ss |
New tab |
sS |
Tab split |
<Leader> number |
Go to tab by number |
sl |
Go to previous tab |
sy |
Go to next tab |
sml |
Move tab to the left |
smy |
Move tab to the right |
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 |
-------- |
Shortcut | Action |
---|---|
<Space>rr |
Run |
In order to move the cursor up x
(x
> 6) lines, press the [
key, and treat the middle row of the Colemak keyboard layout ("arstdhneio") as number 1 to 0. Press the numbers that you'd like your cursor to move (x
).
To move the cursor down, press the '
key instead of the [
key, and the rest would be the same.
If 2 <= x
<= 6, "qwfpg" as number 2 to 6.
Example:
Shortcut | Action |
---|---|
'q |
Move the cursor down 2 lines |
'w |
Move the cursor down 3 lines |
[f |
Move the cursor up 4 lines |
'p |
Move the cursor down 5 lines |
'g |
Move the cursor down 6 lines |
'n |
Move the cursor down 7 lines |
'e |
Move the cursor down 8 lines |
[ao |
Move the cursor up 10 lines |
'rs |
Move the cursor down 23 lines |
[do |
Move the cursor up 50 lines |
Note: As of now, you may only move vertically up to 69 lines with this key configuration!
The plugin manager is vim-plug.
-
vim-airline (statusline) and vim-airline-themes (vim-airline colorthemes)
-
nvim-treesitter (highlight)
Shortcut | Action |
---|---|
<C-e> |
Next completion |
<C-u> |
Previous completion |
<Tab> |
Complete |
<C-o> |
Refresh completion |
g[ |
Go to previous diagnostic |
g] |
Go to next diagnostic |
gd |
Go to definition |
gD |
Tab split and go to definition |
gy |
Go to type definition |
gi |
Go to implementation |
gr |
Go to references |
<Space>h |
Show documentation |
mr |
Rename |
maf |
Format selected |
mas |
Code actions |
<operation> kf |
Operation for what is in a function |
<operation> af |
Operation for the whole function |
<operation> kc |
Operation for what is in a class |
<operation> ac |
Operation for the whole class |
<C-]> /<C-[> |
Scroll a floating window |
<C-l> |
Jump to previous snippets placeholder (insert mode) |
<C-y> |
Jump to next snippets placeholder (insert mode) |
<Space>ol |
Show flutter outline (Only works in dart files) |
<Space>t |
Toggle file explorer |
<Space>y |
Show yank history |
<A-t> |
Translate current word |
<Space>f |
Search files in current directory |
<Space>p |
Search contents of files in current directory |
<Space>w |
Search buffers |
<Space>s |
Search contents of lines in current file |
<Space>oc |
Search commands |
<Space>oa |
Search tasks |
<Space>ot |
Search floaterms |
<Space>od |
Show diagnostics |
g- |
Go to previous git hunk |
g= |
Go to next git hunk |
gF |
Go to previous git conflict |
gf |
Go to next git conflict |
gf |
Preview current git hunk |
<operation> kg |
Operation for what is in a git hunk |
<operation> ag |
Operation for the whole git hunk |
gl |
Undo current git hunk |
gs |
Stage current git hunk |
zg |
Fold unchanged (git) |
gp |
Git push |
Shortcut | Action |
---|---|
<Space>rf |
Run current file |
<Space>rbf |
Build current flie |
<Space>rp |
Run current project |
<Space>rbp |
Build current project |
Shortcut | Action |
---|---|
<Space>v |
Toggle taglist |
Shortcut | Action |
---|---|
L |
Toggle undotree |
u |
Move cursor up a state |
e |
Move cursor down a state |
U |
Move cursor up 5 states |
E |
Move cursor down 5 states |
Shortcut | Action |
---|---|
go |
Open lazygit |
Shortcut | Action |
---|---|
R |
Open ranger |
<C-t> |
Open the file in a new tab |
<C-x> |
Split up and down with the file |
<C-p> |
Split left and right with the file |
gw |
Change ranger's cwd to nvim's |
yw |
Change nvim's cwd to ranger's |
Shortcut | Action |
---|---|
mc |
Comment current line or selection |
mv``operation |
Comment lines |
The vim-visual-multi leader is ,
.
Shortcut | Action |
---|---|
<C-k> |
Find Under/Find Subword Under |
E |
Select Cursor Down |
U |
Select Cursor Up |
Shortcut | Action |
---|---|
<A-w> |
Wrap word or pair (insert mode) |
Shortcut | Action |
---|---|
<A-u> |
New floterm |
<A-e> |
Toggle floterm |
<A-n> |
Previous floterm |
<A-i> |
Next floterm |
<A-q> |
Kill current floterm |
stn |
New floterm on the left |
ste |
New floterm below |
stu |
New floterm above |
sti |
New floterm on the right |
<A-x> |
Normal mode |
<A-w> |
Go to next window |
Shortcut | Action |
---|---|
<Leader>t <text> <CR> |
Align with text |