From 6b3b1c9e39d573ab32b22e615a5509b721529ddf Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 9 Jun 2024 14:18:40 +0200 Subject: remove nerdtree --- lua/autocommands/NERDTree.lua | 1 - lua/autocommands/exit.lua | 27 --------------------------- lua/autocommands/init.lua | 1 - lua/config.lua | 4 ---- lua/functions.lua | 32 +------------------------------- lua/maps/NERDtree.lua | 2 -- lua/maps/init.lua | 1 - lua/plugins.lua | 14 -------------- lua/style.lua | 1 - 9 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 lua/autocommands/NERDTree.lua delete mode 100644 lua/maps/NERDtree.lua diff --git a/lua/autocommands/NERDTree.lua b/lua/autocommands/NERDTree.lua deleted file mode 100644 index 9e0acab..0000000 --- a/lua/autocommands/NERDTree.lua +++ /dev/null @@ -1 +0,0 @@ -autocmd("VimEnter", "*", "lua toggle_nerdtree()") diff --git a/lua/autocommands/exit.lua b/lua/autocommands/exit.lua index 8ffac46..150e980 100644 --- a/lua/autocommands/exit.lua +++ b/lua/autocommands/exit.lua @@ -1,15 +1,5 @@ require("utility.autocmd") --- Exit Vim if NERDTree is the only window remaining in the only tab. ---[[ -autocmd( - "BufEnter", - "*", - "if tabpagenr('$') == 1 && winnr('$') == 1 && " .. - "exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif" -) -]] - -- Exit Vim if a terminal is the only window remaining in the only tab. --[[ autocmd( @@ -17,22 +7,5 @@ autocmd( "*", "if tabpagenr('$') == 1 && winnr('$') == 1 && g:is_term_open == 1 | quit | endif" ) - --- Exit Vim if the only windows remaining is NERDTree and terminal. -autocmd( - "BufEnter", - "*", - "if tabpagenr('$') == 1 && winnr('$') == 2 && g:NERDTree.IsOpen() && " .. - "g:is_term_open == 1 | qall | endif" -) ]] --- Close a single NERDTree tab. ---[[ -autocmd( - "BufEnter", - "*", - "if len(tabpagebuflist()) == 1 && bufname(tabpagebuflist()[0]) =~ \"^NERD_tree\" " .. - "| tabclose | endif" -) -]] diff --git a/lua/autocommands/init.lua b/lua/autocommands/init.lua index 23679e9..6c6729d 100644 --- a/lua/autocommands/init.lua +++ b/lua/autocommands/init.lua @@ -1,5 +1,4 @@ require("autocommands.coc") require("autocommands.exit") require("autocommands.buffer") -require("autocommands.NERDTree") diff --git a/lua/config.lua b/lua/config.lua index 373bbad..2053173 100644 --- a/lua/config.lua +++ b/lua/config.lua @@ -56,10 +56,6 @@ vim.g["vim_markdown_folding_disabled"] = 1 vim.g.rustfmt_autosave = 1 -vim.g.nerdtree_tabs_open_on_console_startup = 1 - -vim.g.NERDTreeWinSize = 40 - -- Custom globals vim.g.terminal_height = 12 vim.g.term_buf = 0 diff --git a/lua/functions.lua b/lua/functions.lua index 3b52a55..82be1ad 100644 --- a/lua/functions.lua +++ b/lua/functions.lua @@ -20,12 +20,6 @@ function set_terminal_height(height) vim.api.nvim_win_set_height(vim.g.term_win, height) end -local function get_nerdtree_win_id() - local nerdtree_win_num = vim.api.nvim_eval("g:NERDTree.GetWinNum()") - - return vim.fn.win_getid(nerdtree_win_num) -end - function _G.check_back_space() local col = vim.api.nvim_win_get_cursor(0)[2] @@ -78,32 +72,9 @@ function _G.toggle_terminal() vim.cmd("startinsert!") vim.g.term_win = vim.fn.win_getid() - - if vim.fn.exists("g:NERDTree") and vim.api.nvim_eval("g:NERDTree.IsOpen()") then - local nerdtree_win_id = get_nerdtree_win_id() - - vim.api.nvim_win_call( - nerdtree_win_id, - function() - vim.cmd("wincmd H") - end - ) - - vim.api.nvim_win_set_width(nerdtree_win_id, vim.g.NERDTreeWinSize) - end end end -function _G.toggle_nerdtree() - vim.cmd("NERDTreeToggle") - - vim.api.nvim_win_set_option( - vim.fn.win_getid(), - "winhighlight", - "Normal:NERDTreeWindow" - ) -end - function _G.get_current_file() return vim.fn.expand("%") end @@ -125,7 +96,7 @@ end function _G.close_current_buffer() local curr_win_id = vim.fn.win_getid() - if curr_win_id == vim.g.term_win or curr_win_id == get_nerdtree_win_id() then + if curr_win_id == vim.g.term_win then return end @@ -139,7 +110,6 @@ function _G.close_current_buffer() return buf_info.loaded == 1 and buf_info.listed == 1 and buf_info.bufnr ~= current_buf_nr - and not string.find(buf_info.name, "NERD_tree_") and not string.find(buf_info.name, "term://") end ) diff --git a/lua/maps/NERDtree.lua b/lua/maps/NERDtree.lua deleted file mode 100644 index c89623c..0000000 --- a/lua/maps/NERDtree.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.api.nvim_set_keymap("n", "", ":lua toggle_nerdtree()", - {silent = true, noremap = true}) diff --git a/lua/maps/init.lua b/lua/maps/init.lua index 43f1632..d5956f7 100644 --- a/lua/maps/init.lua +++ b/lua/maps/init.lua @@ -1,5 +1,4 @@ require("maps.coc") -require("maps.NERDtree") require("maps.terminal") require("maps.auto_close") require("maps.find") diff --git a/lua/plugins.lua b/lua/plugins.lua index 9ab9171..569646a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -9,20 +9,6 @@ return require("packer").startup(function(use) commit = "4f59455d2388e113bd510e85b310d15b9228ca0d" } - -- NERDtree - use { "preservim/nerdtree", tag = "7.1.2" } - - use { - "ryanoasis/vim-devicons", - commit = "71f239af28b7214eebb60d4ea5bd040291fb7e33" - } - - use { - "tiagofumo/vim-nerdtree-syntax-highlight", - commit = "35e70334a2ff6e89b82a145d1ac889e82d1ddb4e" - } - --- NERDtree end - -- Style use { "Shatur/neovim-ayu", diff --git a/lua/style.lua b/lua/style.lua index e3a295c..307c89f 100644 --- a/lua/style.lua +++ b/lua/style.lua @@ -8,7 +8,6 @@ require('ayu').setup({ LineNrAbove = { fg = ayu_colors.comment }, LineNrBelow = { fg = ayu_colors.comment }, LineNr = { fg = ayu_colors.accent }, - NERDTreeWindow = { fg = ayu_colors.fg, bg = ayu_colors.panel_bg }, TerminalWindow = { fg = ayu_colors.fg, bg = ayu_colors.panel_bg }, ColorColumn = { bg = ayu_colors.error }, } -- cgit v1.2.3-18-g5258