diff --git a/nvim/init.vim b/nvim/init.vim index 8fbf90f..a16ef68 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -22,7 +22,6 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} Plug 'junegunn/fzf.vim' Plug 'antoinemadec/coc-fzf', {'branch': 'release'} -"Plug 'liuchengxu/vista.vim' " tags explorer Plug 'sheerun/vim-polyglot' " language syntax " git Plug 'tpope/vim-fugitive' @@ -82,6 +81,7 @@ let g:airline#extensions#tabline#show_splits=0 let g:airline#extensions#tabline#show_tabs=0 let g:airline#extensions#tabline#show_buffers=1 let g:airline#extensions#tabline#switch_buffers_and_tabs=0 +let g:airline#extensions#tabline#formatter = 'unique_tail_improved' " temporary files and undo set directory=/tmp//,. @@ -136,7 +136,6 @@ set shiftwidth=4 set expandtab " other -set autochdir set lazyredraw set updatetime=300 set timeoutlen=500 @@ -157,9 +156,11 @@ let mapleader="\" nnoremap q: nnoremap Q vnoremap v +nnoremap K zz nmap :noh nmap R :so ~/.config/nvim/init.vim nmap E :tabe ~/OneDrive/dotfiles/nvim/init.vim +nmap w :cd %:p:h " nerdcommenter: 'c ', 'cl' aligned and 'cu>' remove " vim-surround: visual 'SA' to wrap in A. Surround 'csAB' to change from A to B, 'dsA' to remove A. Word 'ysiwA' to wrap with A @@ -177,6 +178,7 @@ set langmap=å(,¨),Å{,^},Ø\\;,ø:,\\;<,:>,æ^ " ***************************** " EDITING nmap cr (coc-rename) +nmap cR (coc-refactor) xmap cf (coc-format-selected) nmap cf (coc-format-selected) @@ -215,8 +217,8 @@ let g:asterisk#keeppos=1 " ***************************** " CURSOR " stay visual when indenting -vnoremap >gv -vnoremap > >gv +vnoremap << inoremap @@ -226,6 +228,16 @@ inoremap inoremap inoremap inoremap +" move between errors +nmap (coc-diagnostic-prev) +nmap (coc-diagnostic-next) +" GoTo code navigation +nnoremap gj (coc-git-prevchunk) +nnoremap gk (coc-git-nextchunk) +nnoremap gd (coc-definition) +nnoremap gy (coc-type-definition) +nnoremap gi (coc-implementation) +nnoremap gr (coc-references) " ***************************** " WINDOWS / BUFFERS @@ -242,21 +254,75 @@ nnoremap :new nnoremap :tabe % nnoremap :tabnew " buffergator -nmap :bprev -nmap :bnext -nmap :tabprev -nmap :tabnext +nmap :bprev +nmap :bnext +nmap :tabprev +nmap :tabnext " resize windows with hjkl nnoremap < nnoremap - nnoremap + nnoremap > " quickfix window -nmap :cn -nmap :cp -" close buffer -nmap :b#bd# -nmap :b#bd!# +nmap :cn +nmap :cp +" remove buffer +nmap :bpbd# +nmap :bpbd!# +" close window +nmap :q + +" ***************************** +" GIT +nmap (coc-git-chunkinfo) +nmap :CocCommand git.chunkStage +vmap :CocCommand git.chunkStage +nmap :CocCommand git.chunkUndo +vmap :CocCommand git.chunkUndo + +" ***************************** +" EXPLORERS +" coc-explorer +map :CocCommand explorer +" vim-fugitive +" g? for fugitive help. :Gdiff, :Gblame, :Gstats '=' expand, '-' add/reset changes, :Gcommit % to commit current file with messag +map :vertical Git:vertical resize 60 + +" ***************************** +" POPUPS +command! -bang -nargs=* Ag call fzf#vim#ag(, {'options': '--delimiter : --nth 4..'}, 0) +nmap :Ag +nmap :CocFzfList +nmap :CocFzfList symbols --kind Variable +nmap :CocFzfList symbols --kind Function +nmap :History +nmap :History/ +nmap :GFiles +nmap :Files +nmap :Buffers +map :Colors +map :Filetypes +let g:fzf_preview_command='bat --color=always --plain {-1}' " Installed bat +let g:fzf_preview_grep_cmd='rg --smart-case --line-number --no-heading --color=never' +" fzf git +nmap :GFiles? +nmap :Commits +nmap :BCommits + +" ***************************** +" COC CONFIGS +" coc menus +let g:coc_node_path='/usr/bin/node' +function! s:check_back_space() abort + let col=col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction +imap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +imap pumvisible() ? "\" : "\" +imap coc#refresh() " ***************************** " MARKDOWN @@ -280,72 +346,6 @@ let g:mkdp_preview_options={ " sync_scroll_type: 'middle', 'top' or 'relative' " hide_yaml_meta: if hide yaml metadata, default is 1 -" ***************************** -" GIT -" vim-fugitive -" g? for fugitive help. :Gdiff, :Gblame, :Gstats '=' expand, '-' add/reset changes, :Gcommit % to commit current file with messag -nmap :vertical Git:vertical resize 60 -" fzf -nmap :GFiles? -nmap :Commits -nmap :BCommits -" coc git -nmap (coc-git-chunkinfo) -nmap (coc-git-prevchunk) -nmap (coc-git-nextchunk) -nmap :CocCommand git.chunkStage -vmap :CocCommand git.chunkStage -nmap :CocCommand git.chunkUndo -vmap :CocCommand git.chunkUndo - -" ***************************** -" EXPLORERS -" vista and coc-explorer -map :CocCommand explorer -"map :Vista!! -"let g:vista_default_executive = 'ctags' -"let g:vista_fzf_preview = ['right:50%'] - -" ***************************** -" POPUPS -command! -bang -nargs=* Ag call fzf#vim#ag(, {'options': '--delimiter : --nth 4..'}, 0) -nmap :Ag -nmap :CocFzfList -nmap :CocFzfList symbols --kind Variable -nmap :CocFzfList symbols --kind Function -nmap :History -nmap :History/ -nmap :GFiles -nmap :Files -nmap :Buffers -map :Colors -map :Filetypes -let g:fzf_preview_command='bat --color=always --plain {-1}' " Installed bat -let g:fzf_preview_grep_cmd='rg --smart-case --line-number --no-heading --color=never' - -" ***************************** -" COC OTHER -" coc menus -let g:coc_node_path='/usr/bin/node' -function! s:check_back_space() abort - let col=col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction -imap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -imap pumvisible() ? "\" : "\" -imap coc#refresh() -" coc helpers -nmap gP (coc-diagnostic-prev) -nmap gp (coc-diagnostic-next) -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) -nmap gR (coc-refactor) - " ***************************** " autocmd augroup myAu " A unique name for the group. DO NOT use the same name twice! diff --git a/ranger/rc.conf b/ranger/rc.conf index d754b35..140b27f 100644 --- a/ranger/rc.conf +++ b/ranger/rc.conf @@ -262,7 +262,7 @@ map w taskview_open map S shell $SHELL map : console -map ; console +map ø console map ! console shell%space map @ console -p6 shell %%s map # console shell -p%space