Dumping ground for my notes as I learn, and configure my own NeoVim.
Herein: mostly shortcuts/how-to notes.
NeoVim
Herein are keymaps specific to my neovim configuration. Many are standard, many are not
Click Here to Browse My Config on Github
Helpful References:
Navigation
Which-Key plugin shows available shortcuts after leader key press. Common entry points below:
My Binding | My Verbiage | Default | Mode | Description |
---|
\ | | | N | Leader key, access all shortcuts |
\? | | | N | See buffer-local keymaps |
\f | File/Find | | N | File and find operations |
\s | Search | | N | Search operations |
\g | Git | | N | Git operations |
General Operations
My Binding | My Verbiage | Default | Mode | Description |
---|
| Save | :w | C | |
| Quit | :q | C | |
| Reset | :e! | C | Resets current buffer (Abandon active file changes) |
| Copy | y | V | ”Yank” (copy selected region) |
| Cut | d | V | ”Delete” (cut selected region) |
| Paste | p | V | ”Paste” (paste yanked/deleted at cursor) |
| | K | N | Show definition hover |
| | u | N | Undo |
| | Ctrl + r | N | Redo |
| Find & Replace on Line | :s/old/new/g | N | Find instances of old on current line, replace with new |
| Find & Replace in Buffer | :%s/old/new/g | N | Find instances of old in buffer, replace with new |
| | yyp | N | Duplicate line under cursor |
File / Folder Nav
My Binding | My Verbiage | Default | Description |
---|
\ff | Find-Files | | Find Files (Fuzzy) |
\fg | Find-Git Files | | Find Git Files |
\fp | Find-Projects | | Find Projects |
\e | Explorer | | File Directory Browser |
\sg | Search w/ Grep | | Find inside files with Grep search |
Cursor / Pane Navigation
My Binding | My Verbiage | Default | Mode | Description |
---|
z z | | | N | Center viewport on current line |
Ctrl + u | | | N | Scroll active pane up |
Ctrl + d | | | N | Scroll active pane down |
Ctrl-W + HJKL | | | N | Switch focus between window splits |
| | | N | Go to top of file |
Buffer Navigation
My Binding | My Verbiage | Default | Mode | Description | |
---|
| | :buffer N or :b N | C | Switch to buffer number N (e.g., :b 2 ) | |
| | :bnext or :bn | C | Move to the next buffer | |
| | :bprevious or :bp | C | Move to the previous buffer | |
| | :bfirst or :bf | C | Move to the first buffer | |
| | :blast or :bl | C | Move to the last buffer | |
| | :bd | N | Close current buffer | |
| | Ctrl+^ | N | Toggle between current and previous buffer | |
| | Ctrl+o | N | Jump to the previous position in the jump list | |
| | Ctrl+i | N | Jump to the next position in the jump list | |
Flash Navigation
My Binding | My Verbiage | Default | Mode | Description |
---|
s | Flash | | n, x, o | Jump to target |
S | Flash Treesitter | | n, x, o | Navigate using treesitter |
r | Remote Flash | | o | Remote flash navigation |
R | Treesitter Search | | o, x | Search using treesitter |
<c-s> | Toggle Flash Search | | c | Toggle flash search functionality |
Basic Vim Mode Commands
My Binding | My Verbiage | Default | Mode | Description |
---|
i | | | N | Insert mode at current position |
I | | | N | Insert at beginning of current line |
a | | | N | Insert after character at current position |
A | | | N | Insert at end of current line |
Line / Word Navigation
My Binding | My Verbiage | Default | Mode | Description |
---|
$ | | | N | Move cursor to end of line |
^ | | | N | Move cursor to start of line |
w | | | N | Move cursor to next word start |
e | | | N | Move cursor to next word end |
W | | | N | Move cursor to next word start after whitespace |
E | | | N | Move cursor to next word end after whitespace |
Tmux-Vim-Navigator
Switch seamlessly between neovim/tmux panes with: Ctrl + HJKL
Tmux
Basic hierarchy: Session > Window > Pane
References:
Sessions
Terminal Commands
Alias | Full Command | Action |
---|
| tmux | New Session |
| tmux new -s mysession | New Session With Name |
| tmux ls | List Sessions |
| tmux a | Attach to Session |
| tmux a -t mysession | Attach to Session by Name |
| tmux kill-session -t mysession | Kill Session by Name |
| tmux kill-session -a | Kill All Sessions except current |
Shortcuts (from inside tmux)
My Binding | Default Binding | Action |
---|
| Ctrl+B $ | Rename Session |
| Ctrl+B d | Detach from Session |
| Ctrl+B s | Session Preview mode |
| Ctrl+B () | Jump Between Sessions |
Windows
My Binding | Default Binding | Action |
---|
| Ctrl+B c | Create New |
| Ctrl+B , | Rename |
| Ctrl+B & | Close Current |
| Ctrl+B w | List |
| Ctrl+B n | Next |
| Ctrl+B p | Previous |
| Ctrl+B 0..9 | Select by Number |
Panes
My Binding | Default Binding | Action |
---|
| Ctrl+B % | Split Vertical |
| Ctrl+B " | Split Horizontal |
| Ctrl+B ↑↓←→ | Change Active |
| Ctrl+B x | Close Active |
| Ctrl+B Ctrl+↑↓←→ | Resize |
Avante Nvim
Key Binding | Description |
---|
Leaderaa | show sidebar |
Leaderat | toggle sidebar visibility |
Leaderar | refresh sidebar |
Leaderaf | switch sidebar focus |
Leadera? | select model |
Leaderae | edit selected blocks |
LeaderaS | stop current AI request |
Leaderah | select between chat histories |
co | choose ours |
ct | choose theirs |
ca | choose all theirs |
c0 | choose none |
cb | choose both |
cc | choose cursor |
]x | move to previous conflict |
[x | move to next conflict |
[[|jump to previous codeblocks (results window)| | |
|]] | jump to next codeblocks (results windows) |
http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/
Vimium, Browser Extension
https://vimium.github.io/
Keyboard Shortcuts
Navigating the page
Key | Action |
---|
j | Scroll down |
k | Scroll up |
gg | Scroll to the top of the page |
G | Scroll to the bottom of the page |
d | Scroll a half page down |
u | Scroll a half page up |
h | Scroll left |
l | Scroll right |
r | Reload the page |
yy | Copy the current URL to the clipboard |
p | Open the clipboard’s URL in the current tab |
P | Open the clipboard’s URL in a new tab |
i | Enter insert mode |
v | Enter visual mode |
gi | Focus the first text input on the page |
f | Open a link in the current tab |
F | Open a link in a new tab |
gf | Select the next frame on the page |
gF | Select the page’s main/top frame |
Using find
Key | Action |
---|
/ | Enter find mode |
n | Cycle forward to the next find match |
N | Cycle backward to the previous find match |
Using the omnibar
Key | Action |
---|
o | Open URL, bookmark or history entry |
O | Open URL, bookmark or history entry in a new tab |
b | Open a bookmark |
B | Open a bookmark in a new tab |
T | Search through your open tabs |
Navigating history
Key | Action |
---|
H | Go back in history |
L | Go forward in history |
Manipulating tabs
Key | Action |
---|
t | Create new tab |
J | Go one tab left |
K | Go one tab right |
g0 | Go to the first tab |
g$ | Go to the last tab |
yt | Duplicate current tab |
x | Close current tab |
X | Restore closed tab |
Miscellaneous