diff --git a/README.md b/README.md index 86aefba..1076807 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,63 @@ Launch with `lazygit` in any git repository for: - File tree navigation with git status - 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:** +``` +e # Toggle file explorer (nvim-tree) +w # Save current file +q # Quit current buffer +o # Open file with system default app +f # Show current file in Finder +``` + +**System clipboard:** +``` +y # Copy selection to system clipboard +p # Paste from system clipboard +``` + +**Git operations:** +``` +gs # Git status +gd # Git diff +gc # Git commit +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 **Tool**: rsync diff --git a/modules/nvim.nix b/modules/nvim.nix index 5c18a38..6b1c64c 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -86,6 +86,27 @@ render-markdown = { enable = true; }; + + # Basic auto-completion + cmp = { + enable = true; + autoEnableSources = true; + + settings = { + sources = [ + { name = "buffer"; } # Words from open buffers + { name = "path"; } # File system paths + ]; + + mapping = { + "" = "cmp.mapping.complete()"; # Trigger completion manually + "" = "cmp.mapping.close()"; # Close completion menu + "" = "cmp.mapping.confirm({ select = true })"; # Accept selected completion + "" = "cmp.mapping.select_next_item()"; # Navigate down in menu + "" = "cmp.mapping.select_prev_item()"; # Navigate up in menu + }; + }; + }; }; # Extra plugins that don't have dedicated modules