diff --git a/config/01-plugins.vim b/config/01-plugins.vim index 75da041..84ae0c9 100644 --- a/config/01-plugins.vim +++ b/config/01-plugins.vim @@ -35,6 +35,7 @@ if(g:have_plug) 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') @@ -42,15 +43,16 @@ if(g:have_plug) endif Plug 'mattn/emmet-vim' " ZenCoding Plug 'sheerun/vim-polyglot' " Language Support Bundle + Plug 'ianks/vim-tsx' - " Plug 'quramy/vim-js-pretty-template'" Syntax highlight inside template strings + " Plug 'quramy/vim-js-pretty-template' " Syntax highlight inside template strings " Plug 'quramy/tsuquyomi' " Language server support for TypeScript " Plug 'heavenshell/vim-jsdoc' " Generate JSDoc comments " Quality of life - Plug 'edkolev/tmuxline.vim' + " Plug 'edkolev/tmuxline.vim' Plug 'jez/vim-superman' " Man page viewer Plug 'mhinz/vim-signify' " Gutter signs, git, et al. @@ -60,15 +62,8 @@ if(g:have_plug) Plug 'w0rp/ale' " Asynchronous Linting Plug 'sbdchd/neoformat' " Automatic code formatting - Plug 'autozimu/LanguageClient-neovim', { - \ 'branch': 'next', - \ 'do': 'bash install.sh', - \ } " Lanugage Server Support - Plug 'junegunn/fzf' " Multi-entry selection UI for LanguageClient - - Plug 'Shougo/deoplete.nvim' " Autocomplete Support - Plug 'roxma/nvim-yarp' " nvim plugin support - Plug 'roxma/vim-hug-neovim-rpc' + Plug 'neoclide/coc.nvim', {'branch': 'release'} + Plug 'OmniSharp/omnisharp-vim' Plug 'ruanyl/coverage.vim' " Code Coverage Support endif @@ -93,27 +88,69 @@ let g:airline#extensions#ale#enabled = 1 let g:ale_sign_column_always = 1 let g:ale_sign_error = '' let g:ale_sign_warning = '' -let g:ale_linters = { - \ 'html': [ 'tsserver' ], - \ } -let g:ale_fixers = { - \ 'javascript': [ 'eslint' ], - \ } -let g:ale_linter_aliases = { 'html': ['ts'] } let g:ale_fix_on_save = 1 " let g:ale_completion_enabled = 1 +let g:ale_linters = { + \ 'typescript': ['tsserver'], + \ 'typescript.tsx': ['tsserver'], + \ 'cs': ['OmniSharp'] + \} + let g:coverage_json_report_path = 'coverage/coverage-final.json' let g:coverage_sign_covered = '' let g:coverage_sign_uncovered = '' let g:signify_vcs_list = [ 'git' ] +let g:LanguageClient_waitOutputTimeout = 1 let g:LanguageClient_serverCommands = { - \ 'typescript': ['typescript-language-server', '--stdio'], - \ 'javascript': ['javascript-typescript-stdio'], - \ 'javascript.jsx': ['javascript-typescript-stdio'], - \ 'dockerfile': ['docker-langserver', '--stdio'], + \ 'typescript': ['javascript-typescript-stdio'], + \ 'typescript.tsx': ['javascript-typescript-stdio'], \ } let g:deoplete#enable_at_startup = 1 + +let g:neoformat_nginx_nginxbeautifier = { + \ 'exe': 'nginxbeautifier', + \ 'replace': 1, + \ } + +let g:neoformat_enabled_nginx = ['nginxbeautifier'] + +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'], + \ 'csUserInterface': ['interface name'], + \ 'csUserMethod': ['extension method name', 'method name'], + \ 'csUserType': ['class name', 'enum name', 'namespace name', 'struct name'] + \} +let g:OmniSharp_highlight_types = 2 + +sign define OmniSharpCodeActions text=💡 +augroup OSCountCodeActions + autocmd! + autocmd FileType cs set signcolumn=yes + autocmd CursorHold *.cs call OSCountCodeActions() +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) +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 + endif +endfunction diff --git a/config/02-general.vim b/config/02-general.vim index d13b24a..7e83ed6 100644 --- a/config/02-general.vim +++ b/config/02-general.vim @@ -43,7 +43,7 @@ nnoremap k gk imap jk " set wildignore+=*/Deploy/*,*/node_modules/*,*/build/*,*/lib/*,*/bower_components/*,*/jspm_packages/* -set completeopt=longest,menu,menuone +set completeopt=longest,menuone,preview " Stolen from maralla/dotvim function! EnsureExists(path) abort diff --git a/config/03-mappings.vim b/config/03-mappings.vim index 6b56dd4..a355ee1 100644 --- a/config/03-mappings.vim +++ b/config/03-mappings.vim @@ -29,8 +29,10 @@ nmap p (ale_hover) nmap D (ale_go_to_definition) nmap U (ale_find_references) -let g:ctrlp_funky_syntax_highlight = 1 -nnoremap f :CtrlPFunky +" let g:ctrlp_funky_syntax_highlight = 1 +" nnoremap f :CtrlPFunky -nnoremap :call LanguageClient_contextMenu() -nnoremap :call LanguageClient_textDocument_codeAction() +" nnoremap :call LanguageClient_contextMenu() +" nnoremap :call LanguageClient_textDocument_codeAction() +" nmap D :call LanguageClient_textDocument_definition() +" nmap p :call LanguageClient_textDocument_hover() diff --git a/config/04-autocmds.vim b/config/04-autocmds.vim index 11ce01d..0272e2b 100644 --- a/config/04-autocmds.vim +++ b/config/04-autocmds.vim @@ -53,15 +53,40 @@ 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 - \ } + " 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 au! au BufNewFile,BufRead *.dockerfile setf dockerfile augroup END + + augroup Svelte + au! + au BufNewFile,BufRead *.svelte setf html.svelte + + augroup END + + augroup Omnisharp + au! + autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() + + autocmd FileType cs nnoremap D :OmniSharpGotoDefinition + autocmd FileType cs nnoremap cc :OmniSharpGlobalCodeCheck + autocmd FileType cs nnoremap :OmniSharpGetCodeActions + + augroup END endif