add some default picker settings
This commit is contained in:
@@ -131,10 +131,16 @@ keymap.set(
|
|||||||
)
|
)
|
||||||
keymap.set(
|
keymap.set(
|
||||||
'n',
|
'n',
|
||||||
'<leader>bb',
|
'<leader>fb',
|
||||||
'<cmd>Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
|
'<cmd>Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true<cr>',
|
||||||
opts('Select from open buffers')
|
opts('Select from open buffers')
|
||||||
)
|
)
|
||||||
|
keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>fn',
|
||||||
|
'<cmd>Telescope find_files cwd=' .. vim.fn.stdpath('config') .. '<cr>',
|
||||||
|
opts('Edit nvim config')
|
||||||
|
)
|
||||||
|
|
||||||
-- ────────────────────────────────────────────────────( substitute )─
|
-- ────────────────────────────────────────────────────( substitute )─
|
||||||
keymap.set('n', 's', function()
|
keymap.set('n', 's', function()
|
||||||
@@ -237,4 +243,4 @@ keymap.set('i', '<C-s>', function()
|
|||||||
else
|
else
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
end
|
end
|
||||||
end, opts('Toggle spell check'))
|
end, opts('Toggle spell check'))
|
||||||
|
|||||||
@@ -1,45 +1,57 @@
|
|||||||
return {
|
return {
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
branch = '0.1.x',
|
branch = '0.1.x',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
'folke/todo-comments.nvim',
|
'folke/todo-comments.nvim',
|
||||||
},
|
},
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
config = function()
|
config = function()
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
local actions = require('telescope.actions')
|
local actions = require('telescope.actions')
|
||||||
local transform_mod = require('telescope.actions.mt').transform_mod
|
local transform_mod = require('telescope.actions.mt').transform_mod
|
||||||
local trouble = require('trouble')
|
local trouble = require('trouble')
|
||||||
local trouble_telescope = require('trouble.sources.telescope')
|
local trouble_telescope = require('trouble.sources.telescope')
|
||||||
|
|
||||||
local custom_actions = transform_mod({
|
local custom_actions = transform_mod({
|
||||||
open_trouble_qflist = function(prompt_bufnr)
|
open_trouble_qflist = function(prompt_bufnr)
|
||||||
trouble.toggle('quickfix')
|
trouble.toggle('quickfix')
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
path_display = { 'smart' },
|
path_display = { 'smart' },
|
||||||
mappings = {
|
mappings = {
|
||||||
n = {
|
n = {
|
||||||
['x'] = actions.delete_buffer,
|
['x'] = actions.delete_buffer,
|
||||||
['q'] = actions.close,
|
['q'] = actions.close,
|
||||||
},
|
},
|
||||||
i = {
|
i = {
|
||||||
['<C-k>'] = actions.move_selection_previous,
|
['<C-k>'] = actions.move_selection_previous,
|
||||||
['<C-j>'] = actions.move_selection_next,
|
['<C-j>'] = actions.move_selection_next,
|
||||||
['<C-q>'] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
|
['<C-q>'] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
|
||||||
['<C-t>'] = trouble_telescope.open,
|
['<C-t>'] = trouble_telescope.open,
|
||||||
['<ESC>'] = actions.close,
|
['<ESC>'] = actions.close,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
pickers = {
|
||||||
|
buffers = {
|
||||||
telescope.load_extension('fzf')
|
theme = 'dropdown',
|
||||||
end,
|
sort_mru = true,
|
||||||
}
|
sort_lastused = true,
|
||||||
|
show_all_buffers = true,
|
||||||
|
},
|
||||||
|
help_tags = {
|
||||||
|
theme = 'ivy',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
'fzf',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user