From 44f3b93498db4bee40247073c830085bbe154037 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 28 Mar 2024 00:32:16 +0100 Subject: [PATCH] swapped neotree with nvimtree --- lua/keymap.lua | 2 +- lua/plugins/cokeline.lua | 24 ++++++------- lua/plugins/neotree.lua | 74 --------------------------------------- lua/plugins/nvim-tree.lua | 40 +++++++++++++++++++++ 4 files changed, 53 insertions(+), 87 deletions(-) delete mode 100644 lua/plugins/neotree.lua create mode 100644 lua/plugins/nvim-tree.lua diff --git a/lua/keymap.lua b/lua/keymap.lua index a5d7ce2..e215ce4 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -54,7 +54,7 @@ return { { 'n' }, '', 'wincmd l', { desc = "Window Right" } }, { - { 'n', 'i' }, '', 'Neotree toggle', { desc = "Toggle Neotree" } + { 'n', 'i' }, '', 'NvimTreeToggle', { desc = "Toggle Neotree" } }, { { 'n' }, ':', 'Telescope cmdline', { noremap = true, desc = "Open Cmdline" } diff --git a/lua/plugins/cokeline.lua b/lua/plugins/cokeline.lua index ba32ea7..829b277 100644 --- a/lua/plugins/cokeline.lua +++ b/lua/plugins/cokeline.lua @@ -7,7 +7,7 @@ return { "nvim-tree/nvim-web-devicons" }, opts = { - fill_hl = "NeoTreeTabInactive", + fill_hl = "NvimTreeNormal", show_if_buffers_are_at_least = 1, buffers = { focus_on_delete = "next", @@ -22,13 +22,13 @@ return { if buffer.is_focused then return "BufferCurrent" end - return "NeoTreeTabInactive" + return "NvimTreeNormal" end, fg = function(buffer) if buffer.is_focused then return "BufferCurrent" end - return "NeoTreeTabInactive" + return "NvimTreeNormal" end, }, components = { @@ -60,7 +60,7 @@ return { return "DiagnosticHint" end else - return 'NeoTreeTabInactive' + return 'NvimTreeNormal' end end }, @@ -85,7 +85,7 @@ return { end, fg = function (buffer) if not buffer.is_focused then - return 'NeoTreeTabInactive' + return 'NvimTreeNormal' end return "DiagnosticWarn" end @@ -100,7 +100,7 @@ return { end, fg = function (buffer) if not buffer.is_focused then - return 'NeoTreeTabInactive' + return 'NvimTreeNormal' end return "DiagnosticInfo" end @@ -115,7 +115,7 @@ return { end, fg = function (buffer) if not buffer.is_focused then - return 'NeoTreeTabInactive' + return 'NvimTreeNormal' end return "DiagnosticHint" end @@ -150,13 +150,13 @@ return { if tabpage.is_active then return "lualine_a_command" end - return "NeoTreeTabInactive" + return "NvimTreeNormal" end, fg = function(tabpage) if tabpage.is_active then return "lualine_a_command" end - return "NeoTreeTabInactive" + return "NvimTreeNormal" end }, { @@ -192,13 +192,13 @@ return { }, sidebar = { filetype = { - 'neo-tree' + 'NvimTree' }, components = { { text = '', - fg = "NeoTreeTabInactive", - bg = "NeoTreeTabInactive" + fg = "NvimTreeNormal", + bg = "NvimTreeNormal" } } } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua deleted file mode 100644 index 921800b..0000000 --- a/lua/plugins/neotree.lua +++ /dev/null @@ -1,74 +0,0 @@ -return { - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim" - }, - opts = function(_,_) - local options = require("options") - - return { - close_if_last_window = true, - popup_border_style = options.ui.border, - default_component_configs = { - container = { - enable_character_fade = true - }, - indent = { - indent_size = 2, - padding = 1, -- extra padding on left hand side - -- indent guides - with_markers = false, - with_expanders = true, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - modified = { - symbol = "", - }, - git_status = { - symbols = { - -- Change type - added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name - modified = "", -- or "", but this is redundant info if you use git_status_colors on the name - deleted = "-",-- this can only be used in the git_status source - renamed = "R",-- this can only be used in the git_status source - -- Status type - untracked = "U", - ignored = "", - unstaged = "", - staged = "S", - conflict = "C", - } - } - }, - window = { - position = "left", - width = 40 - }, - filesystem = { - filtered_items = { - visible = true, - hide_dotfiles = false, - hide_gitignored = false, - hide_hidden = false, - }, - follow_current_file = { - enabled = true, - leave_dirs_open = true - } - }, - buffers = { - follow_current_file = { - enabled = true, -- This will find and focus the file in the active buffer every time - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - }, - } - end - } -} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..6f03e38 --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-tree/nvim-tree.lua", + opts = { + hijack_cursor = true, + sync_root_with_cwd = true, + diagnostics = { + enable = true, + show_on_dirs = true, + show_on_open_dirs = false, + }, + update_focused_file = { + enable = true, + update_root = true, + ignore_list = { "help" }, + }, + modified = { + enable = true, + }, + hijack_directories = { + enable = true + }, + renderer = { + highlight_git = true, + icons = { + git_placement = "after", + diagnostics_placement = "after", + modified_placement = "after", + show = { + git = false, + }, + }, + }, + view = { + signcolumn = "no", + width = 45 + } + } + } +}