add telescope-tabs
This commit is contained in:
parent
c43275442a
commit
82c7db6494
@ -45,6 +45,14 @@ key('n', '<leader>tD', function()
|
||||
require('lupan.ui').tab_change_dir_newtab()
|
||||
end, { desc = '[T]ab change [D]irectory (new tab)' })
|
||||
|
||||
key('n', '<leader>tm', function()
|
||||
require('telescope-tabs').list_tabs(require 'telescope.themes'.get_dropdown())
|
||||
end, { desc = '[T]ab change [D]irectory (new tab)' })
|
||||
|
||||
key('n', '<leader>tt', function()
|
||||
require('telescope-tabs').go_to_previous()
|
||||
end, { desc = '[T]ab [t]oggle previous' })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
key('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||
key('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
|
14
nvim/.config/nvim/lua/plugins/telescope-tabs.lua
Normal file
14
nvim/.config/nvim/lua/plugins/telescope-tabs.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
dependencies = { 'nvim-telescope/telescope.nvim' },
|
||||
lazy = true,
|
||||
config = function()
|
||||
require 'telescope-tabs'.setup {
|
||||
entry_formatter = function(tab_id, buffer_ids, file_names, file_paths, is_current)
|
||||
local cwd = vim.fn.getcwd(-1, tab_id)
|
||||
local entry_string = table.concat(file_names, ', ')
|
||||
return string.format('%d: %s %s%s', tab_id, cwd, entry_string, is_current and ' <' or '')
|
||||
end,
|
||||
}
|
||||
end
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user