feat: add telescope nvim plugin
This commit is contained in:
parent
3848aad76e
commit
0aa7964934
3 changed files with 55 additions and 1 deletions
|
@ -128,6 +128,11 @@ in
|
||||||
type = "lua";
|
type = "lua";
|
||||||
config = ( builtins.readFile ./files/treesitter.lua);
|
config = ( builtins.readFile ./files/treesitter.lua);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
plugin = telescope-nvim;
|
||||||
|
type = "lua";
|
||||||
|
config = ( builtins.readFile ./files/telescope.lua );
|
||||||
|
}
|
||||||
{
|
{
|
||||||
plugin = nvim-treesitter-context;
|
plugin = nvim-treesitter-context;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
|
|
|
@ -12,7 +12,7 @@ neotree.setup({
|
||||||
})
|
})
|
||||||
vim.api.nvim_set_keymap(
|
vim.api.nvim_set_keymap(
|
||||||
'n',
|
'n',
|
||||||
'<leader>fm',
|
'<leader>nt',
|
||||||
':Neotree toggle<CR>',
|
':Neotree toggle<CR>',
|
||||||
{ table.unpack(opts), desc = 'Toggle NeoTree' }
|
{ table.unpack(opts), desc = 'Toggle NeoTree' }
|
||||||
)
|
)
|
||||||
|
|
49
modules/home-manager/cli/neovim/files/telescope.lua
Normal file
49
modules/home-manager/cli/neovim/files/telescope.lua
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
require('telescope').setup{
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
-- map actions.which_key to <C-h> (default: <C-/>)
|
||||||
|
-- actions.which_key shows the mappings for your picker,
|
||||||
|
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||||
|
["<C-h>"] = "which_key"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
-- Default configuration for builtin pickers goes here:
|
||||||
|
-- picker_name = {
|
||||||
|
-- picker_config_key = value,
|
||||||
|
-- ...
|
||||||
|
-- }
|
||||||
|
-- Now the picker_config_key will be applied every time you call this
|
||||||
|
-- builtin picker
|
||||||
|
find_files = {
|
||||||
|
theme = "dropdown",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
-- Your extension configuration goes here:
|
||||||
|
-- extension_name = {
|
||||||
|
-- extension_config_key = value,
|
||||||
|
-- }
|
||||||
|
-- please take a look at the readme of the extension you want to configure
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Define keybinging for Telescope
|
||||||
|
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {
|
||||||
|
table.unpack(opts), desc = 'Telescope: find files'
|
||||||
|
})
|
||||||
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, {
|
||||||
|
table.unpack(opts), desc = 'Telescope: find Nvim buffers'
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Git actions
|
||||||
|
vim.keymap.set('n', '<leader>fgf', builtin.git_files, {
|
||||||
|
table.unpack(opts), desc = 'Telescope: find Git files'
|
||||||
|
})
|
||||||
|
vim.keymap.set('n', '<leader>fgc', builtin.git_commits, {
|
||||||
|
table.unpack(opts), desc = 'Telescope: find Git commits'
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue