From 3dec2f4dc4c95e36962e3457460183b696a76188 Mon Sep 17 00:00:00 2001 From: "Eric D. Rohler" Date: Sat, 20 Apr 2019 21:53:25 -0400 Subject: [PATCH] update init.vim --- init.vim | 246 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 150 insertions(+), 96 deletions(-) diff --git a/init.vim b/init.vim index 0c1579e..0d00de9 100644 --- a/init.vim +++ b/init.vim @@ -1,3 +1,5 @@ +filetype plugin on + " set rtp+=~/.fzf " disable compatability @@ -27,104 +29,12 @@ set cursorline " show the matching part of the pair for [] {} and () set showmatch -" enable all Python syntax highlighting features -let python_highlight_all = 1 -autocmd FileType python set sw=4 -autocmd FileType python set ts=4 -autocmd FileType python set sts=4 - -" Spell Checking -autocmd BufRead,BufNewFile *.md set spell spelllang=en_us - -call plug#begin('~/AppData/Local/nvim/plugged') -Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -Plug 'tpope/vim-unimpaired' -" Plug 'junegunn/fzf.vim', { 'dir': '~/.fzf', 'do': './install --all' } -Plug 'tpope/vim-scriptease', {'type': 'opt'} -Plug 'jeffkreeftmeijer/vim-numbertoggle' - -Plug 'oranget/vim-csharp' - -" Git integration -Plug 'tpope/vim-fugitive' -Plug 'airblade/vim-gitgutter' - -" Code Completion -if has('nvim') - Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } - Plug 'zchee/deoplete-jedi' -else - Plug 'Shougo/deoplete.nvim' - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' - Plug 'zchee/deoplete-jedi' -endif - -" Terminal Utils -Plug 'mklabs/split-term.vim' - -" Languages -Plug 'pangloss/vim-javascript' " javascript -Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } " Go -Plug 'vim-ruby/vim-ruby' " Ruby -Plug 'OmniSharp/omnisharp-vim' " C# - -" Frameworks -Plug 'tpope/vim-rails' - -" Snippets -Plug 'SirVer/ultisnips' - -" Powerline/Airline Styling -Plug 'vim-airline/vim-airline' - -" Syntax -Plug 'vim-syntastic/syntastic' - -" Editor Utils -Plug 'tpope/vim-surround' -Plug 'ctrlpvim/ctrlp.vim' -Plug 'mattn/emmet-vim' -Plug 'nathanaelkane/vim-indent-guides' - -" Linting -Plug 'neomake/neomake' - -" Comments -Plug 'tpope/vim-commentary' - -call plug#end() - -let NERDTreeShowHidden=1 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#syntastic#enabled = 1 -let g:airline#extensions#syntastic#error_symbol = 'E:' -let g:airline#extensions#syntastic#stl_format_err = '%E{[%e(#%fe)]}' -let g:airline#extensions#syntastic#error_symbol = 'W:' -let g:airline#extensions#syntastic#stl_format_warn = '%W{[%w(#%fw)]}' -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 -let g:deoplete#enable_at_startup = 1 - -" Python Env -let g:python_host_prog = 'C:\Python27\python' -let g:python3_host_prog = 'C:\Python37\python' - -" Roslyn Compiler -let g:OmniSharp_selector_ui = 'ctrlp' -let g:OmniSharp_server_type = 'roslyn' -let g:OmniSharp_prefer_global_sln = 1 -let g:OmniSharp_timeout = 10 - -let mapleder = ',' - -" Ctrl + f open file directory -map :NERDTreeToggle -nnoremap :FZF +" Map jk to inoremap jk +" Map leader to , +let mapleder = ',' + " Splitting " nnoremap "Split down " nnoremap "Split up @@ -132,3 +42,147 @@ inoremap jk " nnoremap "Split left set splitbelow set splitright + +" Python Env +" enable all Python syntax highlighting features +let python_highlight_all = 1 +autocmd FileType python set sw=4 +autocmd FileType python set ts=4 +autocmd FileType python set sts=4 +let g:python_host_prog = 'C:\Python27\python' +let g:python3_host_prog = 'C:\Python37\python' + +" Spell Checking +autocmd BufRead,BufNewFile *.md set spell spelllang=en_us + +call plug#begin('~/AppData/Local/nvim/plugged') + Plug 'vim-airline/vim-airline' " Powerline/Airline Styling + Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " File viewer + Plug 'tpope/vim-unimpaired' " Bracket mapping + Plug 'tpope/vim-scriptease', {'type': 'opt'} " Vim Script Editing + Plug 'jeffkreeftmeijer/vim-numbertoggle' " Toggles relative numbers + Plug 'vim-syntastic/syntastic' " Syntax + Plug 'tpope/vim-surround' " Surrounding pairs mapping + Plug 'ctrlpvim/ctrlp.vim' " Fuzzy File Search + " Plug 'junegunn/fzf.vim', { 'dir': '~/.fzf', 'do': './install --all' } " Fuzzy File Search + Plug 'nathanaelkane/vim-indent-guides' " Indent + Plug 'mklabs/split-term.vim' " Terminal splitting + Plug 'SirVer/ultisnips' " Snippets + Plug 'neomake/neomake' " Linting + Plug 'tpope/vim-commentary' " Comments + + " Git integration + Plug 'tpope/vim-fugitive' + Plug 'airblade/vim-gitgutter' + + " Code Completion + if has('nvim') + Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } + Plug 'zchee/deoplete-jedi' + else + Plug 'Shougo/deoplete.nvim' + Plug 'roxma/nvim-yarp' + Plug 'roxma/vim-hug-neovim-rpc' + Plug 'zchee/deoplete-jedi' + endif + + Plug 'mattn/emmet-vim' " HTML editing + + " Languages + Plug 'pangloss/vim-javascript' " javascript + Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } " Go + Plug 'vim-ruby/vim-ruby' " Ruby + Plug 'oranget/vim-csharp' " C# + + " Compilers + Plug 'OmniSharp/omnisharp-vim' " C# + + " Frameworks + Plug 'tpope/vim-rails' + +call plug#end() + +" NERDTree +let NERDTreeShowHidden=1 +" Ctrl + f open file directory +map :NERDTreeToggle +" nnoremap :FZF + +" Airline +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#syntastic#enabled = 1 +let g:airline#extensions#syntastic#error_symbol = 'E:' +let g:airline#extensions#syntastic#stl_format_err = '%E{[%e(#%fe)]}' +let g:airline#extensions#syntastic#error_symbol = 'W:' +let g:airline#extensions#syntastic#stl_format_warn = '%W{[%w(#%fw)]}' + +" Syntastic +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 + +" Deoplete +let g:deoplete#enable_at_startup = 1 + +" OmniSharp +let g:OmniSharp_selector_ui = 'ctrlp' +let g:OmniSharp_server_type = 'roslyn' +let g:OmniSharp_prefer_global_sln = 1 +let g:OmniSharp_timeout = 10 +let g:OmniSharp_highlight_types = 1 +augroup omnisharp_commands + autocmd! + + " When Syntastic is available but not ALE, automatic syntax check on events + " (TextChanged requires Vim 7.4) + " autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck + + " Show type information automatically when the cursor stops moving + autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() + + " Update the highlighting whenever leaving insert mode + autocmd InsertLeave *.cs call OmniSharp#HighlightBuffer() + + " Alternatively, use a mapping to refresh highlighting for the current buffer + autocmd FileType cs nnoremap th :OmniSharpHighlightTypes + + " The following commands are contextual, based on the cursor position. + autocmd FileType cs nnoremap gd :OmniSharpGotoDefinition + autocmd FileType cs nnoremap fi :OmniSharpFindImplementations + autocmd FileType cs nnoremap fs :OmniSharpFindSymbol + autocmd FileType cs nnoremap fu :OmniSharpFindUsages + + " Finds members in the current buffer + autocmd FileType cs nnoremap fm :OmniSharpFindMembers + + autocmd FileType cs nnoremap fx :OmniSharpFixUsings + autocmd FileType cs nnoremap tt :OmniSharpTypeLookup + autocmd FileType cs nnoremap dc :OmniSharpDocumentation + autocmd FileType cs nnoremap :OmniSharpSignatureHelp + autocmd FileType cs inoremap :OmniSharpSignatureHelp + + " Navigate up and down by method/property/field + autocmd FileType cs nnoremap :OmniSharpNavigateUp + autocmd FileType cs nnoremap :OmniSharpNavigateDown +augroup END + +" Contextual code actions (uses fzf, CtrlP or unite.vim when available) +nnoremap :OmniSharpGetCodeActions +" Run code actions with text selected in visual mode to extract method +xnoremap :call OmniSharp#GetCodeActions('visual') + +" Rename with dialog +nnoremap nm :OmniSharpRename +nnoremap :OmniSharpRename +" Rename without dialog - with cursor on the symbol to rename: `:Rename newname` +command! -nargs=1 Rename :call OmniSharp#RenameTo("") + +nnoremap cf :OmniSharpCodeFormat + +" Start the omnisharp server for the current solution +nnoremap ss :OmniSharpStartServer +nnoremap sp :OmniSharpStopServer + +" Enable snippet completion +" let g:OmniSharp_want_snippet=1 \ No newline at end of file