Commands Neovim
Basic Nav
hjkl navigate in file
:q quit buffer :qa quit all
Buffers Management
ctrl w + v split buffer verticaly :vs split verticaly :sp split horzontaly
:bn or :bp next or previous tab
:neotree file explore
ctrl + w ctrl + w switch buffer
ctrl + h or ctrl + l navigate to left or right tab
File management
:w save current buffer :e explore files :q! quit buffer without saving
NeoTree
space + e open neotree a create a new file
Navigation
switch tabs spc + bb + letter
Buffer/Windows management
CTRL+J: Move to down window CTRL+K: Move to upper window CTRL+H: Move to left window CTRL+L: Move to right window
CTRL+W + v Open buffer horizontaly CTRl+W + s Open buffer verticaly
bp previous buffer bn next buffer
Code
gd Go to definition
Text
Search
space ff to use fuzzy search an navigate using ctrm j and k
Search occurences
:/searchTerm press enter and n or N to go to next or previous occurence
Search and replace
:%s/<api[-.]/test/g search and replace all occurences of api- or api. by word test
Patterns
Navigation
: number will navigate to the desired line number
Insert in normal mode i insert after cursor I insert at beginning of line a insert before cursor A insert at the end of line
Single Line COPY paste In normal mode
yy copy current line p paste line after curent position
Single Line CUT paste In normal mode
dd cut current line p paste line after curent position
Multiple Line copy paste
In visual mode select the lines x to cut lines p to paste where you want
Undo Redo modification
u In normal mode ctrl + r Redo modification
Words Navigation
w goes to beginning of next word e goes to end of next word b goes back to last word x removes char (even if not in insert mode)
Commenter gc comment selected text gcc comment current line
Terminal
spc th Open terminal horizontaly spc tv Open terminal verticaly
Git management
Space gg to open lazygit c commit P push p pull
Fold management (toggle markdown headings)
za : Toggle the fold under the cursor (open if closed, close if opened). zo : Open the fold under the cursor. zc : Close the fold under the cursor. zR : Open all folds in the file. zM : Close all folds in the file.
Debug Nvim
:checkhealth
Astrivim packages
- Neotree File explorer
- Git Gisigns
- ctrl + D to close Terminal
- ToogleTerm Terminal
- Telscope fuzzy search
Nvim conf
Nvim path
home/nvim
In AstroNvim packages can be added in community.lua file
Plugins
Avante
*M means alt key** M+l Accept auto complete
Emojis
Treesitter
:InspectTree Displays document metadate tree
Orgmode
Leader ois schedule calendar
- (x) TODO Ctrl + Space can change the state to done
:h neorg Displays help sheet
Ressources
https://vim-adventures.com/ https://dotfyle.com/ https://ofirgall.github.io/learn-nvim/ https://www.shortcutfoo.com/app/dojos/neovim/cheatsheet https://github.com/AstroNvim/AstroNvim