Chris 5 rokov pred
rodič
commit
db80027544

+ 6 - 6
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
 
 

+ 1 - 1
init.vim

@@ -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

+ 1 - 1
keys/mappings.vim

@@ -1,4 +1,4 @@
-" Leader key
+" g Leader key
 let mapleader=" "
 " let localleader=" "
 nnoremap <Space> <Nop>

+ 48 - 10
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>
+
 

+ 1 - 1
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

+ 0 - 3
plug-config/commentary.vim

@@ -1,3 +0,0 @@
-
-nnoremap <space>/ :Commentary<CR>
-vnoremap <space>/ :Commentary<CR>

+ 1 - 0
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>

+ 28 - 0
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

+ 1 - 1
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"'

+ 4 - 4
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

+ 3 - 2
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