- Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
_
(underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)0
(zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
$
(dollar) to move the cursor at the end of line (doesn't switch to insert mode)d$
will delete from wherever your cursor is till the end of the linef<character>
to move cursor to the first occurrence of<character>
f(
to move cursor to first occurence of(
t<character>
to move cursor to upto but not on the first occurrence of<character>
t(
to move cursor to first occurence of(
- To repeat it, use
,
(comma, goes backward) or;
(semicolon, goes forward)fe
and then keep pressing;
to walk through eache
- To indent lines, select them using the visual line mode
Shift + v
and then use>
to indent them right and<
to indent them left
NvChad keybinds
- based on this video
space + c + h
to open keybinds cheatsheet (same command to close the window)space
is considered as the leader key (commands often start with this key)- Press the leader key
space
and wait for a second, a window should appear suggesting potential commands.
space + t + h
- neovim comes with nvim-treesitter
- To install a language
:TSInstall <language_to_install>
- A list of suupported languages
- To check which languages are installed
:TSInstallInfo
- To install a language
ctrl + n
- Arrow keys to move cursor to a file and
return (enter)
to open a file m
to mark a filea
to create a new file and type the new file namec
to copy a filep
to paste the filer
to rename a filectrl + w + h/l
orlarrow/rarrow
to switch between file tree and editor
space + n
to toggle line numbers on/offspace + r + n
to toggle relative line numbers on/off- Once inside relative line number mode, can also press
space + n
to show current line as0
(adjust as per your liking)
- Once inside relative line number mode, can also press
space + f + f
to open file search menu (across the entire project)space + f + b
to open file search menu (across the currently opened files)
:vsp
for vertical split:sp
for horizontal splitctrl + h/j/k/l
to toggle windows
tab
to cycle left to rightshift + tab
to cycle right to leftspace + x
to close current tab (buffer)
space + v
to open terminal (vertically)alt + v
to toggle the terminal on/off
space + h
to open terminal (horizontally)alt + h
to toggle the terminal on/off