Local Dev with NeoVim

VIM Basics

Movement

1↑ - k
2← - h
3→ - l
4↓ - j

Words

1w - next word
2b - previous word
3e - end of next word

Exit

1:q - quit 
2:qw - save & quit
3:w - save
4:q! - quit without saving

Screen Navigation

1G - end of file
2gg || :0 - beginning of the file
3% - jump to matching '()', '{}', '[]'
4<c-b> - page up
5<c-f> - page down

Line Navigation

10 - Move to beginning of line
2^ - First non-blank char of line
3$ - End of the line

Word Navigation

1w   - next word
2b   - prev word
30   - start of line
4^   - first non-blank char of line
5$   - end of line

Text Editing

 1a   - append
 2A   - append from the end of the line
 3o   - insert from new line
 4O   - insert from prev line
 5x   - delete char under cursor
 6s   - delete character & insert
 7S   - Delete line and insert
 8C   - delete to the end of line and insert
 9r   - replace single character
10R   - Enter Replace mode

Clipboard

1u     - undo
2<c-r> - redo

More Vim

Select within (), {}

1:vi(  - select text within ()
2:vib  - select text within ()
3
4:vi{  - select text within {}
5:viB  - select text within {}

Neovim Basics

Open New Pane

opens a in-memory file (buffer) and creates a viewport of that buffer (window)

1<c-w> v     - split window vertically
2:vsplit :vs - alais for above
3<c-w><c-s>  - split window in 2 horizontally
4:split :sp  - alais for above 
5:sp +term   - opens window and creates new terminal session
1<c-w-h> - Moves the cursor to the left pane.
2<c-w-j> - Moves the cursor to the lower pane.
3<c-w-k> - Moves the cursor to the upper pane.
4<c-w-l> - Moves the cursor to the right pane.

Fuzzy Finder (Telescope)

1:Telescope  - to launch
2<c-/>       - insert mode while in Telescope
3?           - normal mode while in Telescope
4<c-c>       - close telescope 

Keymaps for Telescope

1space-sh  - search help
2space-sk  - search keymaps

Harpoon

1space-a   - add to list
2<c-e>     - show list
3<c-1>     - Select 1 from list
4<c-2>     - Select 2 from list
5<c-3>     - Select 3 from list
6<c-4>     - Select 4 from list

Todo

1:TodoQuickFix   - list all todos in project
2:TodoTelescope  - list all todos in telescope

Local Dev Tools

Kitty Terminal

1<c-shift-t>     - new tab
2<c-shift-q>     - close tab
3<c-shift-right> - next tab
4<c-shift-left>  - previous tab
5<c-shift-enter> - new window
6<c-shift-n>     - new os window

Tmux

1tmux new -s sessionName - Start a new session with name
2tmux a -t sessionName   - Attach to session with given name
3tmux ls                 - list all sessions
4tmux kill-session -t sessionName
5<c-b> + d               - detact from session
comments powered by Disqus