diff --git a/README.md b/README.md index 1ca8892..923ddfa 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ blog = { #### Key Features: - **File Explorer**: nvim-tree with dotfile filtering +- **Fuzzy Finder**: Telescope for fast file finding, text search, and navigation - **Syntax Highlighting**: Treesitter with comprehensive language support - **Git Integration**: vim-fugitive for git operations - **Status Line**: lualine with gruvbox theme and relative paths @@ -221,12 +222,28 @@ blog = { | `y` | Copy to system clipboard | | `p` | Paste from system clipboard | +**Fuzzy Finding (Telescope):** +| Key | Action | +|-----|--------| +| `ff` | Find files in current directory | +| `fg` | Live grep - search text in all files | +| `fb` | Browse open buffers | +| `fh` | Search help documentation | + +**Telescope Navigation:** +| Key | Action | +|-----|--------| +| `/` | Navigate up/down in results | +| `` | Open selected file | +| `` | Send results to quickfix list | +| `` | Close Telescope | + **Git Operations:** | Key | Action | |-----|--------| | `gs` | Git status | | `gd` | Git diff | -| `gc` | Git commit | +| `gc` | Git commit (vim-fugitive) | | `gp` | Git push | **Other:** diff --git a/modules/nvim.nix b/modules/nvim.nix index 31ee7aa..1ffdf28 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -110,12 +110,42 @@ }; }; }; + + # Telescope - Fuzzy finder + telescope = { + enable = true; + keymaps = { + # Find files using Telescope command-line sugar + "ff" = "find_files"; + "fg" = "live_grep"; + "fb" = "buffers"; + "fh" = "help_tags"; + }; + settings = { + defaults = { + file_ignore_patterns = [ + "^.git/" + "^node_modules/" + "^target/" + "^dist/" + ".DS_Store" + ]; + layout_config = { + prompt_position = "bottom"; + horizontal = { + preview_width = 0.55; + }; + }; + }; + }; + }; }; # Extra plugins that don't have dedicated modules extraPlugins = with pkgs.vimPlugins; [ vim-fugitive cmp-dictionary + plenary-nvim # Required dependency for telescope ]; # Keymaps @@ -225,6 +255,22 @@ first_case_insensitive = true, -- Case insensitive matching }) + -- Telescope setup for better file finding + local telescope = require('telescope') + local actions = require('telescope.actions') + + telescope.setup{ + defaults = { + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + } + } + } + } + -- Unicode-safe file operations for macOS function open_file_with_system_app() local filepath = vim.fn.expand('%:p')