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