diff --git a/flake.lock b/flake.lock index 9ef5216..d7e165b 100644 --- a/flake.lock +++ b/flake.lock @@ -1060,6 +1060,7 @@ "sqls-nvim": "sqls-nvim", "telescope": "telescope", "telescope-media-files": "telescope-media-files", + "telescope-tabs": "telescope-tabs", "todo-comments": "todo-comments", "tokyonight": "tokyonight", "tree-sitter-scala": "tree-sitter-scala", @@ -1179,6 +1180,22 @@ "type": "github" } }, + "telescope-tabs": { + "flake": false, + "locked": { + "lastModified": 1703422660, + "narHash": "sha256-lEa7RMzqzGWOFC5mzT7J+HMYmYw12Xym+QhP7HXd2wY=", + "owner": "FabianWirth", + "repo": "search.nvim", + "rev": "860f7673744e139d00d416d11552533835bfdd2d", + "type": "github" + }, + "original": { + "owner": "FabianWirth", + "repo": "search.nvim", + "type": "github" + } + }, "todo-comments": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index af78c8c..c2c68dd 100644 --- a/flake.nix +++ b/flake.nix @@ -138,6 +138,11 @@ flake = false; }; + telescope-tabs = { + url = github:FabianWirth/search.nvim; + flake = false; + }; + # Filetrees nvim-tree-lua = { url = github:nvim-tree/nvim-tree.lua; diff --git a/lib/ide.nix b/lib/ide.nix index a998e7e..b77a5b7 100644 --- a/lib/ide.nix +++ b/lib/ide.nix @@ -98,6 +98,7 @@ let }; telescope = { enable = true; + tabs.enable = true; # NOTE: still quite buggy in some terminals mediaFiles.enable = false; }; diff --git a/modules/keys/shortcuts.nix b/modules/keys/shortcuts.nix index 92d2167..fb27ec5 100644 --- a/modules/keys/shortcuts.nix +++ b/modules/keys/shortcuts.nix @@ -40,6 +40,9 @@ in "" = "<"; ">" = ">"; } + // (withAttrSet config.vim.telescope.tabs.enable { + "" = ":lua require('search').open()"; + }) // (withAttrSet config.vim.lsp.enable { "K" = "lua vim.lsp.buf.hover()"; }) diff --git a/modules/telescope/default.nix b/modules/telescope/default.nix index fa25bf2..7ce4699 100644 --- a/modules/telescope/default.nix +++ b/modules/telescope/default.nix @@ -13,12 +13,17 @@ in mediaFiles = { enable = mkEnableOption "enable telescope-media-files extension"; }; + + tabs = { + enable = mkEnableOption "enable search.nvim (enhances telescope with tab-based search)"; + }; }; config = mkIf cfg.enable { vim.startPlugins = with pkgs.neovimPlugins; [ telescope ] ++ - (withPlugins cfg.mediaFiles.enable [ telescope-media-files ]); + (withPlugins cfg.mediaFiles.enable [ telescope-media-files ]) ++ + (withPlugins cfg.tabs.enable [ telescope-tabs ]); vim.nnoremap = {