Also move away from using the telescope builtin grep for word under cursor mapping by extending the `:Rg` command to work in the following circumstances: * `:Rg text to search for` * `:Rg` word under cursor * `'<,'>Rg` visual selection
48 lines
1.4 KiB
Lua
48 lines
1.4 KiB
Lua
return {
|
|
'nvim-telescope/telescope.nvim',
|
|
dependencies = {
|
|
'nvim-lua/plenary.nvim',
|
|
'nvim-telescope/telescope-fzy-native.nvim',
|
|
'nvim-tree/nvim-web-devicons',
|
|
'axkirillov/easypick.nvim',
|
|
'benfowler/telescope-luasnip.nvim',
|
|
},
|
|
config = function()
|
|
local telescope = require('telescope')
|
|
telescope.setup({
|
|
defaults = {
|
|
mappings = {
|
|
i = {
|
|
['<C-s>'] = 'select_horizontal',
|
|
['<C-h>'] = 'preview_scrolling_left',
|
|
['<C-l>'] = 'preview_scrolling_right',
|
|
},
|
|
n = {
|
|
['<C-s>'] = 'select_horizontal',
|
|
['<C-h>'] = 'preview_scrolling_left',
|
|
['<C-l>'] = 'preview_scrolling_right',
|
|
}
|
|
},
|
|
layout_config = {
|
|
height = 0.7,
|
|
}
|
|
},
|
|
})
|
|
telescope.load_extension('fzy_native')
|
|
telescope.load_extension('luasnip')
|
|
|
|
local builtin = require('telescope.builtin')
|
|
local opts = { noremap = true }
|
|
vim.keymap.set('n', '<leader>gF', builtin.find_files, opts)
|
|
vim.keymap.set('n', '<leader>gf', builtin.git_files, opts)
|
|
vim.keymap.set('n', '<leader>gg', builtin.live_grep, opts)
|
|
vim.keymap.set('n', '<leader>gb', builtin.buffers, opts)
|
|
vim.keymap.set('n', '<leader>gh', builtin.help_tags, opts)
|
|
vim.keymap.set('n', '<leader>bl', builtin.current_buffer_fuzzy_find, opts)
|
|
|
|
require('easypick').setup({
|
|
pickers = { },
|
|
})
|
|
end
|
|
}
|