Neovim tips and tricks

Neovim

✍️ Configuration file#

Use the configuration file provided in the neovim config repository, as some customisation is required.

Edit the configuration file by using one of the following:

nvim ~/.config/nvim/init.vim

:e $MYVIMRC

<Leader>ce

👆The <Leader> key by default is \

Reload the configuration by sourcing the file:

:source $MYVIMRC

🗝 Hotkeys#

h | j | k | l - Move around

w | W - Jump by start of or by whole words

e | E - Jump to end of words (or excluding with punctuation)

b | B - Jump backword by words (or excluding with punctuation)

$ - Go to the end of the line

A - Go to the end of the line and enter insert mode

Ctrl+w and v - Split vertically

Ctrl+w and s - Split horizontally

Ctrl+hjkl - Originally as Ctrl+w and direction hjkl

Cltr+t - Toggler NERDTree

Ctrl+n or Ctrl+p - Navigate suggestions popups (e.g. nvim-cmp)

Ctrl+d | f - Navigate autocomplete extended detail popup (e.g. nvim-cmp)

🪛 Commands#

Replace all

:%s/needle/replacement/g

For specific lines (line range replacement)

:10,20s/needle/replacement/g

From current line, here’s an example for the two next lines

:.,+2s/needle/replacement/g

Can use /gc to have a confirmation before replacement

🧐 Find help#

:help <command>

References#

https://vimcolorschemes.com/

https://github.com/nvim-telescope/telescope.nvim

https://github.com/heldrida/neovim-config

https://github.com/sharksforarms/neovim-rust

comments powered by Disqus