This commit is contained in:
elkowar 2020-11-07 14:06:08 +01:00
parent a5b3d206b2
commit f9f9414418
5 changed files with 98 additions and 19 deletions

View file

@ -1,12 +1,12 @@
let g:netrw_dirhistmax =10 let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =2 let g:netrw_dirhistcnt =7
let g:netrw_dirhist_2='/home/leon/dotfiles/.vim/plugged/vim-airline-themes/plugin' let g:netrw_dirhist_7='/home/leon/coding/plover-plugins/plover_retro_surround/plover_retro_surround.egg-info'
let g:netrw_dirhist_1='/home/leon/dotfiles/.vim/plugged/vim-airline-themes' let g:netrw_dirhist_6='/home/leon/.config/coc/extensions'
let g:netrw_dirhist_0='/home/leon/dotfiles/.vim/plugged' let g:netrw_dirhist_5='/home/leon/.config/elkowar_phocus'
let g:netrw_dirhist_9='/home/leon/coding/projects/rnix-lsp' let g:netrw_dirhist_4='/home/leon/coding/projects/eww/docs'
let g:netrw_dirhist_8='/home/leon/coding/projects/rnix-lsp/src' let g:netrw_dirhist_3='/home/leon/tmp/test/content'
let g:netrw_dirhist_7='/home/leon/coding/projects/rnix-lsp' let g:netrw_dirhist_2='/home/leon/desktop-dotfiles/files/.config'
let g:netrw_dirhist_6='/home/leon/tmp/nixpkgs/pkgs' let g:netrw_dirhist_1='/home/leon/desktop-dotfiles/files/.config/eww'
let g:netrw_dirhist_5='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet-sh' let g:netrw_dirhist_0='/home/leon/.config/eww'
let g:netrw_dirhist_4='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet.sh' let g:netrw_dirhist_9='/home/leon/.config'
let g:netrw_dirhist_3='/home/leon/tmp/nixpkgs/pkgs/tools/misc/pfetch' let g:netrw_dirhist_8='/home/leon/coding/projects/eww/src'

View file

@ -137,6 +137,7 @@ noremap <silent> <leader>h :bprevious<CR>
nnoremap K <Nop> nnoremap K <Nop>
vnoremap K <Nop> vnoremap K <Nop>
" }}} " }}}
" Plugin configuration --------------------------------------------------- {{{ " Plugin configuration --------------------------------------------------- {{{
@ -202,9 +203,9 @@ let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}'
let g:airline_theme='elkowars_gruvbox' let g:airline_theme='elkowars_gruvbox'
hi airline_tabfill ctermbg=NONE guibg=NONE autocmd BufWinEnter * :hi airline_tabfill ctermbg=NONE guibg=NONE
hi airline_b_to_airline_c ctermbg=NONE guibg='#ff0000' autocmd BufWinEnter * :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_tablabel_right ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE
" }}} " }}}
@ -214,3 +215,36 @@ source $VIM_ROOT/whichkeyConfig.vim
source $VIM_ROOT/lsp.vim source $VIM_ROOT/lsp.vim
" }}} " }}}
function RebindShit(newKey)
let b:RemappedSpace={
\ 'old': maparg("<Space>", "i"),
\ 'cur': a:newKey
\ }
exe 'inoremap <buffer> <Space>' a:newKey
endfun
function! UnbindSpaceStuff()
if get(b:, "RemappedSpace", {}) != {}
exe 'iunmap <buffer> <Space>'
if b:RemappedSpace['old'] != ""
exe 'inoremap <buffer> <space>' b:RemappedSpace['old']
endif
unlet b:RemappedSpace
endif
endfun
augroup UnmapSpaceStuff
autocmd!
autocmd InsertLeave * call UnbindSpaceStuff()
augroup END
nnoremap <Tab>j :call RebindShit("_")<CR>a
nnoremap <Tab>k :call RebindShit("::")<CR>a
inoremap <Tab>j <space><C-o>:call RebindShit("_")<CR>
inoremap <Tab>k <space><C-o>:call RebindShit("::")<CR>
nnoremap ö a

33
lsp.vim
View file

