This commit is contained in:
elkowar 2020-11-21 16:04:14 +01:00
parent 38948c1104
commit a1a68fb74b
4 changed files with 72 additions and 52 deletions

View file

@ -18,14 +18,13 @@ endif
let mapleader ="\<Space>"
let g:signify_sign_show_text = 1
" Vanilla VIM configuration ------------------------------------ {{{
filetype plugin indent on
syntax on
set noshowmode " mode is already shown in airline
set foldmethod=marker
set undodir=~/.vim/undo-dir
set undofile
@ -69,11 +68,15 @@ let &t_ut=''
highlight EndOfBuffer ctermfg=black ctermbg=black
hi Pmenu ctermbg=black guibg='#1d2021'
hi PmenuSel guibg='#8ec07c'
hi PmenuSbar guibg='#1d2021'
hi PmenuThumb guibg='#3c3836'
hi WhichKeyFloating ctermbg=black guibg='#282828'
hi NormalFloat ctermbg=black guibg='#1d2021'
hi Pmenu ctermbg=black guibg='#1d2021'
hi SignColumn ctermbg=NONE guibg='#282828'
hi WhichKeyFloating ctermbg=black guibg='#282828'
hi link Function GruvboxGreen
@ -117,7 +120,6 @@ augroup basics
autocmd BufRead,BufNewFile *.ddl setlocal filetype=sql
augroup END
highlight Pmenu ctermbg=black guibg=black
" ===============
@ -179,6 +181,13 @@ let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
let g:qs_lazy_highlight = 1
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
nnoremap <C-p> :Files<CR>
map <Leader>f <Plug>(easymotion-bd-f)
@ -189,6 +198,11 @@ let g:signify_sign_add = '▍'
let g:signify_sign_delete = '▍'
let g:signify_sign_delete_first_line = '▍'
let g:signify_sign_change = '▍'
let g:signify_sign_show_text = 1
hi SignifySignDelete cterm=NONE gui=NONE guifg='#fb4934'
hi SignifySignChange cterm=NONE gui=NONE guifg='#83a598'
hi SignifySignAdd cterm=NONE gui=NONE guifg='#8ec07c'
" Airline {{{
@ -210,10 +224,15 @@ let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}'
let g:airline_theme='elkowars_gruvbox'
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
" update airline themes properly... idk why this is so weird
function! s:update_highlights()
hi airline_tabfill ctermbg=NONE guibg=NONE
hi airline_a_to_airline_b ctermbg=NONE guibg='#ff0000'
hi airline_b_to_airline_c ctermbg=NONE guibg='#ff0000'
hi airline_c_to_airline_x ctermbg=NONE guibg=NONE
hi airline_tablabel_right ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE
endfunction
autocmd User AirlineAfterTheme call s:update_highlights()
" }}}
@ -259,12 +278,6 @@ nnoremap ö a
" }}}
hi SignifyLineDelete cterm=NONE gui=NONE guifg='#ff0000'
hi SignifyLineChange cterm=NONE gui=NONE guifg='#ff0000'
hi SignifyLineAdd cterm=NONE gui=NONE guifg='#ff0000'
source $VIM_ROOT/whichkeyConfig.vim
source $VIM_ROOT/lsp.vim

47
lsp.vim
View file

