Add basic auto-completion to Neovim and comprehensive documentation

- Add nvim-cmp plugin with buffer and path completion sources
- Configure intuitive keybindings for completion navigation:
  * Ctrl+Space to trigger completion manually
  * Tab/Shift+Tab for menu navigation
  * Enter to accept completion, Ctrl+e to close menu
- Enable autoEnableSources for automatic plugin management

- Add comprehensive "Code Editing & Auto-completion" section to README:
  * Document all key features: Gruvbox theme, Tree-sitter, file explorer
  * Provide complete auto-completion usage guide with keybindings
  * Include essential keybinding reference for file operations, clipboard, git
  * Explain completion sources: buffer words and file path suggestions

Benefits:
- Simple, non-intrusive auto-completion without language servers
- Word completion from open buffers for faster typing
- Path completion for file navigation and imports
- Clear documentation for all Neovim features and keybindings
- Follows standard completion UI patterns users expect

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yan Lin 2025-07-28 20:36:45 +02:00
parent f7f6d117c7
commit 3e938daef8
2 changed files with 78 additions and 0 deletions

View file

@ -297,6 +297,63 @@ Launch with `lazygit` in any git repository for:
- File tree navigation with git status - File tree navigation with git status
- Intuitive keyboard shortcuts and help system - Intuitive keyboard shortcuts and help system
### 🌟 Code Editing & Auto-completion
**Tool**: Neovim with NixVim
**Purpose**: Modern text editor with declarative configuration and basic auto-completion
Configured with essential plugins and basic auto-completion for improved productivity:
#### Key Features:
- **Gruvbox theme**: Dark theme with hard contrast for better readability
- **Tree-sitter**: Advanced syntax highlighting for multiple languages
- **File explorer**: nvim-tree for project navigation
- **Auto-completion**: Basic word and path completion without language servers
- **Git integration**: vim-fugitive for version control operations
- **Markdown rendering**: Live preview for documentation
#### Auto-completion Usage:
**Basic completion:**
```
Ctrl+Space # Trigger completion menu manually
Tab # Navigate to next completion item
Shift+Tab # Navigate to previous completion item
Enter # Accept selected completion
Ctrl+e # Close completion menu
```
**Completion sources:**
- **Buffer completion**: Suggests words from currently open files
- **Path completion**: Suggests file and directory paths when typing paths
#### Essential Keybindings:
**File operations:**
```
<leader>e # Toggle file explorer (nvim-tree)
<leader>w # Save current file
<leader>q # Quit current buffer
<leader>o # Open file with system default app
<leader>f # Show current file in Finder
```
**System clipboard:**
```
<leader>y # Copy selection to system clipboard
<leader>p # Paste from system clipboard
```
**Git operations:**
```
<leader>gs # Git status
<leader>gd # Git diff
<leader>gc # Git commit
<leader>gp # Git push
```
**Note**: Leader key is set to spacebar. Basic auto-completion provides word suggestions from open files and path completion without requiring language server setup.
### 🌟 File Synchronization & Backup ### 🌟 File Synchronization & Backup
**Tool**: rsync **Tool**: rsync

View file

@ -86,6 +86,27 @@
render-markdown = { render-markdown = {
enable = true; enable = true;
}; };
# Basic auto-completion
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "buffer"; } # Words from open buffers
{ name = "path"; } # File system paths
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()"; # Trigger completion manually
"<C-e>" = "cmp.mapping.close()"; # Close completion menu
"<CR>" = "cmp.mapping.confirm({ select = true })"; # Accept selected completion
"<Tab>" = "cmp.mapping.select_next_item()"; # Navigate down in menu
"<S-Tab>" = "cmp.mapping.select_prev_item()"; # Navigate up in menu
};
};
};
}; };
# Extra plugins that don't have dedicated modules # Extra plugins that don't have dedicated modules