Skip to content

Commit

Permalink
telescope: add tab-based search support
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Jan 29, 2024
1 parent 400285c commit aaa459b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/ide.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ let
};
telescope = {
enable = true;
tabs.enable = true;
# NOTE: still quite buggy in some terminals
mediaFiles.enable = false;
};
Expand Down
3 changes: 3 additions & 0 deletions modules/keys/shortcuts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ in
"<M-<>" = "<C-w><";
"<M->>" = "<C-w>>";
}
// (withAttrSet config.vim.telescope.tabs.enable {
"<C-p>" = ":lua require('search').open()<CR>";
})
// (withAttrSet config.vim.lsp.enable {
"K" = "<cmd>lua vim.lsp.buf.hover()<CR>";
})
Expand Down
7 changes: 6 additions & 1 deletion modules/telescope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
{
Expand Down

0 comments on commit aaa459b

Please sign in to comment.