Neovim: tweaked neotree a bit, might remove it in favor of oil.nvim

This commit is contained in:
Kyren223
2024-07-14 16:30:50 +03:00
parent a2d25579a0
commit 0df12a6506

View File

@@ -1,3 +1,6 @@
-- TODO: Consider removing neotree
-- Not really using it due to oil.nvim, but maybe it's still
-- useful to have a tree-structure file explorer?
return {
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
@@ -6,10 +9,26 @@ return {
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
opts = {
open_files_do_not_replace_types = { 'terminal', 'Trouble', 'qf', 'edgy' },
},
config = function()
require('neo-tree').setup({
open_files_do_not_replace_types = { 'terminal', 'Trouble', 'qf', 'edgy' },
window = {
mappings = {
['e'] = function()
---@diagnostic disable-next-line: deprecated
vim.api.nvim_exec('Neotree focus filesystem left', true)
end,
['b'] = function()
---@diagnostic disable-next-line: deprecated
vim.api.nvim_exec('Neotree focus buffers left', true)
end,
['g'] = function()
---@diagnostic disable-next-line: deprecated
vim.api.nvim_exec('Neotree focus git_status left', true)
end,
},
},
})
vim.keymap.set('n', '<leader>nt', '<cmd>Neotree toggle reveal left<cr>', { desc = '[N]eotree [T]oggle' })
end,
}