How to read the Shortcuts present in this cheatsheet
The shortcuts in this cheatsheet are written in the “Vim key notiation” (the one use use to write the shortcut notation in lua file) to avoid any confusion and keep it similar.
Special Keys
<Esc>
: Escape key<CR>
or<Enter>
: Enter/Return key<BS>
: Backspace<Space>
: Space bar<Tab>
: Tab key<S-Tab>
: Shift + Tab<Up>
,<Down>
,<Left>
,<Right>
: Arrow keys<Home>
,<End>
: Home and End keys<PageUp>
,<PageDown>
: Page Up and Page Down keys<Insert>
,<Del>
: Insert and Delete keysFunction Keys
<F1>
to<F12>
: Function keysModifier Keys
<C->
: Control key (e.g.,<C-f>
for Ctrl+F)<S->
: Shift key (e.g.,<S-f>
for Shift+F)<M->
or<A->
: Meta/Alt key (e.g.,<M-f>
or<A-f>
for Alt+F)<D->
: Command key on macOS (e.g.,<D-f>
for Cmd+F)Special Characters
<Bar>
: | (pipe) character
<Bslash>
: \ (backslash) character
<Lt>
: < (less than) character
<Gt>
: > (greater than) characterCombinations
You can combine modifiers, for example:
<C-S-f>
: Ctrl+Shift+F<M-C-x>
: Alt+Ctrl+XLeader Key
<Leader>
: Represents the leader key (customizable, often set to space or comma)Mouse Clicks
<LeftMouse>
,<RightMouse>
,<MiddleMouse>
The internet is riddled with a lot of information and many opinionated configs for you to quickly install and start using NeoVim without understanding any of the configs. However, knowing how NeoVim works and plugin ecosystems will give you more power to make the config more personal to meet your needs than using someone else’s.
I’ve loved Kickstarter by TeejDev and started customizing it based on the good parts of NVChad that I’ve found. You can find my current config here on GitHub - pranavtechie/nvim-config
https://neo.vimhelp.org/ (HTML Version of the current Nvim docs)
Pro Tip
You can open NeoVim by typing
nvim
in the terminal. If you want to open NeoVim without any of the configurations that you’ve setup. You can use the--clean
flag (nvim --clean
to open without any configuration changes)
Current Environments I’ve tried
Not yet categorized list
Things I want
- all the basics, treesitter, status bar, autocomplete, lsp, file tree, tab bar (nvchad),
- proper telescope setup as shown in kickstarter by TeejDev
- use the
jk
shortcut,ZZ
for exit, other
Basic Vim Keybindings
i
- insert mode
A
- append mode - moves the cursor to the end of the line
<Esc>
- enters normal mode
Motions
Cursor Based
j
- move down
k
- move up
l
- move right
h
- move left
Word Based
e
- move to the end of the word
w
- move to the start of the next word
b
- move to the start of the word
Line Based
0
- move to the start of the line
$
- move to the end of the line (after last character)
View Based (Current Screen)
<C-f>
- scrolls the view down by full screen length
<C-b>
- scrolls the view up by full screen length
File Based
gg
- go to the start of the file
G
- go to the end of the file
<number>G
- will take the cursor to the specified line number
Occurrence
#
- move to the previous occurrence of the word under the cursor
*
- move to the next occurrence of the word under the cursor
Operators
d
-
c
- change - replace
y
- yank (copy) the line to the buffer
p
- put command, pastes the thing in the buffer one line below the cursor
r
- replace, place the cursor on a character, type r
and the character to replace the current character with
%
- clicking on it will take the cursor to the matching parenthesis and toggles between them
<Operator><Motion>
dw
- delete word and move to the next word
d$
- delete from current position to the end of the line
Commands
:set number
- show line numbers on the open file
:q
- quit
:qa
- quit all buffers
:qa!
- force quit all buffers - ignore unsaved changes and warnings
:w
- write
:wqa
- write and quit all
Searching
/<text>
- to search and highlight something on the page (forward search)
?<text>
- starts searching from the bottom of the file (backward search)
:noh
- (no highlight) to remove the highlighted section from the page
n
- to go to the next occurrence
N
- to go to the previous occurrence
<C-o>
- to go to the origin cursor position
Substitute
:s/<old>/<new>/
- changes all the occurrences of <old>
with <new>
for the first match
for the substitution to have affect on all occurrences in the line - you have to use the g
(global) parameter like :s/<old>/<new>/g
Understanding Configuration
- Using the
lazy.vim
as the package manager in the structured file setup, multiple plugins are stored as individual files and multiple packages can be grouped in aspec
file. - The configuration for each plugin can either be done in the
init.lua
file or in the individual/spec file of the plugin.
*
- to match occurence of words currently under the cursor
Packages
- Telescope - fuzzy search
- Neotree - file tree
- Catppuccin - Appearance / Theme
- Lualine - statusbar
- LSP Setup
- Treesitter - parser