diff --git a/README.md b/README.md index 27759bb..24ad02d 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,41 @@ -# 🚀 ULTIMATE NvChad CHEAT SHEET 🚀 +*** + +# 🚀 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) | -| `Ctrl+n` | Toggle tree | `Space fb` | Find buffers | +| `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 | -| `Ctrl+s` | Save file | `Space gt` | Git status | +| `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 | |-----|--------|-----|--------| -| `Ctrl+J` | Accept suggest | `Space ccq` | Quick chat (ask anything) | -| `Ctrl+]` | Next suggest | `Space cci` | Custom input chat | -| `Ctrl+[` | Prev suggest | `Space cce` | Explain selected code | -| `Ctrl+\` | Trigger | `Space ccr` | Review selected code | - +| `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 | |-----|--------|-----|--------| @@ -55,19 +47,15 @@ | `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 | -| `Ctrl+l` | Reset chat | `gd` | Show diff | -| `Enter` | Submit prompt | `gp` | Show system prompt | -| `Ctrl+y` | Accept diff | `gs` | Show user selection | - ---- - +| `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 | @@ -75,64 +63,51 @@ | `gi` | Go implement | `Space f` | Format document | | `gr` | Find reference | `Space fm` | Format selection | | `K` | Hover docs | `[d` | Previous diagnostic | -| `Ctrl+k` | Signature help | `]d` | Next diagnostic | +| `c-k` | Signature help | `]d` | Next diagnostic | | `Space D` | Type definition | `Space e` | Show line diagnostics | -| `Ctrl+o` | Jump back | `Space q` | Diagnostic quickfix list | -| `Ctrl+i` | Jump forward | `Space wa` | Add workspace folder | - +| `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 | |-----|--------|-----|--------| -| `Ctrl+h` | Left window | `Space v` | Vertical split | -| `Ctrl+j` | Down window | `Space h` | Horizontal split | -| `Ctrl+k` | Up window | `Ctrl+w c` | Close window | -| `Ctrl+l` | Right window | `Ctrl+w o` | Close others | - +| `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 | -| `Ctrl+w =` | Equal windows | | | - ---- - +| `c-w e` | Equal windows | | | +*** ## 💻 Terminal - | Key | Action | Key | Action | |-----|--------|-----|--------| -| `Alt+h` | Toggle horizontal terminal | `Space h` | New horizontal terminal | -| `Alt+v` | Toggle vertical terminal | `Space v` | New vertical terminal | -| `Alt+i` | Toggle floating terminal | `exit` | Exit terminal mode | -| `Ctrl+\` | Toggle terminal | `esc esc` | Exit terminal insert mode | - +| `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 | |-----|--------|-----|--------| -| `Enter`/`o` | Open file | `Ctrl+v` | Open vertical | -| `Ctrl+x` | Open horizontal | `Ctrl+t` | Open new tab | - +| `l`/`o` | Open file | `c-v` | Open vertical | +| `c-x` | Open horizontal | `c-t` | Open new tab | ### File Operations | Key | Action | Key | Action | |-----|--------|-----|--------| @@ -140,52 +115,41 @@ | `A` | Create folder | `x` | Cut | | `d` | Delete | `p` | Paste | | `r` | Rename | `y` | Copy name | -| `Ctrl+r` | Full rename | `Y` | Copy rel path | +| `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 | |-----|--------|-----|--------| -| `Ctrl+n`/`p` | Next/Previous item | `Enter` | Select item | -| `Ctrl+j`/`k` | Move down/up | `Ctrl+v` | Open in vertical split | -| `Ctrl+x` | Open in horizontal split | `Ctrl+t` | Open in new tab | -| `Ctrl+c`/`Esc` | Close telescope | `Tab` | Toggle selection | -| `Ctrl+q` | Send to quickfix | `?` | Show help | - +| `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 | |-----|--------|-----|--------| -| `Ctrl+u` | Scroll preview up | `Ctrl+/` | Toggle preview | -| `Ctrl+d` | Scroll preview down | `M` | Toggle mark | - ---- - +| `c-u` | Scroll preview up | `c-/` | Toggle preview | +| `c-d` | Scroll preview down | `M` | Toggle mark | +*** ## 🎯 Auto-completion (nvim-cmp) - | Key | Action | Key | Action | |-----|--------|-----|--------| -| `Ctrl+n` | Next item | `Tab` | Next (snippets) | -| `Ctrl+p` | Previous item | `Shift+Tab` | Prev (snippets) | -| `Ctrl+Space` | Trigger comp | `Ctrl+y` | Confirm | -| `Enter` | Confirm select | `Ctrl+[` | Cancel | -| `Ctrl+e` | Close menu | `Ctrl+d` | Scroll docs down | -| `Ctrl+f` | Scroll docs up | | | - ---- - +| `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 | |-----|--------|-----|--------| @@ -193,7 +157,6 @@ | `gc` (visual) | Toggle comment (selection) | | | | `gbc` | Toggle block comment | | | | `gb` (visual) | Toggle block (selection) | | | - ### Basic Editing | Key | Action | Key | Action | |-----|--------|-----|--------| @@ -204,12 +167,9 @@ | `S` | Substitute line | `dd` | Delete line | | `yy` | Yank (copy) line | `p` | Paste after | | `P` | Paste before | `u` | Undo | -| `Ctrl+r` | Redo | `.` | Repeat last command | - ---- - +| `c-r` | Redo | `.` | Repeat last command | +*** ## 🌈 Treesitter & Text Objects - ### Text Objects | Key | Action | Key | Action | |-----|--------|-----|--------| @@ -217,17 +177,13 @@ | `if` | Inside function | `ib` | Inside block | | `ac` | Around class | `aa` | Around argument | | `ic` | Inside class | `ia` | Inside argument | - ### Selection | Key | Action | Key | Action | |-----|--------|-----|--------| -| `Ctrl+Space` | Init selection | `Enter` | Expand select | -| `BS` | Shrink select | `Tab` | Expand scope | - ---- - +| `c-Space` | Init selection | `l` | Expand select | +| `Backspace` | Shrink select | `Tab` | Expand scope | +*** ## 🔄 Git Integration (Gitsigns) - ### Hunk Navigation | Key | Action | Key | Action | |-----|--------|-----|--------| @@ -235,37 +191,29 @@ | `[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 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 | +| `:MasonInstall ` | Install LSP server | | `:MasonUpdate` | Update all servers | - ### Plugin Management | Command | Action | |---------|--------| @@ -274,11 +222,8 @@ | `:Lazy update` | Update plugins | | `:Lazy clean` | Clean unused plugins | | `:Lazy sync` | Sync plugins | - ---- - +*** ## ↔️ Vim Movement - ### Basic Movement | Key | Action | Key | Action | |-----|--------|-----|--------| @@ -289,15 +234,13 @@ | `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 | |-----|--------|-----|--------| -| `Ctrl+u` | Half page up | `Ctrl+b` | Full page up | -| `Ctrl+d` | Half page down | `Ctrl+f` | Full page down | +| `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 | |-----|--------|-----|--------| @@ -305,18 +248,14 @@ | `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 | |---------|--------| @@ -325,7 +264,6 @@ | `:%s/old/new/g` | Replace all in file | | `:%s/old/new/gc` | Replace all with confirm | | `:noh` | Clear search highlight | - ### Advanced Search | Command | Action | |---------|--------| @@ -333,214 +271,24 @@ | `: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 | -| `Ctrl+v` | Visual block | `O` | Other corner | - +| `c-v` | Visual block | `O` | Other corner | ### Visual Operations | Key | Action | Key | Action | |-----|--------|-----|--------| | `y` | Yank selection | `>` | Indent right | -| `d` | Delete select | `<` | Indent left | -| `c` | Change select | `=` | Auto-indent | -| `r` | Replace select | `J` | Join lines | -| `u` | Lowercase | `gJ` | Join no space | -| `U` | Uppercase | | | -| `~` | Toggle case | | | - ---- - -## 📋 Registers & Macros - -### Registers -| Key | Action | Key | Action | -|-----|--------|-----|--------| -| `"ay` | Yank to register a | `""` | Unnamed register | -| `"ap` | Paste from register a | `"0` | Last yank register | -| `:reg` | Show all registers | `"+` | System clipboard | -| `"*` | System primary selection | `"/` | Last search pattern | - -### Macros -| Key | Action | Key | Action | -|-----|--------|-----|--------| -| `qa` | Start recording macro a | `@a` | Play macro a | -| `q` | Stop recording macro | `@@` | Repeat last macro | -| `:let @a=''` | Clear macro a | `5@a` | Execute macro a 5 times | -| `qA` | Append to macro a | | | - ---- - -## 🗂️ Tabs & Folds - -### Tabs -| Command | Action | Key | Action | -|---------|--------|-----|--------| -| `:tabnew` | New tab | `gt` | Next tab | -| `:tabclose` | Close tab | `gT` | Previous tab | -| `:tabnext` | Next tab | `{num}gt` | Go to tab num | -| `:tabprev` | Previous tab | | | - -### Folds -| Key | Action | Key | Action | -|-----|--------|-----|--------| -| `za` | Toggle fold | `zr` | Reduce fold | -| `zA` | Toggle all fold | `zR` | Open all folds | -| `zo` | Open fold | `zm` | More folds | -| `zO` | Open all folds | `zM` | Close all folds | -| `zc` | Close fold | `zi` | Toggle folding | -| `zC` | Close all folds | | | - ---- - -## 📊 Marks & Jumps - -### Marks -| Key | Action | Key | Action | -|-----|--------|-----|--------| -| `ma` | Set mark a | `'a` | Jump to line with mark a | -| `` `a`` | Jump to mark a position | `''` | Jump to previous line | -| ``.`` | Jump to last edited position | `':marks` | Show all marks | -| `:delmarks a` | Delete mark a | | | - -### Jumps -| Key | Action | Key | Action | -|-----|--------|-----|--------| -| `Ctrl+o` | Jump back in jump list | `g;` | Jump to last change | -| `Ctrl+i` | Jump forward in jump list | `g,` | Jump to next change | -| `:jumps` | Show jump list | `:changes` | Show change list | - ---- - -## 🚨 Quickfix & Location List - -### Quickfix -| Command | Action | Key | Action | -|---------|--------|-----|--------| -| `:copen` | Open quickfix window | `:cn` | Next quickfix item | -| `:cclose` | Close quickfix window | `:cp` | Previous quickfix item | -| `:cc` | Go to quickfix item | `:cfirst` | First quickfix item | -| `:clast` | Last quickfix item | `:cdo cmd` | Execute cmd on each item | - -### Location List -| Command | Action | Key | Action | -|---------|--------|-----|--------| -| `:lopen` | Open location list | `:ln` | Next location item | -| `:lclose` | Close location list | `:lp` | Previous location item | -| `:ll` | Go to location item | `:lfirst` | First location item | -| `:llast` | Last location item | | | - ---- - -## 🔧 File Operations - -### Basic File Operations -| Command | Action | Command | Action | -|---------|--------|---------|--------| -| `:w` | Write (save) | `:e filename` | Edit file | -| `:w filename` | Save as | `:e!` | Reload file | -| `:wa` | Write all | `:new` | New window | -| `:q` | Quit | `:vnew` | New vertical | -| `:q!` | Quit no save | `:r filename` | Read file | -| `:wq` | Write and quit | `:r !command` | Read command | - -### Directory Operations -| Command | Action | Command | Action | -|---------|--------|---------|--------| -| `:cd path` | Change dir | `:ls` | List buffers | -| `:pwd` | Print work dir | `:b{num}` | Buffer number | -| `:bn` | Next buffer | `:bp` | Previous buffer | -| `:bd` | Delete buffer | | | - ---- - -## 💾 Sessions & Views - -| Command | Action | Command | Action | -|---------|--------|---------|--------| -| `:mksession` | Make session | `:mkview` | Make view | -| `:mks!` | Overwrite session | `:loadview` | Load view | -| `:source session` | Load session | `vim -S` | Start with session | - ---- - -## 🎯 Workflow Examples - -### 1. Find & Open File -``` -Space ff → type filename → Enter -``` - -### 2. Search Text in Project -``` -Space fw → type search → Enter -``` - -### 3. Go to Definition & Back -``` -gd → Ctrl+o -``` - -### 4. AI Code Explanation -``` -Select code → Space cce -``` - -### 5. Quick Chat with AI -``` -Space ccq → ask question → Enter -``` - -### 6. Format Code -``` -Space ca → select format -``` - -### 7. Git Stage Changes -``` -]c → Space hp → Space hs -``` - -### 8. Find & Replace -``` -Space fw → search → Ctrl+q → :%s//new/g -``` - ---- - -## 🆘 Help & Troubleshooting - -### Getting Help -| Command | Action | -|---------|--------| -| `:help topic` | Get help on topic | -| `:h` | Short for help | -| `:helpgrep pattern` | Search in help | -| `:version` | Show version info | -| `:checkhealth` | Check neovim health | -| `:messages` | Show messages | - -### Debugging -| Command | Action | -|---------|--------| -| `:scriptnames` | Show loaded scripts | -| `:map` | Show all mappings | -| `:map ` | Show mapping for key | +| `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 @@ -549,42 +297,20 @@ Space fw → search → Ctrl+q → :%s//new/g - **g + d**: Go to definition - **K**: Show documentation - **Space + e**: Focus file explorer -- **Ctrl + n**: Toggle file tree - +- **c-n**: Toggle file tree ### Workflow Shortcuts -1. **File Navigation**: `Space ff` → type filename → `Enter` -2. **Code Navigation**: `gd` (definition) → `Ctrl+o` (back) -3. **Search & Replace**: `Space fw` → search → `Ctrl+q` → `:%s//new/g` +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**: `Alt+i` → run commands +5. **Terminal Integration**: `a-i` → run commands 6. **Theme & Config**: `Space th` → select theme ---- - -## 💡 Remember - -### Core Concepts -- **Vim is modal** (Normal/Insert/Visual/Command modes) -- **Motions**: `w`(word) `e`(end) `b`(back) `0`(`$`) `^`(`$`) `gg`(`G`) `f`(`F`) `t`(`T`) -- **Operators**: `d`(delete) `y`(yank) `c`(change) `>`(indent) `<`(unindent) -- **Text objects**: `i`/`a` + `w`(word) `s`(sentence) `p`(paragraph) `b`(block) - -### Quick Start -1. Press **Space** and wait to see all options -2. **Space ff** = Find files | **Space fw** = Find text | **Ctrl+n** = File tree -3. **gd** = Go to definition | **K** = Show docs | **Space ca** = Code actions -4. **Space ccq** = AI chat | **Ctrl+J** = Accept AI | **Space cce** = Explain code - -### Master the Basics First -- Learn basic movement (`hjkl`, `w`, `b`, `0`, `$`) -- Master editing (`i`, `a`, `o`, `dd`, `yy`, `p`) -- Understand modes (Normal, Insert, Visual) -- Then gradually learn advanced features! - ---- - -**🚀 Master the basics first, then gradually learn advanced features!** - -> Use `Space ch` in NvChad to access the built-in cheatsheet -> Use `:help ` for detailed help on any command -> Use `:checkhealth` to verify your setup is working correctly +[1] https://nvchad.com/docs/config/mappings/ +[2] https://github.com/NvChad/NvChad/discussions/2832 +[3] https://www.reddit.com/r/neovim/comments/1fwku9i/how_to_remove_and_replace_key_mappings_in_nvchad/ +[4] https://github.com/NvChad/NvChad/issues/506 +[5] https://blog.spoonconsulting.com/getting-started-with-neovim-using-nvchad-a-developers-guide-f97d81e85d60 +[6] https://docs.rockylinux.org/books/nvchad/nvchad_ui/using_nvchad/ +[7] https://nvchad.com/docs/config/walkthrough/ +[8] https://nvchad.com/docs/faq/ \ No newline at end of file