From 9ad2084b16f6c02180771fb3ae6f120cadf7993e Mon Sep 17 00:00:00 2001 From: ap8351 Date: Fri, 12 Apr 2024 07:57:53 +0200 Subject: [PATCH] update config --- init.lua | 7 +++++-- lua/custom/plugins/barbar.lua | 2 +- lua/custom/plugins/filetree.lua | 12 ------------ lua/custom/plugins/neotree.lua | 21 +++++++++++++++++++++ 4 files changed, 27 insertions(+), 15 deletions(-) delete mode 100644 lua/custom/plugins/filetree.lua create mode 100644 lua/custom/plugins/neotree.lua diff --git a/init.lua b/init.lua index d513ed91..abf960c3 100644 --- a/init.lua +++ b/init.lua @@ -377,14 +377,17 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- Toggleterm Plugin + vim.keymap.set('n', 't', 'ToggleTerm direction="float"', { desc = '[T]oggle [T]erminal' }) vim.keymap.set('n', 'tt', 'ToggleTerm direction="float"', { desc = '[T]oggle [T]erminal' }) -- Barbar Plugin vim.keymap.set('n', 'tn', 'BufferNext', { desc = '[N]ext Tab' }) vim.keymap.set('n', 'tp', 'BufferPrevious', { desc = '[P]revious Tab' }) + vim.keymap.set('n', '', 'BufferClose') + vim.keymap.set('n', '', 'BufferPick') -- Neotree: - vim.keymap.set('n', 'e', 'Neotree toggle') - vim.keymap.set('n', 'er', 'Neotree reveal') + vim.keymap.set('n', 'nt', 'Neotree toggle', { desc = '[N]eo[t]ree toggle' }) + vim.keymap.set('n', 'ntr', 'Neotree reveal', { desc = 'N[E]eo[t]ree toggle cu[r]rent' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. diff --git a/lua/custom/plugins/barbar.lua b/lua/custom/plugins/barbar.lua index 8ed38c8a..52879228 100644 --- a/lua/custom/plugins/barbar.lua +++ b/lua/custom/plugins/barbar.lua @@ -10,7 +10,7 @@ return { end, opts = { -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: - -- animation = true, + animation = true, -- insert_at_start = true, -- …etc. }, diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua deleted file mode 100644 index 592e04a2..00000000 --- a/lua/custom/plugins/filetree.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - config = function() - require('neo-tree').setup {} - end, -} diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua new file mode 100644 index 00000000..67465174 --- /dev/null +++ b/lua/custom/plugins/neotree.lua @@ -0,0 +1,21 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + config = function() + require('neo-tree').setup { + + filesystem = { + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + }, + } + end, +}