From 5a42a0c8e1dc7e0566fc52119b5537ba1397c59a Mon Sep 17 00:00:00 2001 From: Vasili Svirydau Date: Mon, 28 Oct 2019 10:40:50 -0700 Subject: [PATCH] Merged down, some fixes, prepping for re-org --- config/01-plugins.vim | 49 ++++++++++++++---------------------------- config/02-general.vim | 12 +++++------ config/03-mappings.vim | 22 ------------------- config/04-autocmds.vim | 37 ++++++++----------------------- 4 files changed, 31 insertions(+), 89 deletions(-) diff --git a/config/01-plugins.vim b/config/01-plugins.vim index 621f7ad..b13220a 100644 --- a/config/01-plugins.vim +++ b/config/01-plugins.vim @@ -18,14 +18,12 @@ if(g:have_plug) Plug 'ctrlpvim/ctrlp.vim' " Fuzzy search Plug 'editorconfig/editorconfig-vim' " EditorConfig.org support - " Plug 'ivyl/vim-bling' " blink search results if executable('ag') Plug 'rking/ag.vim' " Silver Searcher Support endif if executable('rg') Plug 'jremmen/vim-ripgrep' " RipGrep endif - " Plug 'tacahiroy/ctrlp-funky' " Fuzzy in-buffer search Plug 'tommcdo/vim-lion' " Align stuff Plug 'tpope/vim-abolish' " Case Convert and other stuff Plug 'tpope/vim-commentary' " Commenting @@ -33,34 +31,22 @@ if(g:have_plug) Plug 'tpope/vim-surround' " Surround with quotes Plug 'vim-airline/vim-airline' " Status bar Plug 'vim-airline/vim-airline-themes' " Status bar themes - " Plug 'vimwiki/vimwiki' " http://vimwiki.github.io/ Plug 'w0ng/vim-hybrid' " Hybrid colorscheme Plug 'christoomey/vim-sort-motion' " Sort Motions " Language - if executable('rails') - Plug 'tpope/vim-rails' " Rails integration - endif Plug 'mattn/emmet-vim' " ZenCoding Plug 'sheerun/vim-polyglot' " Language Support Bundle Plug 'ianks/vim-tsx' Plug 'OrangeT/vim-csharp' " C# Support - " Plug 'quramy/vim-js-pretty-template' " Syntax highlight inside template strings - " Plug 'heavenshell/vim-jsdoc' " Generate JSDoc comments - - " Quality of life - " Plug 'edkolev/tmuxline.vim' - " Plug 'jez/vim-superman' " Man page viewer " Plug 'mhinz/vim-signify' " Gutter signs, git, et al. - " Plug 'sotte/presenting.vim' " Slides if v:version >= 800 Plug 'w0rp/ale' " Asynchronous Linting Plug 'sbdchd/neoformat' " Automatic code formatting - Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'Shougo/deoplete.nvim' " Autocomplete Support Plug 'ruanyl/coverage.vim' " Code Coverage Support @@ -83,8 +69,6 @@ let g:loaded_netrwPlugin = 1 " Disable netrw let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 -" let g:airline#extensions#ale#enabled = 0 -" let g:airline#extensions#coc#enabled = 1 let g:airline_section_error = '%{airline#util#wrap(airline#extensions#coc#get_error(),0)}' let g:airline_section_warning = '%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' @@ -92,7 +76,6 @@ let g:ale_sign_column_always = 1 let g:ale_sign_error = '' let g:ale_sign_warning = '' let g:ale_fix_on_save = 1 -" let g:ale_completion_enabled = 1 let g:ale_linters = { \ 'typescript': ['tsserver'], @@ -108,17 +91,17 @@ let g:signify_vcs_list = [ 'git' ] let g:neoformat_html_prettier = { \ 'exe': 'prettier', - \ 'typescript': ['typescript-language-server', '--stdio'], - \ 'javascript': ['javascript-typescript-stdio'], - \ 'javascript.jsx': ['javascript-typescript-stdio'], + \ 'typescript': ['typescript-language-server', '--stdio'], + \ 'javascript': ['javascript-typescript-stdio'], + \ 'javascript.jsx': ['javascript-typescript-stdio'], \ } let g:neoformat_enabled_html = ['prettier'] let g:neoformat_nginx_nginxbeautifier = { - \ 'exe': 'nginxbeautifier', - \ 'replace': 1, - \ } + \ 'exe': 'nginxbeautifier', + \ 'replace': 1, + \ } let g:neoformat_enabled_nginx = ['nginxbeautifier'] @@ -126,8 +109,8 @@ let g:OmniSharp_server_stdio = 1 let g:OmniSharp_selector_ui = 'ctrlp' let g:OmniSharp_highlight_groups = { \ 'csUserIdentifier': [ - \ 'constant name', 'enum member name', 'field name', 'identifier', - \ 'local name', 'parameter name', 'property name', 'static symbol'], + \ 'constant name', 'enum member name', 'field name', 'identifier', + \ 'local name', 'parameter name', 'property name', 'static symbol'], \ 'csUserInterface': ['interface name'], \ 'csUserMethod': ['extension method name', 'method name'], \ 'csUserType': ['class name', 'enum name', 'namespace name', 'struct name'] @@ -144,17 +127,17 @@ augroup END function! OSCountCodeActions() abort if bufname('%') ==# '' || OmniSharp#FugitiveCheck() | return | endif if !OmniSharp#IsServerRunning() | return | endif - let opts = { - \ 'CallbackCount': function('s:CBReturnCount'), - \ 'CallbackCleanup': {-> execute('sign unplace 99')} - \} - call OmniSharp#CountCodeActions(opts) + let l:opts = { + \ 'CallbackCount': function('s:CBReturnCount'), + \ 'CallbackCleanup': {-> execute('sign unplace 99')} + \} + call OmniSharp#CountCodeActions(l:opts) endfunction function! s:CBReturnCount(count) abort if a:count - let l = getpos('.')[1] - let f = expand('%:p') - execute ':sign place 99 line='.l.' name=OmniSharpCodeActions file='.f + let l:l = getpos('.')[1] + let l:f = expand('%:p') + execute ':sign place 99 line='.l:l.' name=OmniSharpCodeActions file='.l:f endif endfunction diff --git a/config/02-general.vim b/config/02-general.vim index 253356f..fb13be3 100644 --- a/config/02-general.vim +++ b/config/02-general.vim @@ -1,7 +1,7 @@ set encoding=utf-8 scriptencoding utf-8 -set shortmess=It " turn off splash screen, truncate status on buffer ops +set shortmess=It " turn off splash screen, truncate status on buffer ops set hidden " enable multiple dirty buffers set modelines=0 set number " show line numbers @@ -11,15 +11,15 @@ set wildmode=longest,list set background=dark silent! colorscheme hybrid " let mapleader = '\' "Set before any key remapping -set hlsearch "highlight search results -set ignorecase "ignore capitalization +set hlsearch "highlight search results +set ignorecase "ignore capitalization set smartcase -set cursorline "highlight current line +set cursorline "highlight current line set listchars=tab:▸\ ,eol:¬ - "Invisible character colors +" Invisible character colors " highlight NonText guifg=#4a4a59 " highlight SpecialKey guifg=#4a4a59 -"tab settings +" tab settings set expandtab set shiftwidth=4 set softtabstop=4 diff --git a/config/03-mappings.vim b/config/03-mappings.vim index 139f74e..98f0209 100644 --- a/config/03-mappings.vim +++ b/config/03-mappings.vim @@ -4,9 +4,6 @@ noremap w :update inoremap w :updatea cmap w!! w !sudo tee % >/dev/null -" cmap eh e %:h/ -" cmap wh w %:h/ -" cmap %% %:h cnoremap %% getcmdtype() == ':' ? expand('%:p:h') . '/' : '%%' cnoremap %b getcmdtype() == ':' ? expand('%:p:r') : '%b' @@ -25,25 +22,6 @@ noremap ] :bn noremap [ :bp noremap d :bd -" if exists('g:loaded_ale') - " nmap e[ (ale_previous_wrap) - " nmap e] (ale_next_wrap) - - " nmap p (ale_hover) - " nmap D (ale_go_to_definition) - " nmap U (ale_find_references) -" endif - -" if exists('g:loaded_ctrlp_funky') - " let g:ctrlp_funky_syntax_highlight = 1 - " nnoremap f :CtrlPFunky -" endif - -" if exists('g:LanguageClient_loaded') - " nnoremap :call LanguageClient_contextMenu() - " nnoremap :call LanguageClient_textDocument_codeAction() -" endif - " coc.nvim function! s:check_back_space() abort let l:col = col('.') - 1 diff --git a/config/04-autocmds.vim b/config/04-autocmds.vim index 36ec7a7..4bf5e30 100644 --- a/config/04-autocmds.vim +++ b/config/04-autocmds.vim @@ -13,18 +13,6 @@ endfun augroup END - " augroup CleanWhitespace - " au! - " autocmd BufWritePre * :call StripTrailingWhitespace() - " function! StripTrailingWhitespace() - " let l:pos = getpos('.') - " let l:_s=@/ - " %s/\s\+$//e - " call setpos('.', l:pos) - " let @/=l:_s - " endfun - " augroup END - augroup InsertTimer au! "Autoexit to normal mode after 15 seconds of inactivity @@ -55,20 +43,10 @@ au! autocmd FileType javascript set ai sw=2 sts=2 et - " let g:neoformat_javascript_prettier = { - " \ 'exe' : 'prettier', - " \ 'args': ['--stdin', '--trailing-comma=es5', '--single-quote'], - " \ 'stdin': 1 - " \ } augroup END augroup typescript au! - - " call jspretmpl#register_tag('psql', 'pgsql') - - " autocmd FileType typescript JsPreTmpl pgsql - augroup END augroup Dockerfile @@ -79,15 +57,18 @@ augroup suffixes autocmd! - let associations = [ - \["typescript", ".ts"], - \["typescript", "/index.ts"], - \["javascript", ".js"] + let g:associations = [ + \['typescript', '.ts'], + \['typescript', '/index.ts'], + \['javascript', '.js'] \] - for ft in associations - execute "autocmd FileType " . ft[0] . " setlocal suffixesadd=" . ft[1] + for g:ft in g:associations + execute 'autocmd FileType ' . g:ft[0] . ' setlocal suffixesadd=' . g:ft[1] endfor + + unlet g:associations + unlet g:ft augroup END augroup Omnisharp