update init.vim

This commit is contained in:
Eric D. Rohler 2019-04-20 21:53:25 -04:00
parent 0df091c2be
commit 3dec2f4dc4

148
init.vim
View File

@ -1,3 +1,5 @@
filetype plugin on
" set rtp+=~/.fzf " set rtp+=~/.fzf
" disable compatability " disable compatability
@ -27,23 +29,47 @@ set cursorline
" show the matching part of the pair for [] {} and () " show the matching part of the pair for [] {} and ()
set showmatch set showmatch
" Map jk to <ESC>
inoremap jk <Esc>
" Map leader to ,
let mapleder = ','
" Splitting
" nnoremap <C-J> <C-W><C-J> "Split down
" nnoremap <C-K> <C-W><C-K> "Split up
" nnoremap <C-L> <C-W><C-L> "Split right
" nnoremap <C-H> <C-W><C-H> "Split left
set splitbelow
set splitright
" Python Env
" enable all Python syntax highlighting features " enable all Python syntax highlighting features
let python_highlight_all = 1 let python_highlight_all = 1
autocmd FileType python set sw=4 autocmd FileType python set sw=4
autocmd FileType python set ts=4 autocmd FileType python set ts=4
autocmd FileType python set sts=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 " Spell Checking
autocmd BufRead,BufNewFile *.md set spell spelllang=en_us autocmd BufRead,BufNewFile *.md set spell spelllang=en_us
call plug#begin('~/AppData/Local/nvim/plugged') call plug#begin('~/AppData/Local/nvim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'vim-airline/vim-airline' " Powerline/Airline Styling
Plug 'tpope/vim-unimpaired' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " File viewer
" Plug 'junegunn/fzf.vim', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'tpope/vim-unimpaired' " Bracket mapping
Plug 'tpope/vim-scriptease', {'type': 'opt'} Plug 'tpope/vim-scriptease', {'type': 'opt'} " Vim Script Editing
Plug 'jeffkreeftmeijer/vim-numbertoggle' Plug 'jeffkreeftmeijer/vim-numbertoggle' " Toggles relative numbers
Plug 'vim-syntastic/syntastic' " Syntax
Plug 'oranget/vim-csharp' 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 " Git integration
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
@ -60,75 +86,103 @@ else
Plug 'zchee/deoplete-jedi' Plug 'zchee/deoplete-jedi'
endif endif
" Terminal Utils Plug 'mattn/emmet-vim' " HTML editing
Plug 'mklabs/split-term.vim'
" Languages " Languages
Plug 'pangloss/vim-javascript' " javascript Plug 'pangloss/vim-javascript' " javascript
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } " Go Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } " Go
Plug 'vim-ruby/vim-ruby' " Ruby Plug 'vim-ruby/vim-ruby' " Ruby
Plug 'oranget/vim-csharp' " C#
" Compilers
Plug 'OmniSharp/omnisharp-vim' " C# Plug 'OmniSharp/omnisharp-vim' " C#
" Frameworks " Frameworks
Plug 'tpope/vim-rails' 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() call plug#end()
" NERDTree
let NERDTreeShowHidden=1 let NERDTreeShowHidden=1
" Ctrl + f open file directory
map <C-f> :NERDTreeToggle<CR>
" nnoremap <C-p> :<C-u>FZF<CR>
" Airline
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#syntastic#enabled = 1 let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#syntastic#error_symbol = 'E:' let g:airline#extensions#syntastic#error_symbol = 'E:'
let g:airline#extensions#syntastic#stl_format_err = '%E{[%e(#%fe)]}' let g:airline#extensions#syntastic#stl_format_err = '%E{[%e(#%fe)]}'
let g:airline#extensions#syntastic#error_symbol = 'W:' let g:airline#extensions#syntastic#error_symbol = 'W:'
let g:airline#extensions#syntastic#stl_format_warn = '%W{[%w(#%fw)]}' let g:airline#extensions#syntastic#stl_format_warn = '%W{[%w(#%fw)]}'
" Syntastic
let g:syntastic_always_populate_loc_list = 1 let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1 let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1 let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0 let g:syntastic_check_on_wq = 0
" Deoplete
let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_at_startup = 1
" Python Env " OmniSharp
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_selector_ui = 'ctrlp'
let g:OmniSharp_server_type = 'roslyn' let g:OmniSharp_server_type = 'roslyn'
let g:OmniSharp_prefer_global_sln = 1 let g:OmniSharp_prefer_global_sln = 1
let g:OmniSharp_timeout = 10 let g:OmniSharp_timeout = 10
let g:OmniSharp_highlight_types = 1
augroup omnisharp_commands
autocmd!
let mapleder = ',' " When Syntastic is available but not ALE, automatic syntax check on events
" (TextChanged requires Vim 7.4)
" autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck
" Ctrl + f open file directory " Show type information automatically when the cursor stops moving
map <C-f> :NERDTreeToggle<CR> autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation()
nnoremap <C-p> :<C-u>FZF<CR>
inoremap jk <Esc>
" Splitting " Update the highlighting whenever leaving insert mode
" nnoremap <C-J> <C-W><C-J> "Split down autocmd InsertLeave *.cs call OmniSharp#HighlightBuffer()
" nnoremap <C-K> <C-W><C-K> "Split up
" nnoremap <C-L> <C-W><C-L> "Split right " Alternatively, use a mapping to refresh highlighting for the current buffer
" nnoremap <C-H> <C-W><C-H> "Split left autocmd FileType cs nnoremap <buffer> <Leader>th :OmniSharpHighlightTypes<CR>
set splitbelow
set splitright " The following commands are contextual, based on the cursor position.
autocmd FileType cs nnoremap <buffer> gd :OmniSharpGotoDefinition<CR>
autocmd FileType cs nnoremap <buffer> <Leader>fi :OmniSharpFindImplementations<CR>
autocmd FileType cs nnoremap <buffer> <Leader>fs :OmniSharpFindSymbol<CR>
autocmd FileType cs nnoremap <buffer> <Leader>fu :OmniSharpFindUsages<CR>
" Finds members in the current buffer
autocmd FileType cs nnoremap <buffer> <Leader>fm :OmniSharpFindMembers<CR>
autocmd FileType cs nnoremap <buffer> <Leader>fx :OmniSharpFixUsings<CR>
autocmd FileType cs nnoremap <buffer> <Leader>tt :OmniSharpTypeLookup<CR>
autocmd FileType cs nnoremap <buffer> <Leader>dc :OmniSharpDocumentation<CR>
autocmd FileType cs nnoremap <buffer> <C-\> :OmniSharpSignatureHelp<CR>
autocmd FileType cs inoremap <buffer> <C-\> <C-o>:OmniSharpSignatureHelp<CR>
" Navigate up and down by method/property/field
autocmd FileType cs nnoremap <buffer> <C-k> :OmniSharpNavigateUp<CR>
autocmd FileType cs nnoremap <buffer> <C-j> :OmniSharpNavigateDown<CR>
augroup END
" Contextual code actions (uses fzf, CtrlP or unite.vim when available)
nnoremap <Leader><Space> :OmniSharpGetCodeActions<CR>
" Run code actions with text selected in visual mode to extract method
xnoremap <Leader><Space> :call OmniSharp#GetCodeActions('visual')<CR>
" Rename with dialog
nnoremap <Leader>nm :OmniSharpRename<CR>
nnoremap <F2> :OmniSharpRename<CR>
" Rename without dialog - with cursor on the symbol to rename: `:Rename newname`
command! -nargs=1 Rename :call OmniSharp#RenameTo("<args>")
nnoremap <Leader>cf :OmniSharpCodeFormat<CR>
" Start the omnisharp server for the current solution
nnoremap <Leader>ss :OmniSharpStartServer<CR>
nnoremap <Leader>sp :OmniSharpStopServer<CR>
" Enable snippet completion
" let g:OmniSharp_want_snippet=1