diff options
| -rw-r--r-- | general/functions.vim | 12 | ||||
| -rw-r--r-- | init.vim | 2 | ||||
| -rw-r--r-- | keys/mappings.vim | 2 | ||||
| -rw-r--r-- | keys/which-key.vim | 58 | ||||
| -rw-r--r-- | plug-config/coc.vim | 2 | ||||
| -rw-r--r-- | plug-config/commentary.vim | 3 | ||||
| -rw-r--r-- | plug-config/fzf.vim | 1 | ||||
| -rw-r--r-- | plug-config/nerd-commenter.vim | 28 | ||||
| -rw-r--r-- | plug-config/rnvimr.vim | 2 | ||||
| -rw-r--r-- | plug-config/signify.vim | 8 | ||||
| -rw-r--r-- | vim-plug/plugins.vim | 5 | 
11 files changed, 94 insertions, 29 deletions
diff --git a/general/functions.vim b/general/functions.vim index 31297c36..a708c61e 100644 --- a/general/functions.vim +++ b/general/functions.vim @@ -1,11 +1,11 @@  " Turn spellcheck on for markdown files -augroup auto_spellcheck -  autocmd BufNewFile,BufRead *.md setlocal spell -augroup END +" augroup auto_spellcheck +  " autocmd BufNewFile,BufRead *.md setlocal spell +" augroup END  " Remove trailing whitespaces automatically before save -augroup strip_ws -  autocmd BufWritePre * call utils#stripTrailingWhitespaces() -augroup END +" augroup strip_ws +  " autocmd BufWritePre * call utils#stripTrailingWhitespaces() +" augroup END @@ -24,7 +24,7 @@ else    source $HOME/.config/nvim/themes/airline.vim    source $HOME/.config/nvim/plug-config/rnvimr.vim    source $HOME/.config/nvim/plug-config/fzf.vim -  source $HOME/.config/nvim/plug-config/commentary.vim +  source $HOME/.config/nvim/plug-config/nerd-commenter.vim    source $HOME/.config/nvim/plug-config/rainbow.vim    source $HOME/.config/nvim/plug-config/coc.vim    source $HOME/.config/nvim/plug-config/quickscope.vim diff --git a/keys/mappings.vim b/keys/mappings.vim index c24dbdea..3e1d5741 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -1,4 +1,4 @@ -" Leader key +" g Leader key  let mapleader=" "  " let localleader=" "  nnoremap <Space> <Nop> diff --git a/keys/which-key.vim b/keys/which-key.vim index 7b472b4b..4a2d47ef 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -1,9 +1,3 @@ -" map leader to which_key -" call which_key#register('<Space>', "g:which_key_map") - -nnoremap <silent> <leader> :silent WhichKey ' '<CR> -vnoremap <silent> <leader> :silent WhichKeyVisual ' '<CR> -  let g:which_key_map =  {}  let g:which_key_sep = '→'  " set timeoutlen=100 @@ -22,6 +16,22 @@ autocmd! FileType which_key  autocmd  FileType which_key set laststatus=0 noshowmode noruler    \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler +" change to nerd commenter +let g:which_key_map['/'] = [ '<Plug>NERDCommenterToggle'  , 'commenter' ] +let g:which_key_map['.'] = [ ':CocConfig'                 , 'CoC config' ] +let g:which_key_map[';'] = [ ':Commands'                  , 'commands' ] +let g:which_key_map['d'] = [ ':bd'                        , 'delete buffer'] +let g:which_key_map['e'] = [ ':CocCommand explorer'       , 'explorer' ] +let g:which_key_map['f'] = [ ':Files'                     , 'files' ] +let g:which_key_map['h'] = [ '<C-W>s'                     , 'split below'] +let g:which_key_map['q'] = [ 'q'                          , 'quit' ] +let g:which_key_map['r'] = [ ':RnvimrToggle'              , 'ranger' ] +let g:which_key_map['s'] = [ ':Startify'                  , 'start screen' ] +let g:which_key_map['v'] = [ '<C-W>v'                     , 'split right'] +let g:which_key_map['z'] = [ 'Goyo'                       , 'zen' ] +" nmap <leader>r :RnvimrToggle<CR> +" let g:which_key_map['"'] = ['viw<esc>a"<esc>bi"<esc>lel'  , 'surround'] +  " f is for find  let g:which_key_map.f = {        \ 'name' : '+find' , @@ -50,7 +60,35 @@ let g:which_key_map.f = {        \ 'y' : [':Filetypes'    , 'file types'],        \ 'z' : [':FZF'          , 'FZF'],        \ } -let g:fzf_buffers_jump = 1 + +" g is for git +let g:which_key_map.g = { +      \ 'name' : '+git' , +      \ '/' : [':History/'     , 'history'], +      \ ';' : [':Commands'     , 'commands'], +      \ 'a' : [':Ag'           , 'text Ag'], +      \ 'b' : [':BLines'       , 'current buffer'], +      \ 'B' : [':Buffers'      , 'open buffers'], +      \ 'c' : [':Commits'      , 'commits'], +      \ 'C' : [':BCommits'     , 'buffer commits'], +      \ 'f' : [':Files'        , 'files'], +      \ 'g' : [':GFiles'       , 'git files'], +      \ 'G' : [':GFiles?'      , 'modified git files'], +      \ 'h' : [':History'      , 'file history'], +      \ 'H' : [':History:'     , 'command history'], +      \ 'l' : [':Lines'        , 'lines'] , +      \ 'm' : [':Marks'        , 'marks'] , +      \ 'M' : [':Maps'         , 'normal maps'] , +      \ 'p' : [':Helptags'     , 'help tags'] , +      \ 'r' : [':Rg'           , 'text Rg'], +      \ 's' : [':Snippets'     , 'snippets'], +      \ 'S' : [':Colors'       , 'color schemes'], +      \ 't' : [':Tags'         , 'project tags'], +      \ 'T' : [':BTags'        , 'buffer tags'], +      \ 'w' : [':Windows'      , 'search windows'], +      \ 'y' : [':Filetypes'    , 'file types'], +      \ 'z' : [':FZF'          , 'FZF'], +      \ }  " l is for language server protocol  let g:which_key_map.l = { @@ -103,8 +141,8 @@ let g:which_key_map.t = {        \ 'v' : [':Vista!!'                , 'tag viewer'],        \ } - - -  call which_key#register('<Space>', "g:which_key_map") +nnoremap <silent> <leader> :silent <c-u>WhichKey '<Space>'<CR> +vnoremap <silent> <leader> :silent <c-u>WhichKeyVisual '<Space>'<CR> + diff --git a/plug-config/coc.vim b/plug-config/coc.vim index 428230d1..647bab73 100644 --- a/plug-config/coc.vim +++ b/plug-config/coc.vim @@ -129,6 +129,6 @@ let g:coc_explorer_global_presets = {  \   }  \ }  "nmap <silent> <space>e :CocCommand explorer<CR> -nnoremap <silent> <leader>e :CocCommand explorer<CR> +" nnoremap <silent> <leader>e :CocCommand explorer<CR>  " nmap <space>f :CocCommand explorer --preset floatingRightside<CR>  autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif diff --git a/plug-config/commentary.vim b/plug-config/commentary.vim deleted file mode 100644 index 8bf021d8..00000000 --- a/plug-config/commentary.vim +++ /dev/null @@ -1,3 +0,0 @@ - -nnoremap <space>/ :Commentary<CR> -vnoremap <space>/ :Commentary<CR> diff --git a/plug-config/fzf.vim b/plug-config/fzf.vim index c715dab5..f02d279c 100644 --- a/plug-config/fzf.vim +++ b/plug-config/fzf.vim @@ -9,6 +9,7 @@ let g:fzf_action = {  " previous-history instead of down and up. If you don't like the change,  " explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.  let g:fzf_history_dir = '~/.local/share/fzf-history' +let g:fzf_buffers_jump = 1  " map <C-f> :Files<CR>  " map <leader>b :Buffers<CR> diff --git a/plug-config/nerd-commenter.vim b/plug-config/nerd-commenter.vim new file mode 100644 index 00000000..8b054e34 --- /dev/null +++ b/plug-config/nerd-commenter.vim @@ -0,0 +1,28 @@ + +" nnoremap <space>/ :Commentary<CR> +" vnoremap <space>/ :Commentary<CR> + +let g:NERDCreateDefaultMappings = 0 +" Add spaces after comment delimiters by default +let g:NERDSpaceDelims = 1 + +" Use compact syntax for prettified multi-line comments +let g:NERDCompactSexyComs = 1 + +" Align line-wise comment delimiters flush left instead of following code indentation +let g:NERDDefaultAlign = 'left' + +" Set a language to use its alternate delimiters by default +let g:NERDAltDelims_java = 1 + +" Add your own custom formats or override the defaults +let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } + +" Allow commenting and inverting empty lines (useful when commenting a region) +let g:NERDCommentEmptyLines = 1 + +" Enable trimming of trailing whitespace when uncommenting +let g:NERDTrimTrailingWhitespace = 1 + +" Enable NERDCommenterToggle to check all selected lines is commented or not  +let g:NERDToggleCheckAllLines = 1 diff --git a/plug-config/rnvimr.vim b/plug-config/rnvimr.vim index 86582c7c..53f468e8 100644 --- a/plug-config/rnvimr.vim +++ b/plug-config/rnvimr.vim @@ -9,7 +9,7 @@ let g:rnvimr_pick_enable = 1  " Make Neovim to wipe the buffers corresponding to the files deleted by Ranger  let g:rnvimr_bw_enable = 1 -nmap <leader>r :RnvimrToggle<CR> +" nmap <leader>r :RnvimrToggle<CR>  let g:rnvimr_ranger_cmd = 'ranger --cmd="set column_ratios 1,1"              \ --cmd="set draw_borders separators"' diff --git a/plug-config/signify.vim b/plug-config/signify.vim index 5206a650..6e04012b 100644 --- a/plug-config/signify.vim +++ b/plug-config/signify.vim @@ -15,10 +15,10 @@ let g:signify_sign_show_text = 1  " Jump though hunks -nmap <leader>j <plug>(signify-next-hunk) -nmap <leader>k <plug>(signify-prev-hunk) -nmap <leader>gJ 9999<leader>gj -nmap <leader>gK 9999<leader>gk +" nmap <leader>j <plug>(signify-next-hunk) +" nmap <leader>k <plug>(signify-prev-hunk) +" nmap <leader>gJ 9999<leader>gj +" nmap <leader>gK 9999<leader>gk  " If you like colors instead diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 0094e9a2..87ff77a7 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -19,7 +19,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')    " Surround    Plug 'tpope/vim-surround'    " Better Comments -  Plug 'tpope/vim-commentary' +  Plug 'preservim/nerdcommenter'    " Have the file system follow you around    Plug 'airblade/vim-rooter'    " auto set indent settings @@ -47,7 +47,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')      Plug 'alvan/vim-closetag'      " Themes      Plug 'christianchiarulli/onedark.vim' -    " Plug 'kaicataldo/material.vim' +    Plug 'kaicataldo/material.vim' +    Plug 'NLKNguyen/papercolor-theme'      " Intellisense      Plug 'neoclide/coc.nvim', {'branch': 'release'}      " Status Line  | 
