# clone this config
git clone https://github.com/yandy/neovim-config.git ~/.config/nvim
# install neccessary tools/packages
sudo pacman -S neovim wl-clipboard luarocks lldb lazygit
# invoke nvim and wait for install completion
nvim
# for markview
## make sure installed tar, curl, gcc, cargo
cargo install tree-sitter-cli
uv tool install mmdc
sudo pacman -S tectonicmode switch
iInsert text before the cursoraAppend text after the cursoroBegin a new line below the cursor and insert textventer visual modeVenter line selection visual mode<c-q>enter block visual mode
visual block
I{string}<ESC>insert {string} at the start of block on every line of the block, provided that the line extends into the block.A{string}<ESC>append {string} at the start of block on every line of the block, provided that the line extends into the block.
range :h [range]
It consideredts of one or more line specifiers, separated with ',' or ';'.
When separated with ';' the cursor position will be set to that line before interpreting the next line specifier. This doesn't happen for ','.
Examples:
4,/this line/ from line 4 till match with "this line" after the cursor line. >
5;/that line/ from line 5 till match with "that line" after line 5.
line number specified with:
{number}an absolute line number.the current line$the last line of the buffer%equal to 1,$ (the entire buffer)/{pattern}[/]the next line where {pattern} matches?{pattern}[?]the previous line where {pattern} matches
motion :h navigation
h/j/k/lleft/down/up/right:[range]Set the cursor on the last line number in [range].{count}%Go to {count} percentage in the fileggbegin of current bufferGend of current buffer0begin of line$end of line^first non-blank of line<c-f>/<c-b>page down/up<c-d>/<c-u>half page down/upe/b[count] forward/backward word}/{[count] paragraphs forward/backward]]/[[[count] sections forward/backwardm{a-zA-Z}Set mark {a-zA-Z} at cursor position ('a-'zvalid within one file;'A-'Zvalid between files)g'{mark}Jump to the {mark}, but don't change the jumplist when jumping within the current buffer.<c-o>Go to [count] Older cursor position in jump list<c-i>Go to [count] newer cursor position in jump list<c-]>follow the links in help textgxOpens the current filepath, URL (decided by<cfile>, 'isfname'), orLSP"documentLink" at cursor using the system default handler.{Visual}gxOpens the selected text using the system default handler.
deleting :h deleting
xDelete a character under the cursor{Visual}["x]dDelete the highlighted text [into register x] (for {Visual})["x]d{motion}Delete text that {motion} moves over [into register x]["x]ddDelete [count] lines [into register x]
replacing :h replacing
{Visual}["x]cDelete the highlighted text [into register x] and start insert (for {Visual})["x]c{motion}Delete text that {motion} moves over [into register x]["x]ccDelete [count] lines [into register x]
changing :h changing
r{char}Replace the character under the cursor with {char}{Visual}r{char}Replace every highlighted characters with {char}~Switch case of the character under the cursor and move the cursor to the right.{Visual}~Switch case of highlighted text{Visual}UMake highlighted text uppercase{Visual}uMake highlighted text lowercasegccComment or uncomment [count] lines starting at cursor.{Visual}gcComment or uncomment the selected line(s).
shift-left-right :h shift-left-right
{Visual}[count]<Shift the highlighted lines [count] 'shiftwidth' leftwards<<Shift [count] lines one 'shiftwidth' leftwards.{Visual}[count]>Shift the highlighted lines [count] 'shiftwidth' rightwards>>Shift [count] lines one 'shiftwidth' rightwards.
substitute :h :substitute
:[range]s[ubstitute]/{pattern}/{string}/[flags] [count]:
For each line in [range] replace a match of {pattern} with {string}.
[flags] :
[c] Confirm each substitution. Vim highlights the matching string
'y' to substitute this match
'n' to skip this match
'a' to substitute this and all remaining matches
to quit substituting
'l' to substitute this match and then quit ("last")
'q' to quit substituting
[g] Replace all occurrences in the line. Without this argument,
replacement occurs only for the first occurrence in each line. If the
'gdefault' option is on, this flag is on by default and the [g]
argument switches it off.
change-tabs :h change-tabs
:ret[ab][!]Replace all sequences of white-space containing a with 'tabstop'
copy-move :h copy-move
"{register}Use {register} for next delete, yank or put:reg[isters]show all registers{Visual}["x]yYank the highlighted text [into registerx]["x]yyYank [count] lines [into register x]["x]p/["x]PPut the text [from register x] after/before the cursor [count] times.
undo-redo-repeat :h undo-redo :h repeating
uUndo [count] changes.<c-r>Redo [count] changes which were undone..repeat last change:[range]g[lobal]/{pattern}/[cmd]Execute the Ex command [cmd] (default ":p") on the lines within [range] where {pattern} matches.
folding
zRopen all foldszropen 1-level foldszMclose all foldszmclose 1-level foldszatoggle fold
window :h window
:spSplit current window in two.:vsSplit current window in two. spread out horizontally:wqsave and quit:q!quit without save:qquit if no changes in buffer<c-w>h/<c-w>j/<c-w>k/<c-w>lswitch to left/down/up/right window<c-w>wcycle window<c-w> +/<c-w> -Increase/Decrease current window height by N (default 1).<c-w> >/<c-w> <Increase/Decrease current window width by N (default 1).
lsp
<leader>thtoggle inlay hints<a-s-f>format current buffergracode actiongrigoto implementationgrnrename symbolgrrgoto referencesgrtgoto type definitiongrxcodelens rungOlist current buffer symbolsgdgoto definition
other
:optionsOpen a window for viewing and setting all options. see:h options
buffer
<leader>bnnext bufferline<leader>bpprevious bufferline<leader>bcclose all other buffer<leader>bdclose current buffer
snacks :h snacks
<a-h>toggle hidden files<a-i>toggle ignored files
snacks.picker:h snacks-picker
-
<leader><space>smart find -
<leader>/grep files -
<leader>fffind in files -
<leader>fbfind in buffers -
<leader>frfind in recent files -
<leader>fgfind in git log -
<leader>fhfind in help -
<leader>fkfind in keymap -
<leader>fcfind in vim config -
<leader>lddiagnostics -
<leader>lDbuffer diagnostics
snacks.explorer :h snacks-explorer
<leader>eopen explorer- file(s) operation
rrename current fileddelete current/selected filesaadd new file or directory (directories end with/)<cr>/lopen file or toggle directoryoopen file with system application
- move/copy files
- Select files with (works on multiple files)
- Navigate to the target directory
- Execute the operation:
mmove selected files to the target directoryccopy selected files to the target directory
- tree operation
urefresh the file treehclose directoryZclose all directoriesPtoggle preview
snacks.terminal
<c-`>open terminal<c-s-`>new terminal
snacks.lazygit
<leader>Gopen lazygit
blink.cmp :help blink-cmp.txt
<c-n>select next<c-p>select previous<tab>/<c-y>select and accept<c-e>cancle/hidden<c-f>scroll documentation down<c-b>scroll documentation up
markview :help markview.nvim
<leader>mttoggles markdown render.<leader>mppreview markdown by side
img-clip :help img-clip.nvim-img-clip.nvim-configuration
<leader>PPaste image from system clipboard- DRAG AND DROP drag images from the web browser or file explorer into the terminal to automatically embed them, in
normalmode.
agentic.nvim docs
<c-.>toggle agentic widget<localleader>rrotate agentic chat layoutqclose agentic widget<s-tab>change mode (eg. plan, build)<localLeader>sswitch acp provider<localLeader>mswitch model<localLeader>tswitch think level<c-s>submit prompt<c-'>add file or selection to agentic context<c-/>add all buffer diagnostics to agentic{Insert}<c-v>/<localLeader>ppaste image<esc><esc>interrupt generation<localleader>nnew agentic session<localleader>llist agentic session for restore<a-c-f>scroll agentic page down<a-c-b>scroll agentic page up]]next heading[[previous heading
debug :help dap.txt, :help dap-launch.json
Supported languages: Python, C/C++, JavaScript, TypeScript
<leader>db/<F9>toggle breakpoint<leader>dD/<S-F9>clear breakpoints<leader>ds/<F5>start/continue debugging<leader>do/<F10>step over<leader>di/<F11>step into<leader>dO/<S-F11>step out<leader>dQ/<S-F5>terminate session<leader>dB>set conditional breakpoint (with input prompt)<leader>du>toggle dapui