Minimum plugins used.
Check where configuration lives in your system. On Mac it's in ~/.config/nvim.
Everything that is inside nvim folder in this repository should be in ~/.config/nvim.
Leader key: Space. Leader is the button that you press before using keybindings combo.
From netrw:
-
Create file:
f f. -
Create directory:
f d. -
Edit file/directory name under the cursor:
f e. -
Delete file or empty directory under the cursor:
f r.
From netrw:
-
Mark directory as target:
Shift Tab. This is needed for moving/copying files to that target. -
Mark/unmark file/directory:
Tab. -
Unmark all marked files/directories:
Leader Tab. -
Copy marked files/directories to target directory:
f c. -
Copy marked files/directories to directory under the cursor:
f C. -
Move marked files/directories to target directory:
f x. -
Moved marked files/directories to directory under the cursor:
f X. -
Run shell command on marked files/directories:
f ;. For example, mark non-empty directory, use f ; and type rm -r to delete the directory.
From netrw:
-
Bookmark current directory:
f b. -
Remove most recent bookmark:
f b r. -
Go to previous bookmarked directory:
f b g. -
Show list of marked files:
f l m. -
Change directory to current under cursor:
c d. -
Move one directory above:
-. -
Open file tree (from file):
Leader e. -
Open file in a new tab: Place cursor on file/directory press
t. -
Navigate to opened tab by number:
Ngtwhere N is a tab number.
-
Search in files:
Leader s f. -
Search in git files:
Leader s f g. -
Search in files for current word under the cursor:
Leader s w. -
Search by grep:
Leader s g. -
Find recently opened files:
Leader ?.
-
Show list of errors in current file:
Leader s i. -
Search for pattern in file:
?. -
Search for word under the cursor:
*. -
Go to specific line in file:
:<line number>. -
Format file according to formatting rules:
Leader f m. -
Line comment selected lines:
g c c. -
Block comment selected lines:
g b c. -
Go to the very top of the file:
g g. -
Go to the very bottom of the file:
G. -
Toggle auto complete in insert mode:
Shift Tab. -
Scroll down:
Ctrl d. -
Scroll up:
Ctrl u. -
Copy to clipboard:
" + y. -
Add multiline prefix:
Leader a a, add text to the beggining of the first line, Esc. -
Remove multiline prefix:
Leader a r, select prefix, x. -
Split vertically:
von file in netrw. -
Split vertically:
Leader vfrom file. -
Increase window width:
Leader >. -
Decrease window width:
Leader <. -
Equalize split size:
Leader =. -
Put cursor in normal mode on number and do
Ato increase number orXto decrease.
-
Hover over variable/function for showing details:
K. -
Go to definition:
g d. -
Code action:
Leader c a.
-
Open diff view:
Leader d v. -
Close diff view:
Leader d v c. -
Open diff view for current file:
Leader d v f.
For more information about resolving merge conflicts with diff view press g ? in diff view.
- Open package manager:
:Mason.
For more information about plugins see Mason documentation.
e - jump forwards to the end of a word.
b - jump backward to the end of a word.
% - move cursor to matching character (default supported pairs: '()', '{}', '[]' - use :h matchpairs in vim for more info).
0 - jump to the start of the line.
^ - jump to the first non-blank character of the line.
$ - jump to the end of the line.
g_ - jump to the last non-blank character of the line.
gg - go to the first line of the document.
G - go to the last line of the document.
} - jump to next paragraph (or function/block, when editing code).
{ - jump to previous paragraph (or function/block, when editing code).
i - insert before the cursor.
I - insert at the beginning of the line.
a - insert (append) after the cursor.
A - insert (append) at the end of the line.
o - append (open) a new line below the current line.
O - append (open) a new line above the current line.
ea - insert (append) at the end of the word.
Ctrl + w - delete word before the cursor during insert mode.
Ctrl + t - indent (move right) line one shiftwidth during insert mode.
Ctrl + d - de-indent (move left) line one shiftwidth during insert mode.
Ctrl + n - insert (auto-complete) next match before the cursor during insert mode.
Ctrl + p - insert (auto-complete) previous match before the cursor during insert mode.
r - replace a single character.
R - replace more than one character, until ESC is pressed.
J - join line below to the current one with one space in between.
cc - change (replace) entire line.
c$ or C - change (replace) to the end of the line.
cw or ce - change (replace) to the end of the word.
s - delete character and substitute text (same as cl).
S - delete line and substitute text (same as cc).
u - undo.
Ctrl + r - redo.
. - repeat last command.
Ctrl v, $, A, add something at the end, Esc - append to the end of multiple lines.
v - start visual mode, mark lines, then do a command (like y-yank).
V - start linewise visual mode.
Ctrl + v - start visual block mode.
a( - a block with ().
a{ - a block with {}.
at - a block with <> tags.
i( - inner block with ().
i{ - inner block with {}.
it - inner block with <> tags.
> - shift text right.
< - shift text left.
y - yank (copy) marked text.
d - delete marked text.
~ - switch case.
u - change marked text to lowercase.
U - change marked text to uppercase.
ma - set current position for mark A.
`a - jump to position of mark A.
`. - go to the position of the last change in this file.
g, - go to newer position in change list.
g; - go to older position in change list.
qa - record macro a.
q - stop recording macro.
@a - run macro a.
@@ - rerun last run macro.
yy - yank (copy) a line.
Nyy - yank (copy) N lines down.
Ny<up|down> - yank (copy) N lines up or down.
yw - yank (copy) the characters of the word from the cursor position to the start of the next word.
yiw - yank (copy) word under the cursor.
y$ or Y - yank (copy) to end of line.
p - put (paste) the clipboard after cursor.
P - put (paste) before cursor.
dd - delete (cut) a line.
Ndd - delete (cut) N lines down.
Nd<up|down> - delete (cut) N lines up or down.
dw - delete (cut) the characters of the word from the cursor position to the start of the next word.
:g/{pattern}/d - delete all lines containing pattern.
:g!/{pattern}/d - delete all lines not containing pattern.
d$ or D - delete (cut) to the end of the line.
x - delete (cut) character.
>> - indent (move right) line one shiftwidth.
<< - de-indent (move left) line one shiftwidth.
>% - indent a block with () or {} (cursor on brace).
<% - de-indent a block with () or {} (cursor on brace).
:w - write (save) the file, but don't exit.
:wq - write (save) and quit.
:q - quit (fails if there are unsaved changes).
:qa - quit all (fails if there are unsaved changes)
:q! - quit and throw away unsaved changes.
:wqa - write (save) and quit on all tabs.
/pattern - search for pattern.
?pattern - search backward for pattern.
n - go forward in matched search result.
N - go backward in matched search result.
:%s/old/new/g - replace all old with new throughout file.
:%s/old/new/gc - replace all old with new throughout file with confirmations.
:%s/old/new/gi - replace global case insensitive.
:%s/old/new/gI - replace global case sensitive.
:%s/old/new/gIc - replace global case sensitive with confirmation.