mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 08:03:44 +00:00
3.6 KiB
3.6 KiB
Neovim Configuration Cheat Sheet
Leader Keys
- Leader:
Space - Local Leader:
,
Basic Vim Shortcuts
Navigation
h j k l- Move left, down, up, rightw- Move forward by wordb- Move backward by word0- Move to beginning of line$- Move to end of linegg- Go to top of fileG- Go to bottom of fileCtrl+u- Scroll up half pageCtrl+d- Scroll down half pageCtrl+o- Jump back to previous locationCtrl+i- Jump forward to next location
Editing
i- Insert mode before cursora- Insert mode after cursoro- Insert new line below and enter insert modeO- Insert new line above and enter insert modedd- Delete current lineyy- Yank (copy) current linep- Paste after cursorP- Paste before cursoru- UndoCtrl+r- Redox- Delete character under cursorr- Replace character under cursor
Visual Mode
v- Visual mode (character selection)V- Visual line modeCtrl+v- Visual block modey- Yank selectiond- Delete selection
Search & Replace
/- Search forward?- Search backwardn- Next search resultN- Previous search result:%s/old/new/g- Replace all occurrences
Plugin Shortcuts
Telescope (File Navigation)
<leader>ff- Find files<leader>fg- Live grep (search in files)<leader>fb- Browse buffers<leader>fh- Help tags
Neo-tree (File Explorer)
<leader>e- Toggle file explorer
Comment.nvim (Code Commenting)
gcc- Toggle comment on current linegc- Toggle comment (linewise)gbc- Toggle block comment on current linegb- Toggle block comment
LSP (Language Server Protocol)
gD- Go to declarationgd- Go to definitionK- Show hover informationgi- Go to implementation<leader>rn- Rename symbol<leader>ca- Code actionsgr- Find references<leader>f- Format code
Window Management
Ctrl+w h- Move to left windowCtrl+w j- Move to bottom windowCtrl+w k- Move to top windowCtrl+w l- Move to right windowCtrl+w v- Split window verticallyCtrl+w s- Split window horizontallyCtrl+w q- Close current window
Buffer Management
:bnextor:bn- Next buffer:bprevor:bp- Previous buffer:bd- Delete/close buffer:ls- List all buffers
Features Enabled
Auto-completion & Pairs
- Automatic bracket, quote, and parentheses pairing
- Smart indentation
Git Integration (Gitsigns)
- Git change indicators in the gutter
- Visual indicators for added (
│), changed (│), deleted (_) lines
Syntax Highlighting (Treesitter)
- Enhanced syntax highlighting for:
- Lua, Vim, JavaScript, TypeScript
- Python, HTML, CSS, JSON, YAML, Markdown
Language Servers (LSP)
- Lua: lua_ls
- Python: pyright
- JavaScript/TypeScript: tsserver
- Automatic installation via Mason
Theme
- Vesper colorscheme with true color support
Configuration Details
Editor Settings
- Line numbers with relative numbering
- 2-space indentation
- No swap files, persistent undo
- Case-insensitive search (smart case)
- Clipboard integration with system
- 80-character color column
- Mouse support enabled
- Auto-split below and right
Performance Optimizations
- Lazy loading for most plugins
- Disabled unused vim plugins (gzip, netrw, etc.)
- Fast updatetime (50ms)
Quick Tips
- Use
<leader>ffto quickly find files - Use
<leader>fgto search within files - Press
Kon any function/variable for documentation - Use
<leader>eto toggle the file tree - Comment code quickly with
gcc - Format code with
<leader>f