diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 0d607f9..9ed01ad 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -150,3 +150,9 @@ configuration formats. - `nvf-print-config-path` will display the path to _a clone_ of your `init.lua`. This is not the path used by the Neovim wrapper, but an identical clone. + +[ppenguin](https://github.com/ppenguin): + +- Telescope: + - Fixed `project-nvim` command and keybinding + - Added default ikeybind/command for `Telescope resume` (`fr`) diff --git a/modules/plugins/utility/telescope/config.nix b/modules/plugins/utility/telescope/config.nix index 2ec7d3d..68af964 100644 --- a/modules/plugins/utility/telescope/config.nix +++ b/modules/plugins/utility/telescope/config.nix @@ -17,75 +17,78 @@ mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { config = mkIf cfg.enable { - vim.startPlugins = [ - "telescope" - "plenary-nvim" - ]; + vim = { + startPlugins = [ + "telescope" + "plenary-nvim" + ]; - vim.maps.normal = mkMerge [ - (mkSetBinding mappings.findFiles " Telescope find_files") - (mkSetBinding mappings.liveGrep " Telescope live_grep") - (mkSetBinding mappings.buffers " Telescope buffers") - (mkSetBinding mappings.helpTags " Telescope help_tags") - (mkSetBinding mappings.open " Telescope") + maps.normal = mkMerge [ + (mkSetBinding mappings.findFiles " Telescope find_files") + (mkSetBinding mappings.liveGrep " Telescope live_grep") + (mkSetBinding mappings.buffers " Telescope buffers") + (mkSetBinding mappings.helpTags " Telescope help_tags") + (mkSetBinding mappings.open " Telescope") + (mkSetBinding mappings.resume " Telescope resume") - (mkSetBinding mappings.gitCommits " Telescope git_commits") - (mkSetBinding mappings.gitBufferCommits " Telescope git_bcommits") - (mkSetBinding mappings.gitBranches " Telescope git_branches") - (mkSetBinding mappings.gitStatus " Telescope git_status") - (mkSetBinding mappings.gitStash " Telescope git_stash") + (mkSetBinding mappings.gitCommits " Telescope git_commits") + (mkSetBinding mappings.gitBufferCommits " Telescope git_bcommits") + (mkSetBinding mappings.gitBranches " Telescope git_branches") + (mkSetBinding mappings.gitStatus " Telescope git_status") + (mkSetBinding mappings.gitStash " Telescope git_stash") - (mkIf config.vim.lsp.enable (mkMerge [ - (mkSetBinding mappings.lspDocumentSymbols " Telescope lsp_document_symbols") - (mkSetBinding mappings.lspWorkspaceSymbols " Telescope lsp_workspace_symbols") + (mkIf config.vim.lsp.enable (mkMerge [ + (mkSetBinding mappings.lspDocumentSymbols " Telescope lsp_document_symbols") + (mkSetBinding mappings.lspWorkspaceSymbols " Telescope lsp_workspace_symbols") - (mkSetBinding mappings.lspReferences " Telescope lsp_references") - (mkSetBinding mappings.lspImplementations " Telescope lsp_implementations") - (mkSetBinding mappings.lspDefinitions " Telescope lsp_definitions") - (mkSetBinding mappings.lspTypeDefinitions " Telescope lsp_type_definitions") - (mkSetBinding mappings.diagnostics " Telescope diagnostics") - ])) + (mkSetBinding mappings.lspReferences " Telescope lsp_references") + (mkSetBinding mappings.lspImplementations " Telescope lsp_implementations") + (mkSetBinding mappings.lspDefinitions " Telescope lsp_definitions") + (mkSetBinding mappings.lspTypeDefinitions " Telescope lsp_type_definitions") + (mkSetBinding mappings.diagnostics " Telescope diagnostics") + ])) - ( - mkIf config.vim.treesitter.enable - (mkSetBinding mappings.treesitter " Telescope treesitter") - ) + ( + mkIf config.vim.treesitter.enable + (mkSetBinding mappings.treesitter " Telescope treesitter") + ) - ( - mkIf config.vim.projects.project-nvim.enable - (mkSetBinding mappings.findProjects "") - ) - ]; + ( + mkIf config.vim.projects.project-nvim.enable + (mkSetBinding mappings.findProjects " Telescope projects") + ) + ]; - vim.binds.whichKey.register = pushDownDefault { - "f" = "+Telescope"; - "fl" = "Telescope LSP"; - "fm" = "Cellular Automaton"; - "fv" = "Telescope Git"; - "fvc" = "Commits"; + binds.whichKey.register = pushDownDefault { + "f" = "+Telescope"; + "fl" = "Telescope LSP"; + "fm" = "Cellular Automaton"; + "fv" = "Telescope Git"; + "fvc" = "Commits"; + }; + + pluginRC.telescope = entryAnywhere '' + local telescope = require('telescope') + telescope.setup(${toLuaObject cfg.setupOpts}) + + ${ + if config.vim.ui.noice.enable + then "telescope.load_extension('noice')" + else "" + } + + ${ + if config.vim.notify.nvim-notify.enable + then "telescope.load_extension('notify')" + else "" + } + + ${ + if config.vim.projects.project-nvim.enable + then "telescope.load_extension('projects')" + else "" + } + ''; }; - - vim.pluginRC.telescope = entryAnywhere '' - local telescope = require('telescope') - telescope.setup(${toLuaObject cfg.setupOpts}) - - ${ - if config.vim.ui.noice.enable - then "telescope.load_extension('noice')" - else "" - } - - ${ - if config.vim.notify.nvim-notify.enable - then "telescope.load_extension('notify')" - else "" - } - - ${ - if config.vim.projects.project-nvim.enable - then "telescope.load_extension('projects')" - else "" - } - ''; }; } diff --git a/modules/plugins/utility/telescope/telescope.nix b/modules/plugins/utility/telescope/telescope.nix index bebe6c8..031f00d 100644 --- a/modules/plugins/utility/telescope/telescope.nix +++ b/modules/plugins/utility/telescope/telescope.nix @@ -150,13 +150,13 @@ in { options.vim.telescope = { mappings = { - findProjects = mkMappingOption "Find files [Telescope]" "fp"; - + findProjects = mkMappingOption "Find projects [Telescope]" "fp"; findFiles = mkMappingOption "Find files [Telescope]" "ff"; liveGrep = mkMappingOption "Live grep [Telescope]" "fg"; buffers = mkMappingOption "Buffers [Telescope]" "fb"; helpTags = mkMappingOption "Help tags [Telescope]" "fh"; open = mkMappingOption "Open [Telescope]" "ft"; + resume = mkMappingOption "Resume (previous search) [Telescope]" "fr"; gitCommits = mkMappingOption "Git commits [Telescope]" "fvcw"; gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "fvcb";