From 0df12a6506bacc7afb709df7443bf31bcc3d84ed Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 14 Jul 2024 16:30:50 +0300 Subject: [PATCH] Neovim: tweaked neotree a bit, might remove it in favor of oil.nvim --- .config/nvim/lua/custom/plugins/neotree.lua | 25 ++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/custom/plugins/neotree.lua b/.config/nvim/lua/custom/plugins/neotree.lua index 661ab40..72f8b36 100644 --- a/.config/nvim/lua/custom/plugins/neotree.lua +++ b/.config/nvim/lua/custom/plugins/neotree.lua @@ -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', 'nt', 'Neotree toggle reveal left', { desc = '[N]eotree [T]oggle' }) end, }