https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/
custom mapping to toggle showcursorline and showcursorcolumn
ctrl + u
show git diff between current file state and saved state
:w !diff % -
repeat your last edit
.
search for all words under cursor
*
skip to the next occurrence
n
refresh current file
:e
/:edit
count number of occurrences in file
:%s/pattern//ng
folding
zf
create fold in visual modezo
open fold
open previous file
:b#
move to a specific character on line
f <char>
forwards to charF <char>
backwards to char
dealing with tabs/space
I think you just need to make sure you have your expandtab option set:
:set expandtab
You could also make a json.vim file in your ftplugin directory that looks something like this:
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
You might also need to select the offending whitespace and do:
:retab
repaint vim
ctrl - l
nerdtree commenting
- 1\cc - - - to comment 1 line
- 10\cc - - - to comment 10 lines
- 10\cu - - - to uncomment 10 lines
#
search
- :noh - - - to remove highlighted words
:Explore
- - - to rename a file
Change tab size
- :set tabstop=4
- :set shiftwidth=4 (this is the one i usually use)
- :set expandtab
Create folder/file with NERDTree
- when in nerdtree window press
m
thena
to add (there are other commands listed) - folders end with a
/
Delete till next character
d
t
char
Delete character before
X
Replace All: Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:%s/foo/bar/g
For specific lines:
:6,10s/foo/bar/g