plugins: Change easychair2 url
[vimconf.git] / plugins.vim
index 1c88f15d6fde40003cd6c286ad3a2a202d93f2c9..66939e622131dafdff86b125b44b48433dc2451f 100644 (file)
@@ -8,6 +8,7 @@ Plug 'dstein64/vim-startuptime'
 
 Plug 'vim-airline/vim-airline'
 Plug 'gruvbox-community/gruvbox'
+Plug 'liuchengxu/vim-which-key'
 
 Plug 'benknoble/vim-auto-origami'
 
@@ -24,13 +25,14 @@ Plug 'junegunn/vim-easy-align'
 
 Plug 'thinca/vim-fontzoom'
 
-Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'}
+Plug 'lambdalisue/vim-manpager'
 
 " Make . more useful after a plugin map
 Plug 'tpope/vim-repeat'
-
 Plug 'flwyd/vim-conjoin'
 
+Plug 'nfnty/vim-nftables'
+
 
 function PluginsConfig()
 
@@ -39,6 +41,11 @@ function PluginsConfig()
     let g:detectindent_max_indent = 4
     let g:detectindent_preferred_indent = 4
 
+    " Minimum indenting for source code
+    au FileType c,cpp,objc,java,cs let g:detectindent_min_indent = 4
+    " Consider using localvimrc config file or editorconfig instead
+    "au BufReadPost *.java :DetectIndent
+
     let g:airline_powerline_fonts=1
     let g:airline#extensions#tabline#enabled=1
     let g:airline#extensions#branch#enabled=1
@@ -90,5 +97,32 @@ function PluginsConfig()
                     \ '',
                     \ ]
     endif
+
+    au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
+    au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
+    au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
+    au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
+
+    let g:mapleader = "\<Space>"
+    let g:maplocalleader = ','
+    nnoremap <silent> <leader>      :<c-u>WhichKey '<Space>'<CR>
+    nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR>
+    vnoremap <silent> <leader>      :<c-u>WhichKeyVisual '<Space>'<CR>
+    vnoremap <silent> <localleader> :<c-u>WhichKeyVisual ','<CR>
+
+    let g:which_key_map =  {}
+    au VimEnter * call which_key#register('<Space>', 'g:which_key_map')
+    let g:which_key_map.b = {
+      \ 'name': '+buffer',
+      \ '1':    ['b1',        'buffer 1'],
+      \ '2':    ['b2',        'buffer 2'],
+      \ 'd':    ['bd',        'delete-buffer'],
+      \ 'f':    ['bfirst',    'first-buffer'],
+      \ 'h':    ['Startify',  'home-buffer'],
+      \ 'l':    ['blast',     'last-buffer'],
+      \ 'n':    ['bnext',     'next-buffer'],
+      \ 'p':    ['bprevious', 'previous-buffer'],
+      \ }
+
 endfunction