@ -2,16 +2,42 @@ hi link haskellOperators GruvboxAqua
hi link haskellImportKeywords GruvboxPurple 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 VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces au Syntax * RainbowParenthesesLoadBraces
" Use <C-l> for trigger snippet expand.
imap <C-l> <Plug>(coc-snippets-expand)
" Use <C-j> for select text for visual placeholder of snippet.
vmap <C-j> <Plug>(coc-snippets-select)
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
let g:coc_snippet_next = '<c-j>'
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
let g:coc_snippet_prev = '<c-k>'
" Use <C-j> for both expand and jump (make expand higher priority.)
imap <C-j> <Plug>(coc-snippets-expand-jump)
" Use <leader>x for convert visual selected code to snippet
xmap <leader>x <Plug>(coc-convert-snippet)
let g:coc_global_extensions = [ let g:coc_global_extensions = [
\ 'coc-yank', 'coc-vimlsp', 'coc-prettier', 'coc-eslint', \ '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-json', 'coc-go', 'coc-html', 'coc-css', 'coc-clangd'
\ ] \ ]
" 'coc-rust-analyzer',
" vim-jsx " vim-jsx
@ -33,8 +59,9 @@ else
endif endif
" ? idk " ? idk
inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : coc#refresh() "inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" "inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! Show_documentation() function! Show_documentation()

View file

@ -7,6 +7,8 @@ endif
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'branwright1/salvation-vim'
Plug 'tpope/vim-repeat' Plug 'tpope/vim-repeat'
Plug 'junegunn/goyo.vim', {'on': 'Goyo'} Plug 'junegunn/goyo.vim', {'on': 'Goyo'}
@ -61,8 +63,20 @@ call plug#begin('~/.vim/plugged')
Plug 'pechorin/any-jump.vim' Plug 'pechorin/any-jump.vim'
Plug 'justinmk/vim-sneak' Plug 'justinmk/vim-sneak'
Plug 'psliwka/vim-smoothie' Plug 'psliwka/vim-smoothie'
Plug 'editorconfig/editorconfig-vim'
Plug 'honza/vim-snippets'
Plug 'liuchengxu/vista.vim'
" Language Plugins ----------------------------------------------------- {{{ " Language Plugins ----------------------------------------------------- {{{
"Plug 'satabin/hocon-vim'
Plug 'GEverding/vim-hocon'
Plug 'LnL7/vim-nix' Plug 'LnL7/vim-nix'
Plug 'kien/rainbow_parentheses.vim' Plug 'kien/rainbow_parentheses.vim'
@ -92,5 +106,7 @@ call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', {'branch': 'release'}
" }}} " }}}
call plug#end() call plug#end()

View file

@ -3,6 +3,7 @@ vnoremap <silent> <leader> :<c-u>'WhichKeyVisual '<Space>'<CR>
let g:which_key_map = {} let g:which_key_map = {}
call which_key#register('<Space>', "g:which_key_map") call which_key#register('<Space>', "g:which_key_map")
let g:which_key_map = { let g:which_key_map = {
\ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore', \ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore',
\ 'f' : 'which_key_ignore', 's': 'which_key_ignore' , \ 'f' : 'which_key_ignore', 's': 'which_key_ignore' ,
@ -25,10 +26,11 @@ let g:which_key_map['m'] = {
\ 't' : [ '<Plug>(coc-type-definition)' , 'show type definition' ] , \ 't' : [ '<Plug>(coc-type-definition)' , 'show type definition' ] ,
\ 'i' : [ '<Plug>(coc-implementation)' , 'show implementation' ] , \ 'i' : [ '<Plug>(coc-implementation)' , 'show implementation' ] ,
\ 'r' : [ '<Plug>(coc-references)' , 'show references' ] , \ 'r' : [ '<Plug>(coc-references)' , 'show references' ] ,
\ 'b' : [ '<Plug>(coc-refactor)' , 'refactor' ] ,
\ 'n' : [ '<Plug>(coc-rename)' , 'rename' ] , \ 'n' : [ '<Plug>(coc-rename)' , 'rename' ] ,
\ 'F' : [ '<Plug>(coc-format-selected)' , 'format selection' ] , \ 'F' : [ '<Plug>(coc-format-selected)' , 'format selection' ] ,
\ 'f' : [ '<Plug>(coc-format)' , 'format file' ] , \ 'f' : [ '<Plug>(coc-format)' , 'format file' ] ,
\ 'v' : [ '<Plug>(coc-codeaction)' , 'apply codeaction' ] , \ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] ,
\ 'V' : [ '<Plug>(coc-fix-current)' , 'apply quickfix' ] , \ 'V' : [ '<Plug>(coc-fix-current)' , 'apply quickfix' ] ,
\ 'e' : [ ':CocList diagnostics' , 'list all errors' ] , \ 'e' : [ ':CocList diagnostics' , 'list all errors' ] ,
\ 'L' : [ '<Plug>(coc-diagnostics-next)' , 'go to next error' ] , \ 'L' : [ '<Plug>(coc-diagnostics-next)' , 'go to next error' ] ,