From f9f94144180cb54b395e4f55b580e7a30e91dd07 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 7 Nov 2020 14:06:08 +0100 Subject: [PATCH] asdf --- .netrwhist | 22 +++++++++++----------- init.vim | 40 +++++++++++++++++++++++++++++++++++++--- lsp.vim | 33 ++++++++++++++++++++++++++++++--- plugins.vim | 16 ++++++++++++++++ whichkeyConfig.vim | 6 ++++-- 5 files changed, 98 insertions(+), 19 deletions(-) diff --git a/.netrwhist b/.netrwhist index 06d4c94..162a1c0 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,12 +1,12 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =2 -let g:netrw_dirhist_2='/home/leon/dotfiles/.vim/plugged/vim-airline-themes/plugin' -let g:netrw_dirhist_1='/home/leon/dotfiles/.vim/plugged/vim-airline-themes' -let g:netrw_dirhist_0='/home/leon/dotfiles/.vim/plugged' -let g:netrw_dirhist_9='/home/leon/coding/projects/rnix-lsp' -let g:netrw_dirhist_8='/home/leon/coding/projects/rnix-lsp/src' -let g:netrw_dirhist_7='/home/leon/coding/projects/rnix-lsp' -let g:netrw_dirhist_6='/home/leon/tmp/nixpkgs/pkgs' -let g:netrw_dirhist_5='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet-sh' -let g:netrw_dirhist_4='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet.sh' -let g:netrw_dirhist_3='/home/leon/tmp/nixpkgs/pkgs/tools/misc/pfetch' +let g:netrw_dirhistcnt =7 +let g:netrw_dirhist_7='/home/leon/coding/plover-plugins/plover_retro_surround/plover_retro_surround.egg-info' +let g:netrw_dirhist_6='/home/leon/.config/coc/extensions' +let g:netrw_dirhist_5='/home/leon/.config/elkowar_phocus' +let g:netrw_dirhist_4='/home/leon/coding/projects/eww/docs' +let g:netrw_dirhist_3='/home/leon/tmp/test/content' +let g:netrw_dirhist_2='/home/leon/desktop-dotfiles/files/.config' +let g:netrw_dirhist_1='/home/leon/desktop-dotfiles/files/.config/eww' +let g:netrw_dirhist_0='/home/leon/.config/eww' +let g:netrw_dirhist_9='/home/leon/.config' +let g:netrw_dirhist_8='/home/leon/coding/projects/eww/src' diff --git a/init.vim b/init.vim index 8102f95..48fe26e 100644 --- a/init.vim +++ b/init.vim @@ -137,6 +137,7 @@ noremap h :bprevious nnoremap K vnoremap K + " }}} " Plugin configuration --------------------------------------------------- {{{ @@ -202,9 +203,9 @@ let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}' let g:airline_theme='elkowars_gruvbox' -hi airline_tabfill ctermbg=NONE guibg=NONE -hi airline_b_to_airline_c ctermbg=NONE guibg='#ff0000' -hi airline_tablabel_right ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE +autocmd BufWinEnter * :hi airline_tabfill ctermbg=NONE guibg=NONE +autocmd BufWinEnter * :hi airline_b_to_airline_c ctermbg=NONE guibg='#ff0000' +autocmd BufWinEnter * :hi airline_tablabel_right ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE " }}} @@ -214,3 +215,36 @@ source $VIM_ROOT/whichkeyConfig.vim source $VIM_ROOT/lsp.vim " }}} + +function RebindShit(newKey) + let b:RemappedSpace={ + \ 'old': maparg("", "i"), + \ 'cur': a:newKey + \ } + exe 'inoremap ' a:newKey +endfun + +function! UnbindSpaceStuff() + if get(b:, "RemappedSpace", {}) != {} + exe 'iunmap ' + if b:RemappedSpace['old'] != "" + exe 'inoremap ' b:RemappedSpace['old'] + endif + unlet b:RemappedSpace + endif +endfun + +augroup UnmapSpaceStuff + autocmd! + autocmd InsertLeave * call UnbindSpaceStuff() +augroup END + + +nnoremap j :call RebindShit("_")a +nnoremap k :call RebindShit("::")a + +inoremap j :call RebindShit("_") +inoremap k :call RebindShit("::") + + +nnoremap รถ a diff --git a/lsp.vim b/lsp.vim index fd2f5d3..c890ae0 100644 --- a/lsp.vim +++ b/lsp.vim @@ -2,16 +2,42 @@ hi link haskellOperators GruvboxAqua hi link haskellImportKeywords GruvboxPurple +let g:vista_default_executive = 'coc' +let g:vista_sidebar_position = 'vertical topleft' +let g:vista_sidebar_width = '50' + + + au VimEnter * RainbowParenthesesToggle au Syntax * RainbowParenthesesLoadRound au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadBraces + +" Use for trigger snippet expand. +imap (coc-snippets-expand) + +" Use for select text for visual placeholder of snippet. +vmap (coc-snippets-select) + +" Use for jump to next placeholder, it's default of coc.nvim +let g:coc_snippet_next = '' + +" Use for jump to previous placeholder, it's default of coc.nvim +let g:coc_snippet_prev = '' + +" Use for both expand and jump (make expand higher priority.) +imap (coc-snippets-expand-jump) + +" Use x for convert visual selected code to snippet +xmap x (coc-convert-snippet) + let g:coc_global_extensions = [ \ 'coc-yank', 'coc-vimlsp', 'coc-prettier', 'coc-eslint', - \ 'coc-diagnostic', 'coc-yaml', 'coc-tsserver', 'coc-rust-analyzer', + \ 'coc-diagnostic', 'coc-yaml', 'coc-tsserver', \ 'coc-json', 'coc-go', 'coc-html', 'coc-css', 'coc-clangd' \ ] +" 'coc-rust-analyzer', " vim-jsx @@ -33,8 +59,9 @@ else endif " ? idk -inoremap pumvisible() ? "\" : check_back_space() ? "\" : coc#refresh() -inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : check_back_space() ? "\" : coc#refresh() +"inoremap pumvisible() ? "\" : "\" + function! Show_documentation() diff --git a/plugins.vim b/plugins.vim index 0bbe2ab..22c6d2d 100644 --- a/plugins.vim +++ b/plugins.vim @@ -7,6 +7,8 @@ endif call plug#begin('~/.vim/plugged') +Plug 'branwright1/salvation-vim' + Plug 'tpope/vim-repeat' Plug 'junegunn/goyo.vim', {'on': 'Goyo'} @@ -61,8 +63,20 @@ call plug#begin('~/.vim/plugged') Plug 'pechorin/any-jump.vim' Plug 'justinmk/vim-sneak' Plug 'psliwka/vim-smoothie' + + Plug 'editorconfig/editorconfig-vim' + + + Plug 'honza/vim-snippets' + + Plug 'liuchengxu/vista.vim' + + " Language Plugins ----------------------------------------------------- {{{ + "Plug 'satabin/hocon-vim' + Plug 'GEverding/vim-hocon' + Plug 'LnL7/vim-nix' Plug 'kien/rainbow_parentheses.vim' @@ -92,5 +106,7 @@ call plug#begin('~/.vim/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} + " }}} call plug#end() + diff --git a/whichkeyConfig.vim b/whichkeyConfig.vim index 1f04ff1..ed898e4 100644 --- a/whichkeyConfig.vim +++ b/whichkeyConfig.vim @@ -3,6 +3,7 @@ vnoremap :'WhichKeyVisual '' let g:which_key_map = {} call which_key#register('', "g:which_key_map") + let g:which_key_map = { \ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore', \ 'f' : 'which_key_ignore', 's': 'which_key_ignore' , @@ -25,16 +26,17 @@ let g:which_key_map['m'] = { \ 't' : [ '(coc-type-definition)' , 'show type definition' ] , \ 'i' : [ '(coc-implementation)' , 'show implementation' ] , \ 'r' : [ '(coc-references)' , 'show references' ] , + \ 'b' : [ '(coc-refactor)' , 'refactor' ] , \ 'n' : [ '(coc-rename)' , 'rename' ] , \ 'F' : [ '(coc-format-selected)' , 'format selection' ] , \ 'f' : [ '(coc-format)' , 'format file' ] , - \ 'v' : [ '(coc-codeaction)' , 'apply codeaction' ] , + \ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] , \ 'V' : [ '(coc-fix-current)' , 'apply quickfix' ] , \ 'e' : [ ':CocList diagnostics' , 'list all errors' ] , \ 'L' : [ '(coc-diagnostics-next)' , 'go to next error' ] , \ 'H' : [ '(coc-diagnostics-prev)' , 'go to prev error' ] , \} - + let g:which_key_map['a'] = { \ 'name': '+Bookmarks',