diff options
author | Joe <rrbo@proton.me> | 2023-09-05 12:18:59 +0200 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-09-05 12:18:59 +0200 |
commit | c06258a3c9eca853c0e176a278af3f17757ef137 (patch) | |
tree | 25376d8a989169c688dc2a72245e7b6748dd047a /.config/nvim | |
parent | up (diff) | |
download | dotfiles-bsd-c06258a3c9eca853c0e176a278af3f17757ef137.tar.gz dotfiles-bsd-c06258a3c9eca853c0e176a278af3f17757ef137.tar.bz2 dotfiles-bsd-c06258a3c9eca853c0e176a278af3f17757ef137.tar.xz dotfiles-bsd-c06258a3c9eca853c0e176a278af3f17757ef137.tar.zst dotfiles-bsd-c06258a3c9eca853c0e176a278af3f17757ef137.zip |
up
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/init.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/sidebars.lua | 39 | ||||
-rw-r--r-- | .config/nvim/sidebars.lua | 42 | ||||
-rw-r--r-- | .config/nvim/sidebars.vim | 37 |
4 files changed, 40 insertions, 80 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 1940060..b8250bd 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -18,8 +18,8 @@ vim.cmd('let &packpath = &runtimepath') require('plug') require('settings') require('bindings') +require('sidebars') require('plugs-config/treesitter') -vim.cmd('source ' .. confdir .. '/nvim/sidebars.vim') vim.cmd('source ' .. confdir .. '/nvim/langs.vim') vim.cmd('source ' .. confdir .. '/nvim/plug-config/airline.vim') vim.cmd('source ' .. confdir .. '/nvim/plug-config/asyncomplete.vim') 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', '<F2>', ':call sidebar#toggle("nerdtree")<CR>', { noremap = true, silent = true }) +vim.keymap.set('n', '<F4>', ':make<space>-j5<space>', { noremap = true, silent = false }) +vim.keymap.set('n', '<F3>', ':call sidebar#toggle("tagbar")<CR>', { noremap = true, silent = true }) +vim.keymap.set('n', '<F5>', ':call sidebar#toggle("undotree")<CR>', { noremap = true, silent = true }) diff --git a/.config/nvim/sidebars.lua b/.config/nvim/sidebars.lua deleted file mode 100644 index efdddb2..0000000 --- a/.config/nvim/sidebars.lua +++ /dev/null @@ -1,42 +0,0 @@ -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.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' - } - } - - - - - - - - - - - diff --git a/.config/nvim/sidebars.vim b/.config/nvim/sidebars.vim deleted file mode 100644 index 4aa6707..0000000 --- a/.config/nvim/sidebars.vim +++ /dev/null @@ -1,37 +0,0 @@ -let g:NERDTreeWinPos = 'left' -let g:NERDTreeWinSize = 30 -let g:NERDTreeQuitOnOpen = 0 -let g:tagbar_left = 1 -let g:tagbar_width = 30 -let g:tagbar_autoclose = 0 -let g:tagbar_autofocus = 1 -let g:tagbar_sort = 0 -let g:undotree_SetFocusWhenToggle = 1 -let g:undotree_SplitWidth = 30 - -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' - \ } - \ } - -noremap <silent> <F2> :call sidebar#toggle('nerdtree')<CR> -noremap <F4> :make<space>-j5<space> -noremap <silent> <F3> :call sidebar#toggle('tagbar')<CR> -noremap <silent> <F5> :call sidebar#toggle('undotree')<CR> -let g:startify_session_before_save = ['call sidebar#close_all()'] |