From c426c372cce66849b959df9ce5ac3b0808880b31 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Wed, 15 Apr 2026 14:54:53 +0530 Subject: added telescope plugin to neovim --- modules/tools/nixvim/plugins/default.nix | 1 + modules/tools/nixvim/plugins/telescope.nix | 81 ++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 modules/tools/nixvim/plugins/telescope.nix (limited to 'modules/tools') diff --git a/modules/tools/nixvim/plugins/default.nix b/modules/tools/nixvim/plugins/default.nix index 7b5a487..300afe0 100644 --- a/modules/tools/nixvim/plugins/default.nix +++ b/modules/tools/nixvim/plugins/default.nix @@ -13,6 +13,7 @@ ./noice.nix ./notify.nix ./nvim-tree.nix + ./telescope.nix ./treesitter.nix ./web-devicons.nix ./which-key.nix diff --git a/modules/tools/nixvim/plugins/telescope.nix b/modules/tools/nixvim/plugins/telescope.nix new file mode 100644 index 0000000..8c35a55 --- /dev/null +++ b/modules/tools/nixvim/plugins/telescope.nix @@ -0,0 +1,81 @@ +{ config, lib, ... }: + +# Telescope - Fuzzy finder +{ + config.programs.nixvim.plugins.telescope = lib.mkIf config.tools.nixvim.enable { + enable = true; + extensions = { + fzf-native.enable = true; # faster fuzzy sorting + ui-select.enable = true; # use telescope for vim.ui.select (code actions etc.) + }; + settings = { + defaults = { + layout_strategy = "horizontal"; + layout_config = { + horizontal = { + preview_width = 0.55; + results_width = 0.45; + }; + width = 0.87; + height = 0.80; + }; + mappings = { + i = { + "".__raw = "require('telescope.actions').move_selection_previous"; + "".__raw = "require('telescope.actions').move_selection_next"; + "".__raw = "require('telescope.actions').close"; + }; + }; + }; + }; + keymaps = { + # Files + "ff" = { + action = "find_files"; + options.desc = "Find files"; + }; + "fg" = { + action = "live_grep"; + options.desc = "Live grep"; + }; + "fb" = { + action = "buffers"; + options.desc = "Find buffers"; + }; + "fr" = { + action = "oldfiles"; + options.desc = "Recent files"; + }; + + # LSP + "fd" = { + action = "diagnostics"; + options.desc = "Diagnostics"; + }; + "fs" = { + action = "lsp_document_symbols"; + options.desc = "Document symbols"; + }; + + # Git + "gc" = { + action = "git_commits"; + options.desc = "Git commits"; + }; + "gb" = { + action = "git_branches"; + options.desc = "Git branches"; + }; + + # Misc + "fh" = { + action = "help_tags"; + options.desc = "Help tags"; + }; + "fc" = { + action = "commands"; + options.desc = "Commands"; + }; + }; + }; +} -- cgit v1.2.3