187 lines
6.9 KiB
Markdown
187 lines
6.9 KiB
Markdown
# 🚀 Neovim Keybindings Cheatsheet
|
|
|
|
**Leader Key:** `<Space>`
|
|
|
|
## 📝 General & Basic Navigation
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<Space>` | n | Leader Key | Main leader key |
|
|
| `;` | n | `:` | Enter command mode |
|
|
| `jk` | i | `<ESC>` | Exit insert mode |
|
|
| `<Esc>` | n | Clear highlights | Remove search highlights |
|
|
| `<C-s>` | n | Save file | Save current file |
|
|
| `<C-c>` | n | Copy whole file | Copy entire file to clipboard |
|
|
|
|
## 🔢 Line Numbers
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>n` | n | Toggle line numbers | Show/hide line numbers |
|
|
| `<leader>rn` | n | Toggle relative numbers | Show/hide relative line numbers |
|
|
|
|
## 🚪 Window Navigation
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<C-h>` | n | Switch window left | Move to left window |
|
|
| `<C-l>` | n | Switch window right | Move to right window |
|
|
| `<C-j>` | n | Switch window down | Move to window below |
|
|
| `<C-k>` | n | Switch window up | Move to window above |
|
|
|
|
## ✏️ Insert Mode Navigation
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<C-b>` | i | Move to beginning of line | Go to start of line |
|
|
| `<C-e>` | i | Move to end of line | Go to end of line |
|
|
| `<C-h>` | i | Move left | Move cursor left |
|
|
| `<C-l>` | i | Move right | Move cursor right |
|
|
| `<C-j>` | i | Move down | Move cursor down |
|
|
| `<C-k>` | i | Move up | Move cursor up |
|
|
|
|
## 📂 Buffer Management (Tabufline)
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>b` | n | New buffer | Create new empty buffer |
|
|
| `<Tab>` | n | Next buffer | Switch to next buffer |
|
|
| `<S-Tab>` | n | Previous buffer | Switch to previous buffer |
|
|
| `<leader>x` | n | Close buffer | Close current buffer |
|
|
|
|
## 💬 Comments
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>/` | n | Toggle comment | Comment/uncomment current line |
|
|
| `<leader>/` | v | Toggle comment | Comment/uncomment selected lines |
|
|
|
|
## 🌳 File Explorer (NvimTree)
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<C-n>` | n | Toggle NvimTree | Open/close file explorer |
|
|
| `<leader>e` | n | Focus NvimTree | Focus on file explorer |
|
|
|
|
## 🔍 Telescope (Fuzzy Finder)
|
|
|
|
### File Operations
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>ff` | n | Find files | Search for files |
|
|
| `<leader>fa` | n | Find all files | Search including hidden/ignored files |
|
|
| `<leader>fo` | n | Find old files | Search recent files |
|
|
| `<leader>fw` | n | Live grep | Search text in files |
|
|
| `<leader>fb` | n | Find buffers | Search open buffers |
|
|
| `<leader>fz` | n | Current buffer fuzzy find | Search in current buffer |
|
|
|
|
### Git Operations
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>cm` | n | Git commits | Browse git commits |
|
|
| `<leader>gt` | n | Git status | View git status |
|
|
|
|
### Other Telescope Features
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>fh` | n | Help tags | Search help documentation |
|
|
| `<leader>ma` | n | Find marks | Search vim marks |
|
|
| `<leader>pt` | n | Pick terminal | Search hidden terminals |
|
|
| `<leader>th` | n | NvChad themes | Browse and select themes |
|
|
|
|
## 🖥️ Terminal Management
|
|
|
|
### Terminal Creation
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>h` | n | New horizontal terminal | Open terminal horizontally |
|
|
| `<leader>v` | n | New vertical terminal | Open terminal vertically |
|
|
|
|
### Terminal Toggles
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<A-v>` | n,t | Toggle vertical terminal | Toggle vertical terminal |
|
|
| `<A-h>` | n,t | Toggle horizontal terminal | Toggle horizontal terminal |
|
|
| `<A-i>` | n,t | Toggle floating terminal | Toggle floating terminal |
|
|
| `<C-x>` | t | Escape terminal mode | Exit terminal mode |
|
|
|
|
## 🎨 Formatting & Code
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>fm` | n,x | Format file | Format current file/selection |
|
|
|
|
## 🩺 LSP (Language Server Protocol)
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>ds` | n | Diagnostic loclist | Show diagnostics in location list |
|
|
|
|
## 🤖 GitHub Copilot Chat
|
|
|
|
### Help & Prompts
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>cch` | n | Help actions | Show Copilot help actions |
|
|
| `<leader>ccp` | n,x | Prompt actions | Show Copilot prompt actions |
|
|
|
|
### Code Operations
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>cce` | n | Explain code | Ask Copilot to explain code |
|
|
| `<leader>cct` | n | Generate tests | Generate unit tests |
|
|
| `<leader>ccr` | n | Review code | Get code review |
|
|
| `<leader>ccR` | n | Refactor code | Refactor code |
|
|
| `<leader>ccn` | n | Better naming | Suggest better names |
|
|
|
|
### Chat Operations
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>cci` | n | Ask input | Custom Copilot question |
|
|
| `<leader>ccq` | n | Quick chat | Quick chat with buffer |
|
|
| `<leader>ccv` | x | Visual chat | Chat with selected code |
|
|
| `<leader>ccx` | x | Inline chat | Inline chat with selection |
|
|
| `<leader>ccv` | n | Toggle chat | Toggle Copilot chat window |
|
|
|
|
### Git Integration
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>ccm` | n | Generate commit message | Commit message for all changes |
|
|
| `<leader>ccM` | n | Generate staged commit | Commit message for staged changes |
|
|
|
|
### Utility
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>ccd` | n | Debug info | Show Copilot debug info |
|
|
| `<leader>ccf` | n | Fix diagnostic | Fix diagnostic issues |
|
|
| `<leader>ccl` | n | Clear history | Clear chat history |
|
|
|
|
## ❓ Help & Documentation
|
|
|
|
| Key | Mode | Action | Description |
|
|
|-----|------|--------|-------------|
|
|
| `<leader>ch` | n | Toggle cheatsheet | Show/hide NvChad cheatsheet |
|
|
| `<leader>wK` | n | All keymaps | Show all available keymaps |
|
|
| `<leader>wk` | n | Query keymaps | Search for specific keymaps |
|
|
|
|
---
|
|
|
|
## 📚 Mode Legend
|
|
- **n** = Normal mode
|
|
- **i** = Insert mode
|
|
- **v** = Visual mode
|
|
- **x** = Visual selection mode
|
|
- **t** = Terminal mode
|
|
|
|
## 🔧 Custom Keybindings Notes
|
|
- Your leader key is set to `<Space>` (spacebar)
|
|
- `jk` in insert mode acts as `<ESC>` for quick mode switching
|
|
- `;` in normal mode enters command mode (equivalent to `:`)
|
|
- You have GitHub Copilot integration with extensive chat features
|
|
|
|
## 💡 Pro Tips
|
|
1. Use `<leader>th` to quickly switch between themes
|
|
2. `<leader>fa` finds ALL files including hidden ones
|
|
3. Use `<leader>fw` for project-wide text search
|
|
4. Copilot chat (`<leader>cc*`) commands work great for code assistance
|
|
5. Terminal toggles (`<A-v>`, `<A-h>`, `<A-i>`) are accessible from both normal and terminal modes |