From c06258a3c9eca853c0e176a278af3f17757ef137 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 5 Sep 2023 12:18:59 +0200 Subject: up --- .config/nvim/lua/sidebars.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .config/nvim/lua/sidebars.lua (limited to '.config/nvim/lua/sidebars.lua') diff --git a/.config/nvim/lua/sidebars.lua b/.config/nvim/lua/sidebars.lua new file mode 100644 index 0000000..058a673 --- /dev/null +++ b/.config/nvim/lua/sidebars.lua @@ -0,0 +1,39 @@ +vim.g.NERDTreeWinPos = 'left' +vim.g.NERDTreeWinSize = 30 +vim.g.NERDTreeQuitOnOpen = 0 +vim.g.tagbar_left = 1 +vim.g.tagbar_width = 30 +vim.g.tagbar_autoclose = 0 +vim.g.tagbar_autofocus = 1 +vim.g.tagbar_sort = 0 +vim.g.undotree_SetFocusWhenToggle = 1 +vim.g.undotree_SplitWidth = 30 + +vim.cmd [[ +let g:sidebars = { + \ 'nerdtree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'nerdtree'}, + \ 'open': 'NERDTree', + \ 'close': 'NERDTreeClose' + \ }, + \ 'tagbar': { + \ 'position': 'left', + \ 'check_win': {nr -> bufname(winbufnr(nr)) =~ '__Tagbar__'}, + \ 'open': 'TagbarOpen', + \ 'close': 'TagbarClose' + \ }, + \ 'undotree': { + \ 'position': 'left', + \ 'check_win': {nr -> getwinvar(nr, '&filetype') ==# 'undotree'}, + \ 'open': 'UndotreeShow', + \ 'close': 'UndotreeHide' + \ } + \ } +let g:startify_session_before_save = ['call sidebar#close_all()'] +]] + +vim.keymap.set('n', '', ':call sidebar#toggle("nerdtree")', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':make-j5', { noremap = true, silent = false }) +vim.keymap.set('n', '', ':call sidebar#toggle("tagbar")', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':call sidebar#toggle("undotree")', { noremap = true, silent = true }) -- cgit v1.2.3