308 lines
11 KiB
Markdown
308 lines
11 KiB
Markdown
***
|
|
|
|
# 🚀 ULTIMATE NvChad CHEAT SHEET (Remapped) 🚀
|
|
> **Complete Reference - All Plugins & Vim**
|
|
> **Leader Key: SPACE**
|
|
***
|
|
## 🔥 Essential Workflow
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `Space` | Show all keys | `Space ff` | Find files |
|
|
| `Space ff` | Find files | `Space fa` | Find all files (+ hidden) |
|
|
| `Space fw` | Find text | `Space fw` | Live grep (search in files) |
|
|
| `c-n` | Toggle tree | `Space fb` | Find buffers |
|
|
| `Space e` | Focus tree | `Space fh` | Help pages |
|
|
| `Tab` | Next buffer | `Space fo` | Find recent files |
|
|
| `Shift+Tab` | Prev buffer | `Space fz` | Find in current buffer |
|
|
| `Space x` | Close buffer | `Space cm` | Git commits |
|
|
| `c-s` | Save file | `Space gt` | Git status |
|
|
| `gd` | Go definition | `/text` | Search in file |
|
|
| `K` | Show docs | `*` | Search word under cursor |
|
|
***
|
|
## 🤖 Copilot AI
|
|
### Basic Copilot
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-j` | Accept suggest | `Space ccq` | Quick chat (ask anything) |
|
|
| `c-]` | Next suggest | `Space cci` | Custom input chat |
|
|
| `c-[` | Prev suggest | `Space cce` | Explain selected code |
|
|
| `c-\` | Trigger | `Space ccr` | Review selected code |
|
|
### Copilot Commands
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:Copilot auth` | Authenticate |
|
|
| `:Copilot status` | Status |
|
|
| `:Copilot enable/disable` | Enable/Disable |
|
|
***
|
|
## 💬 CopilotChat
|
|
### Chat Commands
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `Space ccq` | Quick chat (ask anything) | `Space ccm` | Generate commit msg (all) |
|
|
| `Space cci` | Custom input chat | `Space ccM` | Generate commit msg (staged) |
|
|
| `Space cce` | Explain selected code | `Space cch` | Help actions (Telescope) |
|
|
| `Space ccr` | Review selected code | `Space ccp` | Prompt actions (Telescope) |
|
|
| `Space ccR` | Refactor/optimize code | `Space ccv` | Toggle chat window |
|
|
| `Space cct` | Generate tests | `Space ccl` | Clear chat history |
|
|
| `Space ccf` | Fix diagnostics | `Space ccd` | Debug info |
|
|
| `Space ccn` | Better naming suggestions | | |
|
|
### Chat Window Controls
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `q` | Close chat | `gy` | Yank diff |
|
|
| `c-l` | Reset chat | `gd` | Show diff |
|
|
| `l` | Submit prompt | `gp` | Show system prompt |
|
|
| `c-y` | Accept diff | `gs` | Show user selection |
|
|
***
|
|
## 🧭 Code Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `gd` | Go definition | `Space ca` | Code actions |
|
|
| `gD` | Go declaration | `Space ra` | Rename symbol |
|
|
| `gi` | Go implement | `Space f` | Format document |
|
|
| `gr` | Find reference | `Space fm` | Format selection |
|
|
| `K` | Hover docs | `[d` | Previous diagnostic |
|
|
| `c-k` | Signature help | `]d` | Next diagnostic |
|
|
| `Space D` | Type definition | `Space e` | Show line diagnostics |
|
|
| `c-o` | Jump back | `Space q` | Diagnostic quickfix list |
|
|
| `c-i` | Jump forward | `Space wa` | Add workspace folder |
|
|
### LSP Commands
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:LspInfo` | LSP information |
|
|
| `:checkhealth` | Check Neovim health |
|
|
***
|
|
## 🪟 Windows & Buffers
|
|
### Window Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-h` | Left window | `Space v` | Vertical split |
|
|
| `c-j` | Down window | `Space h` | Horizontal split |
|
|
| `c-k` | Up window | `c-w c` | Close window |
|
|
| `c-l` | Right window | `c-w o` | Close others |
|
|
### Buffer Management
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `Tab` | Next buffer | `Space x` | Close buffer |
|
|
| `Shift+Tab` | Previous buffer | `Space b` | New buffer |
|
|
| `c-w e` | Equal windows | | |
|
|
***
|
|
## 💻 Terminal
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `a-h` | Toggle horizontal terminal | `Space h` | New horizontal terminal |
|
|
| `a-v` | Toggle vertical terminal | `Space v` | New vertical terminal |
|
|
| `a-i` | Toggle floating terminal | `exit` | Exit terminal mode |
|
|
| `c-\` | Toggle terminal | `jk jk` | Exit terminal insert mode |
|
|
### Terminal Commands
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:term` | Open terminal |
|
|
| `:split term://` | Horizontal terminal split |
|
|
| `:vsplit term://` | Vertical terminal split |
|
|
***
|
|
## 🌳 File Tree (NvimTree)
|
|
### Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `l`/`o` | Open file | `c-v` | Open vertical |
|
|
| `c-x` | Open horizontal | `c-t` | Open new tab |
|
|
### File Operations
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `a` | Create file | `c` | Copy |
|
|
| `A` | Create folder | `x` | Cut |
|
|
| `d` | Delete | `p` | Paste |
|
|
| `r` | Rename | `y` | Copy name |
|
|
| `c-r` | Full rename | `Y` | Copy rel path |
|
|
| `gy` | Copy abs path | | |
|
|
### View Options
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `H` | Toggle hidden | `R` | Refresh |
|
|
| `I` | Toggle ignore | `W` | Collapse all |
|
|
| `E` | Expand all | `q` | Close tree |
|
|
***
|
|
## 🔭 Telescope
|
|
### Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-n`/`p` | Next/Previous item | `l` | Select item |
|
|
| `c-j`/`k` | Move down/up | `c-v` | Open in vertical split |
|
|
| `c-x` | Open in horizontal split | `c-t` | Open in new tab |
|
|
| `c-c`/`jk` | Close telescope | `Tab` | Toggle selection |
|
|
| `c-q` | Send to quickfix | `?` | Show help |
|
|
### Preview Controls
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-u` | Scroll preview up | `c-/` | Toggle preview |
|
|
| `c-d` | Scroll preview down | `M` | Toggle mark |
|
|
***
|
|
## 🎯 Auto-completion (nvim-cmp)
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-n` | Next item | `Tab` | Next (snippets) |
|
|
| `c-p` | Previous item | `Shift+Tab` | Prev (snippets) |
|
|
| `c-Space` | Trigger comp | `c-y` | Confirm |
|
|
| `l` | Confirm select | `c-[` | Cancel |
|
|
| `c-e` | Close menu | `c-d` | Scroll docs down |
|
|
| `c-f` | Scroll docs up | | |
|
|
***
|
|
## 📝 Comments & Editing
|
|
### Comments
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `gcc` | Toggle line comment | `Space /` | Toggle comment line |
|
|
| `gc` (visual) | Toggle comment (selection) | | |
|
|
| `gbc` | Toggle block comment | | |
|
|
| `gb` (visual) | Toggle block (selection) | | |
|
|
### Basic Editing
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `i` | Insert before cursor | `o` | New line below |
|
|
| `I` | Insert at line start | `O` | New line above |
|
|
| `a` | Append after cursor | `c` | Change operator |
|
|
| `A` | Append at line end | `s` | Substitute character |
|
|
| `S` | Substitute line | `dd` | Delete line |
|
|
| `yy` | Yank (copy) line | `p` | Paste after |
|
|
| `P` | Paste before | `u` | Undo |
|
|
| `c-r` | Redo | `.` | Repeat last command |
|
|
***
|
|
## 🌈 Treesitter & Text Objects
|
|
### Text Objects
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `af` | Around function | `ab` | Around block |
|
|
| `if` | Inside function | `ib` | Inside block |
|
|
| `ac` | Around class | `aa` | Around argument |
|
|
| `ic` | Inside class | `ia` | Inside argument |
|
|
### Selection
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-Space` | Init selection | `l` | Expand select |
|
|
| `Backspace` | Shrink select | `Tab` | Expand scope |
|
|
***
|
|
## 🔄 Git Integration (Gitsigns)
|
|
### Hunk Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `]c` | Next hunk | `Space hs` | Stage hunk |
|
|
| `[c` | Previous hunk | `Space hr` | Reset hunk |
|
|
| `Space hS` | Stage buffer | `Space hu` | Undo stage hunk |
|
|
| `Space hR` | Reset buffer | `Space hp` | Preview hunk |
|
|
### Git Actions
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `Space hb` | Blame line | `Space hd` | Diff this |
|
|
| `Space tb` | Toggle blame | `Space hD` | Diff this \~ |
|
|
| `Space td` | Toggle deleted | `ih` | Inside hunk (text object) |
|
|
| `ah` | Around hunk (text object) | | |
|
|
***
|
|
## 🎨 Themes & UI
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `Space th` | Theme switcher | `Space n` | Toggle numbers |
|
|
| `Space tt` | Toggle transparency | `Space rn` | Toggle rel numbers |
|
|
| `Space ch` | NvChad help | `Space i` | Indent guide |
|
|
| `Space nu` | Update NvChad | `Space wk` | Which-key |
|
|
***
|
|
## 🛠️ Mason & Plugins
|
|
### Mason Commands
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:Mason` | Open Mason LSP manager |
|
|
| `:MasonInstall ` | Install LSP server |
|
|
| `:MasonUpdate` | Update all servers |
|
|
### Plugin Management
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:Lazy` | Open Lazy plugin manager |
|
|
| `:Lazy install` | Install plugins |
|
|
| `:Lazy update` | Update plugins |
|
|
| `:Lazy clean` | Clean unused plugins |
|
|
| `:Lazy sync` | Sync plugins |
|
|
***
|
|
## ↔️ Vim Movement
|
|
### Basic Movement
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `h/j/k/l` | Left/Down/Up/Right | `0` | Start of line |
|
|
| `w` | Next word | `^` | First non-blank |
|
|
| `W` | Next WORD | `$` | End of line |
|
|
| `b` | Previous word | `gg` | Go to top |
|
|
| `B` | Previous WORD | `G` | Go to bottom |
|
|
| `e` | End of word | `{number}G` | Go to line |
|
|
| `E` | End of WORD | | |
|
|
### Page Navigation
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `c-u` | Half page up | `c-b` | Full page up |
|
|
| `c-d` | Half page down | `c-f` | Full page down |
|
|
| `zt` | Cursor to top | `zz` | Cursor center |
|
|
| `zb` | Cursor bottom | | |
|
|
### Character Finding
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `f{char}` | Find character | `;` | Repeat f/t |
|
|
| `F{char}` | Find char back | `,` | Repeat f/t back |
|
|
| `t{char}` | Till character | | |
|
|
| `T{char}` | Till char back | | |
|
|
***
|
|
## 🔍 Search & Replace
|
|
### Search
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `/pattern` | Search forward | `n` | Next match |
|
|
| `?pattern` | Search backward | `N` | Previous match |
|
|
| `*` | Search word under cursor | `#` | Search word under cursor bwd |
|
|
### Replace
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:s/old/new` | Replace in line |
|
|
| `:s/old/new/g` | Replace all in line |
|
|
| `:%s/old/new/g` | Replace all in file |
|
|
| `:%s/old/new/gc` | Replace all with confirm |
|
|
| `:noh` | Clear search highlight |
|
|
### Advanced Search
|
|
| Command | Action |
|
|
|---------|--------|
|
|
| `:g/pattern/d` | Delete lines with pattern |
|
|
| `:v/pattern/d` | Delete lines without pattern |
|
|
| `\c` | Case insensitive (in search) |
|
|
| `\C` | Case sensitive (in search) |
|
|
***
|
|
## 👁️ Visual Mode
|
|
### Selection Modes
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `v` | Visual char | `gv` | Select last |
|
|
| `V` | Visual line | `o` | Other end |
|
|
| `c-v` | Visual block | `O` | Other corner |
|
|
### Visual Operations
|
|
| Key | Action | Key | Action |
|
|
|-----|--------|-----|--------|
|
|
| `y` | Yank selection | `>` | Indent right |
|
|
| `d` | Delete select | `` | Show mapping for key |
|
|
| `:verbose map` | Show mapping with source |
|
|
| `:set option?` | Show option value |
|
|
| `:set all` | Show all options |
|
|
***
|
|
## 🔥 Pro Tips
|
|
### Essential Combinations
|
|
- **Leader + f + f**: Quick file finder
|
|
- **Leader + f + w**: Search text across project
|
|
- **Leader + c + a**: Code actions (fix/refactor)
|
|
- **Leader + c + c + q**: Ask Copilot anything
|
|
- **g + d**: Go to definition
|
|
- **K**: Show documentation
|
|
- **Space + e**: Focus file explorer
|
|
- **c-n**: Toggle file tree
|
|
### Workflow Shortcuts
|
|
1. **File Navigation**: `Space ff` → type filename → `l`
|
|
2. **Code Navigation**: `gd` (definition) → `c-o` (back)
|
|
3. **Search & Replace**: `Space fw` → search → `c-q` → `:%s//new/g`
|
|
4. **AI Assistance**: Select code → `Space cce` (explain) or `Space ccr` (review)
|
|
5. **Terminal Integration**: `a-i` → run commands
|
|
6. **Theme & Config**: `Space th` → select theme
|
|
|