diff --git a/init.vim b/init.vim index b2ce090..c42d4f7 100644 --- a/init.vim +++ b/init.vim @@ -18,14 +18,13 @@ endif let mapleader ="\" -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 " =============== @@ -148,7 +150,7 @@ vnoremap K let g:VM_leader = 'm' -autocmd BufReadPost * :DetectIndent +autocmd BufReadPost * :DetectIndent let g:detectindent_preferred_expandtab = 1 let g:detectindent_preferred_indent = 2 @@ -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 :Files map f (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() " }}} @@ -223,7 +242,7 @@ autocmd BufWinEnter * :hi airline_tablabel_right ctermbg=NONE guibg=NONE ctermfg " :: and _ as space {{{ function RebindShit(newKey) - let b:RemappedSpace={ + let b:RemappedSpace={ \ 'old': maparg("", "i"), \ 'cur': a:newKey \ } @@ -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 diff --git a/lsp.vim b/lsp.vim index f56c068..ed81c9b 100644 --- a/lsp.vim +++ b/lsp.vim @@ -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 to trigger completion. -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif +inoremap coc#refresh() -" ? idk + "? idk "inoremap pumvisible() ? "\" : check_back_space() ? "\" : coc#refresh() "inoremap pumvisible() ? "\" : "\" - +" Show documentation for vim stuff, and run doHover otherWise function! Show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') @@ -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 (coc-funcobj-i) +omap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap af (coc-funcobj-a) +xmap ic (coc-classobj-i) +omap ic (coc-classobj-i) +xmap ac (coc-classobj-a) +omap ac (coc-classobj-a) + + " Snippet stuff {{{ diff --git a/plugins.vim b/plugins.vim index c6eb5a6..85f7859 100644 --- a/plugins.vim +++ b/plugins.vim @@ -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 diff --git a/whichkeyConfig.vim b/whichkeyConfig.vim index b24c2cd..00844b0 100644 --- a/whichkeyConfig.vim +++ b/whichkeyConfig.vim @@ -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' : [ '(coc-definition)' , 'go to definition' ] , \ 't' : [ '(coc-type-definition)' , 'show type definition' ] , \ 'i' : [ '(coc-implementation)' , 'show implementation' ] , - \ 'r' : [ '(coc-references)' , 'show references' ] , + \ 'r' : [ '(coc-references-used)' , 'show references' ] , \ 'b' : [ '(coc-refactor)' , 'refactor' ] , \ 'n' : [ '(coc-rename)' , 'rename' ] , \ 'F' : [ '(coc-format-selected)' , 'format selection' ] , \ 'f' : [ '(coc-format)' , 'format file' ] , \ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] , - \ 'V' : [ '(coc-fix-current)' , 'apply quickfix' ] , + \ 'V' : [ '(coc-codeaction)' , 'codeaction current buffer' ] , \ 'e' : [ ':CocList diagnostics' , 'list all errors' ] , - \ 'L' : [ '(coc-diagnostics-next)' , 'go to next error' ] , - \ 'H' : [ '(coc-diagnostics-prev)' , 'go to prev error' ] , + \ 'L' : [ '(coc-diagnostic-next)' , 'go to next error' ] , + \ 'H' : [ '(coc-diagnostic-prev)' , 'go to prev error' ] , + \ 'a' : [ '(coc-diagnostic-info)' , 'diagnostics info' ] , + \ 'O' : [ '(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 m :WhichKey 'm' autocmd! VimEnter * :unmap ig autocmd! FileType which_key - autocmd! FileType which_key set laststatus=2 noshowmode noruler - \| autocmd! BufLeave set laststatus=2 showmode ruler + "autocmd! FileType which_key set laststatus=2 noshowmode noruler + "\| autocmd! BufLeave set laststatus=2 showmode ruler set timeoutlen=200