Skip to content
冷酔閑吟 edited this page Jan 14, 2023 · 55 revisions

The default leader key is <Space>.

Effect Shortcut
open vscode like command panel <C-p>
sync config and compile <leader>ps
compile without plugins update <leader>pc
toggle nvim-tree <C-n>
refresh nvim-tree <leader>nr
toggle tagbar go
toggle undotree <leader>u
Terminal
open vertical terminal <C-w>t or <F5>
toggle horizontal terminal <C-\>
quit terminal <C-d>
toggle floating terminal <A-d>
Buffer navigation
pick buffer n(nmeans No) <A-n>
right buffer <A-j>
left buffer <A-k>
move current buffer to right <A-S-j>
move current buffer to left <A-S-k>
close current buffer <A-q>
close current window <A-S-q>
split buffer vertically <C-w>v
split buffer horizontally <C-w>s
navigate down <C-j>
navigate up <C-k>
navigate left <C-h>
navigate right <C-l>
Operaions in nvim-tree
new file a
remove file/directory d
rename file/directory r
open directory o/Enter
close directory o/Backspace
copy filename y
copy relative path Y
copy absolute path gy
toggle file/directory begin with dot H
toggle hidden file/directory configured in nvim-tree I
find file in recently opened <leader>fr
find buffer in opened buffers <leader>fb
find file in history <leader>fe
find file in current work directory <leader>ff
find directory recorded by zoxide <leader>fz
find project <leader>fp
add project <leader>fpthen<C-A>
delete project <leader>fpthen<C-D>
escape insert mode jk
[fold current]/[unfold collapsed] block <S-Tab>
back to last cursor's place <C-O>
preview definition gd
jump to definition gD
smart rename gr
toggle last diagnostics gt
toggle lsp references gR
show signature help gs
show current function/variable's definition or references gh
request incoming calls from the language server <leader>ci
request outcoming calls from the language server <leader>co
show hover doc K
show code action ga
code diagnostics of the current line <leader>sl
code diagnostics under the cursor <leader>sc
toggle lsp document diagnostics <leader>td
toggle lsp workspace diagnostics <leader>tw
toggle code quickfix <leader>tq
toggle code loclist <leader>tl
Navigate in snippet
next snippet's block <Tab>
prev snippet's block <S-Tab>
Navigate in quote or bracket
jump to quote end <A-l>
back to quote begin <A-h>
Code selection
select block manually vm
select current () block vab
select current {} block vaB
select current outer function block vaf
select current outer class block vac
select current inner function block vif
select current inner class block vic
Code-snip Run
Snip run in visual mode <leader>r
Snip run for whole file in normal mode <leader>r
Cursor movement
jump to one line <leader>j/<leader>k
find one word <leader>w
find one character <leader>c
find two characters below cursor <leader>cc
find one characterx in front of cursor Fx
find one characterx behind cursor fx
find next characterx follow direction ;
find prev characterx follow direction ,
next function begin ][
prev function begin [[
next function end ]]
prev function end []
next unstage git hunk ]g
prev unstage git hunk [g
next code diagnostics g]
prev code diagnostics g[
Code comment
toggle one line's comment gcc
toggle selected lines' comment <S-V>, select area then gc
Markdown preview
toggle MarkdownPreView <F12>
Session management
Save current session <leader>ss
Restore last session <leader>sr
Delete last session <leader>sd
Debug mode(supports c&cpp&rustgolang&python now)
Debug continue(run) F6
Debug disconnect F7
Debug toggle breakpoint F8
Debug step into F9
Debug step out F10
Debug step over F11
Debug run last <leader>dl
Debug run to cursor <leader>dc
Debug set breakpoint with condition <leader>db
Debug open repl <leader>do
Git management
open lazygit in current directory <leader>g
Enter vim-fugitive <leader>G
Enter git diff view <leader>D
Close git diff view <leader><leader>D
Stage hunk <leader>hs(n and v mode)
Reset hunk <leader>hr(n and v mode)
Undo stage hunk <leader>hu
Reset buffer <leader>hR
Preview hunk <leader>hp
Blame hunk <leader>hb

You can see more keybindings in lua/core/mapping.lua and lua/keymap/init.lua.

Note:

  1. Put your cursor begin of the begin quote or bracket then press <A-l> you will jump to the end of the end quote or bracket.
  2. Put your cursor end of the end quote or bracket then press <A-h> you will jump to the begin of the begin quote or bracket.
Clone this wiki locally