diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-09 14:18:40 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-09 14:18:45 +0200 |
commit | 6b3b1c9e39d573ab32b22e615a5509b721529ddf (patch) | |
tree | 6043c75db6adef41e20500a16e7c6858a0401ad5 /lua/functions.lua | |
parent | 17351b228abd9f953c2789f98b1403ea496b30a4 (diff) |
remove nerdtree
Diffstat (limited to 'lua/functions.lua')
-rw-r--r-- | lua/functions.lua | 32 |
1 files changed, 1 insertions, 31 deletions
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 ) |