copilot etc improved
This commit is contained in:
parent
a0a7fd074c
commit
e2a2e1adaf
|
|
@ -6,15 +6,15 @@ return {
|
||||||
'copilotlsp-nvim/copilot-lsp',
|
'copilotlsp-nvim/copilot-lsp',
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
nes = {
|
-- nes = {
|
||||||
enabled = true,
|
-- enabled = true,
|
||||||
keymap = {
|
-- keymap = {
|
||||||
accept_and_goto = '<leader>p',
|
-- accept_and_goto = '<C-y>',
|
||||||
accept = false,
|
-- accept = false,
|
||||||
dismiss = '<Esc>',
|
-- dismiss = '<Esc>',
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
suggestion = { enabled = false },
|
suggestion = { enabled = true },
|
||||||
panel = { enabled = false },
|
panel = { enabled = false },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ local function telescope_lsp(picker, fallback, picker_opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
map('n', 'gr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = 'LSP: references (telescope)' })
|
map('n', 'grr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = 'LSP: references (telescope)' })
|
||||||
map('n', 'gi', telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), { desc = 'LSP: implementations (telescope)' })
|
map('n', 'gi', telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), { desc = 'LSP: implementations (telescope)' })
|
||||||
map('n', 'gt', telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), { desc = 'LSP: type definitions (telescope)' })
|
map('n', 'gt', telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), { desc = 'LSP: type definitions (telescope)' })
|
||||||
map('n', 'gO', telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), { desc = 'LSP: document symbols (telescope)' })
|
map('n', 'gO', telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), { desc = 'LSP: document symbols (telescope)' })
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
-- Neo-tree is a Neovim plugin to browse the file system
|
-- Neo-tree is a Neovim plugin to browse the file system
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
version = '*',
|
version = '*',
|
||||||
|
|
@ -21,5 +20,37 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- your config here
|
||||||
|
event_handlers = {
|
||||||
|
-- save layout before opening neotree
|
||||||
|
{
|
||||||
|
event = 'neo_tree_window_before_open',
|
||||||
|
handler = function()
|
||||||
|
-- vim.cmd("set noequalalways")
|
||||||
|
local layout = {}
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
layout[win] = {
|
||||||
|
height = vim.api.nvim_win_get_height(win),
|
||||||
|
width = vim.api.nvim_win_get_width(win),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
vim._neotree_layout = layout
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- restore layout after closing neotree
|
||||||
|
{
|
||||||
|
event = 'neo_tree_window_after_close',
|
||||||
|
handler = function()
|
||||||
|
if vim._neotree_layout then
|
||||||
|
for win, dims in pairs(vim._neotree_layout) do
|
||||||
|
if vim.api.nvim_win_is_valid(win) then
|
||||||
|
pcall(vim.api.nvim_win_set_height, win, dims.height)
|
||||||
|
pcall(vim.api.nvim_win_set_width, win, dims.width)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue