You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you can install some/all of these optional tools, if you haven't developed using a language
you can google if your developed language isn't appear in the above table
Installation
Apple macOS/Linux
mv ~/.config/nvim ~/.config/nvim.bak #backup existing config
git clone https://github.com/CaesarLi-WantToBeAFreeMan/neovim-config ~/.config/nvim #clone this repo
nvim #open Neovim, and lazy.nvim installs all plugins automatically
Microsoft Windows
rename %LOCALAPPDATA%\nvim to %LOCALAPPDATA%\nvim.bak #backup existing config
git clone https://github.com/CaesarLi-WantToBeAFreeMan/neovim-config %LOCALAPPDATA%\nvim #clone this repo
nvim #open Neovim, and lazy.nvim installs all plugins automatically
Inside Neovim
:MasonUpdate"install LSP servers, formatters, DAP adapters via Mason
:Mason"you can install your favorite LSP/formatter/DAP/Linter
:q"you know, the most asked question: how to quit vim, lol
Note
if you wanna use cmd instead of PowerShell on Microsoft Windows
please google alternative commands or ask an AI agent to convert PowerShell commands to cmd
Key Mappings
Note
my leader key is \\ (backslash), you can change it in init.lua
mode: n: normal, i: insert, v: visual, c: command, t: terminal
Text Editing
key
mode
description
<Tab>
n
insert a tab
<Space>
n
insert a space
<Del>
n
delete previous character
<BS>
n
delete current character
<C-n>
n
insert a new line below
<C-p>
n
insert a new line above
<leader><leader>
i/c
insert a backslash \
<leader>d
n
delete without polluting yank register
<leader>D
n
delete to end of line without yank
<leader>j
n/v
move line/selection down
<leader>k
n/v
move line/selection up
Clipboard & Yank
key
mode
description
y
n/v
yank (tracked in history)
p
n/v
put after cursor
P
n/v
put before cursor
gp
n/v
gput after cursor
gP
n/v
gput before cursor
<A-p>
n
cycle yank history forward (after paste)
<A-n>
n
cycle yank history backward (after paste)
Scroll & Navigation
key
mode
description
<C-d>
n
scroll down half page, cursor to top
<C-u>
n
scroll up half page, cursor to top
<C-f>
n
scroll down full page, cursor to top
<C-b>
n
scroll up full page, cursor to top
<C-e>
n
scroll down one line, cursor to top
<C-y>
n
scroll up one line, cursor to top
<C-o>
n
jump backward, cursor to top
<C-i>
n
jump forward, cursor to top
Search
key
mode
description
<Esc>
n
clear search highlight
*
n
highlight word under cursor without jumping
/
v
search within visual selection only
Windows & Splits
key
mode
description
<C-h>
n
go to left window
<C-j>
n
go to lower window
<C-k>
n
go to upper window
<C-l>
n
go to right window
<A-h>
n
increase window width (+2 cols)
<A-j>
n
decrease window height (-2 rows)
<A-k>
n
increase window height (+2 rows)
<A-l>
n
decrease window width (-2 cols)
<leader>w=
n
equalize all split sizes
<leader>wx
n
swap current split with next
Tabs
key
mode
description
]t
n
next tab
[t
n
previous tab
<leader>tn
n
new tab
<leader>tx
n
close current tab
<leader>tX
n
close all other tabs
Buffers
key
mode
description
]b
n
next buffer
[b
n
previous buffer
<leader>bn
n
new empty buffer
<leader>bx
n
close current buffer
<leader>bX
n
close all other buffers
<leader>bd
n
safe delete buffer (Snacks)
<leader>br
n
rename / move current file
Toggles
key
mode
description
<leader>tw
n/i
toggle line wrap
<leader>tl
n/i
toggle line numbers
<leader>tL
n/i
toggle relative line numbers
<leader>ts
n/i
toggle spell checker
<leader>td
n/i
toggle inline diagnostics
<leader>th
n
toggle LSP inlay hints (when LSP attached)
<leader>tf
n
toggle format on save
<leader>tz
n
toggle zen mode
<leader>tZ
n
toggle zoom mode
<leader>tt
n
toggle terminal
Find/Picker
key
mode
description
<leader>ff
n
find files
<leader>ft
n
find text in session (live grep)
<leader>fT
n
find text in open buffers
<leader>fl
n
find lines in current buffer
<leader>fb
n
find open buffers
<leader>fr
n
find registers
<leader>fm
n
find marks
<leader>fj
n
find jumps
<leader>fk
n
find keymaps
<leader>fh
n
find help tags
<leader>fH
n
find highlight groups
<leader>fi
n
find icons
<leader>fc
n
find commands
<leader>fa
n
find autocommands
<leader>fp
n
find plugins (Lazy)
<leader>fq
n
find quickfix items
<leader>fL
n
find location list items
<leader>fR
n
resume last find
<leader>fC
n
find colorschemes
<leader>fd
n
find buffer diagnostics
<leader>fD
n
find workspace diagnostics
<leader>fs
n
find sessions/projects
<leader>fn
n
find Neovim config files
History
key
mode
description
<leader>hc
n
command history
<leader>hn
n
notification history
<leader>hs
n
search history
<leader>hu
n
undo history
Git
key
mode
description
<leader>gb
n
git branches
<leader>gl
n
git log
<leader>gs
n
git status
<leader>gB
n/v
git browse (open in browser)
<leader>gL
n
open lazygit
]r
n/t
jump to next word reference
[r
n/t
jump to previous word reference
LSP
key
mode
description
gd
n
go to definition
gD
n
go to declaration
gi
n
go to implementation
gr
n
find all references
gt
n
go to type definition
gc
n
go to incoming calls
gC
n
go to outgoing calls
gs
n
find document symbols
gS
n
find workspace symbols
K
n
hover documentation
gK
n
signature help
<C-s>
i
signature help
<leader>lr
n
rename symbol
<leader>la
n/v
code action (pretty UI)
<leader>ll
n
LSP server info
<leader>lf
n
format current file
Diagnostics
key
mode
description
]d
n
next diagnostic
[d
n
previous diagnostic
]e
n
next error
[e
n
previous error
]w
n
next warning
[w
n
previous warning
]h
n
next hint
[h
n
previous hint
]i
n
next info
[i
n
previous info
<leader>dn
n
dismiss all notifications
Trouble (Diagnostics Panel)
key
mode
description
<F2>
n
toggle LSP symbols panel
<S-F2>
n
toggle LSP definitions/references panel
<C-F2>
n
toggle buffer diagnostics panel
Inside Trouble panel:
key
description
<CR>
jump to item and close panel
h
open in horizontal split
v
open in vertical split
o / O
open/open fold recursively
c / C
close/close fold recursively
x / X
toggle/toggle fold recursively
Debugger (DAP)
key
mode
description
<F9>
n
start/continue debugging
<S-F9>
n
stop debugger
<C-F9>
n
run to cursor
<F10>
n
step over
<F11>
n
step into
<S-F11>
n
step out
<leader>db
n
toggle breakpoint
<leader>dB
n
set conditional breakpoint
<leader>dl
n
set log point
<leader>dL
n
re-run last debug session
<leader>dx
n
clear all breakpoints
<leader>du
n
toggle debug UI panels
<leader>de
n/v
evaluate expression
<leader>df
n
float a debug panel
<leader>dr
n
open debug REPL
<leader>dp
n
pause execution
Code Runner
key
mode
description
<F5>
n
smart run (single file/project)
<S-F5>
n
run current file only (ignore project context)
Project Priority
CMake/QT
MFC
Maven/Spring Boot
Gradle/Spring Boot
plain Java
Django/Python
Vite
Node/npm
static HTML
Cargo
Go module
single file
File Explorer (Neo-tree)
key
mode
description
<F1>
n
toggle file system explorer
<S-F1>
n
toggle git status explorer
<C-F1>
n
toggle buffer list explorer
Inside Neo-tree:
key
description
<Space> / x / za
toggle node
<CR> / o / zo
open file / expand folder
O / zO
open node recursively
X / zA
toggle node recursively
c / zc
close node
C / zC
close node recursively
h
open in horizontal split
v
open in vertical split
t
open in new tab
w
open with window picker
p
toggle file preview
r
rename filename
R
rename extension
a
add file/folder
A
add folder
m
move node
d / <BS> / <Del>
delete node
<C-x>
cut to clipboard
<C-y>
copy to clipboard
<C-p>
paste from clipboard
<C-c>
clear clipboard
<C-r>
refresh tree
/
fuzzy find nodes
#
fuzzy sort
u
navigate up one directory
s
set as root directory
[g / ]g
jump to prev/next git change
=
toggle full width / normal width
<leader>h
toggle hidden files
?
show help
q / <Esc>
close Neo-tree
Surround (mini.surround)
key
description
sa{motion}{char}
add surrounding
sd{char}
delete surrounding
sc{char}{char}
change surrounding
sf{char}
find surrounding (right)
sF{char}
find surrounding (left)
sh{char}
highlight surrounding
[!HELP]
saiw{: hello world -> { hello world }sa3e]: hi hello world -> [hi hello world]sd": "hello world" -> hello world
Text Objects (mini.ai)
[!INFO]
these work with v, d, c, y + a/i:
object
around
inside
function
af
if
class
ac
ic
block/condition/loop
ab
ib
tag (HTML/JSX)
at
it
parameter
ap
ip
comment
a/
i/
digit sequence
ad
id
Increment/Decrement (dial.nvim)
key
mode
description
<C-a>
n
increment value under cursor
<C-x>
n
decrement value under cursor
g<C-a>
n
sequential increment
g<C-x>
n
sequential decrement
<C-a>
v
increment selection
<C-x>
v
decrement selection
Treesitter
key
mode
description
<CR>
n
start/expand treesitter selection
<S-CR>
n
shrink treesitter selection
<BS>
n
expand selection to scope
]f
n
jump to next function start
[f
n
jump to previous function start
]c
n
jump to next class start
[c
n
jump to previous class start
[x
n
jump to context (current scope header)
]x
n
jump back from context
Markdown
key
mode
description
<leader>v
n
toggle inline markdown render
<leader>V
n
toggle browser markdown preview
Date Structure and Algorithms (DSA) / Competitive Programming
LeetCode
key
description
<F3>
open LeetCode home
<S-F3>
test current problem
<C-F3>
submit current problem
<A-F3>
close LeetCode
<leader>lp
problem list
<leader>lc
console
<leader>li
problem info
<leader>lt
open tabs
<leader>lL
change language
CompetiTest (Codeforces, USACO, AtCoder and so on)
key
description
<leader>ca
add test case
<leader>ce
edit test case
<leader>cd
delete test case
<leader>cr
compile, run and test
<leader>cR
run without recompiling
<leader>cs
show test UI
<leader>cp
receive problem
<leader>cc
receive contest
Note
you need to install competitive companion extension in your browser
to receive problems / contests