@ -7,22 +7,19 @@ 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
let g:coc_global_extensions = [
\ 'coc-yank', 'coc-vimlsp', 'coc-prettier', 'coc-eslint',
\ 'coc-diagnostic', 'coc-yaml', 'coc-tsserver',
\ 'coc-json', 'coc-go', 'coc-html', 'coc-css', 'coc-clangd',
\ 'coc-actions'
\ 'coc-actions', 'coc-yank'
\ ]
" 'coc-rust-analyzer',
let g:echodoc#enable_at_startup = 1
let g:echodoc#type = "echo"
" vim-jsx
autocmd! BufRead,BufNewFile *.tsx setlocal syntax=javascript.jsx
@ -32,21 +29,15 @@ let g:user_emmet_settings = { 'javascript': { 'extends': 'jsx' }, 'typescript':
let g:user_emmet_mode='n'
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
inoremap <silent><expr> <c-space> coc#refresh()
" ? idk
"? idk
"inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : <SID>check_back_space() ? "\<TAB>" : coc#refresh()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
" Show documentation for vim stuff, and run doHover otherWise
function! Show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
@ -63,10 +54,6 @@ function! s:check_back_space() abort
endfunction
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
command! -nargs=0 Prettier :CocCommand prettier.formatFile
"Close preview window when completion is done.
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
@ -85,8 +72,26 @@ hi CocUnderline gui=undercurl term=undercurl
hi CocErrorHighlight ctermfg=red guifg=#c4384b gui=undercurl term=undercurl
hi CocWarningHighlight ctermfg=yellow guifg=#c4ab39 gui=undercurl term=undercurl
autocmd CursorHold * silent call CocActionAsync('highlight')
hi link CocWarningSign GruvboxYellow
hi link CocInfoSign GruvboxAqua
hi link CocHintErrorSign GruvboxBlue
hi link CocErrorSign GruvboxRed
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Snippet stuff {{{

View file

@ -73,15 +73,15 @@ call plug#begin('~/.vim/plugged')
Plug 'puremourning/vimspector'
Plug 'svermeulen/vim-yoink'
" Language Plugins ----------------------------------------------------- {{{
"Plug 'satabin/hocon-vim'
Plug 'GEverding/vim-hocon'
Plug 'Shougo/echodoc.vim'
Plug 'kien/rainbow_parentheses.vim'
" Language Plugins ----------------------------------------------------- {{{
Plug 'LnL7/vim-nix'
Plug 'kien/rainbow_parentheses.vim'
Plug 'kevinoid/vim-jsonc'
Plug 'ap/vim-css-color'
Plug 'pangloss/vim-javascript' " syntax highlighting JS

View file

@ -25,21 +25,23 @@ let g:which_key_map['m'] = {
\ 'name' : '+Code-actions' ,
\ 'd' : [ ':call Show_documentation()' , 'show documentation' ] ,
\ 's' : [ ':CocFzfList symbols' , 'list symbols' ] ,
\ 'o' : [ ':CocFzfList outline' , 'show outline' ] ,
\ 'c' : [ ':CocFzfList commands' , 'show all coc-commands' ] ,
\ 'o' : [ ':CocFzfList outline' , 'show outline' ] ,
\ 'c' : [ ':CocFzfList commands' , 'show all coc-commands' ] ,
\ 'g' : [ '<Plug>(coc-definition)' , 'go to definition' ] ,
\ 't' : [ '<Plug>(coc-type-definition)' , 'show type definition' ] ,
\ 'i' : [ '<Plug>(coc-implementation)' , 'show implementation' ] ,
\ 'r' : [ '<Plug>(coc-references)' , 'show references' ] ,
\ 'r' : [ '<Plug>(coc-references-used)' , 'show references' ] ,
\ 'b' : [ '<Plug>(coc-refactor)' , 'refactor' ] ,
\ 'n' : [ '<Plug>(coc-rename)' , 'rename' ] ,
\ 'F' : [ '<Plug>(coc-format-selected)' , 'format selection' ] ,
\ 'f' : [ '<Plug>(coc-format)' , 'format file' ] ,
\ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] ,
\ 'V' : [ '<Plug>(coc-fix-current)' , 'apply quickfix' ] ,
\ 'V' : [ '<Plug>(coc-codeaction)' , 'codeaction current buffer' ] ,
\ 'e' : [ ':CocList diagnostics' , 'list all errors' ] ,
\ 'L' : [ '<Plug>(coc-diagnostics-next)' , 'go to next error' ] ,
\ 'H' : [ '<Plug>(coc-diagnostics-prev)' , 'go to prev error' ] ,
\ 'L' : [ '<Plug>(coc-diagnostic-next)' , 'go to next error' ] ,
\ 'H' : [ '<Plug>(coc-diagnostic-prev)' , 'go to prev error' ] ,
\ 'a' : [ '<Plug>(coc-diagnostic-info)' , 'diagnostics info' ] ,
\ 'O' : [ '<Plug>(coc-openlink)' , 'open link under cursor' ] ,
\}
@ -77,7 +79,7 @@ let g:which_key_map['x'] = {
\ 'h' : [':History:' , 'search command history'],
\ 'c' : [':Commands' , 'search through commands'],
\ 's' : ['OverCommandLine', 'Substitute with preview'],
\ 'y' : [':CocFzfList -A --normal yank', 'Show yank history']
\ 'y' : [':CocFzfList yank', 'Show yank history']
\ }
" CocList -A --normal yank needs :CocInstall coc-yank
@ -87,8 +89,8 @@ let g:which_key_map['x'] = {
"nnoremap <silent> m :<c-u>WhichKey 'm'<CR>
autocmd! VimEnter * :unmap <space>ig
autocmd! FileType which_key
autocmd! FileType which_key set laststatus=2 noshowmode noruler
\| autocmd! BufLeave <buffer> set laststatus=2 showmode ruler
"autocmd! FileType which_key set laststatus=2 noshowmode noruler
"\| autocmd! BufLeave <buffer> set laststatus=2 showmode ruler
set timeoutlen=200