Browse Source

Small additions and modifications to VIM config... Added OmniSharp plugin for C# dev. Switched theme.

master
Bryan Miller 3 years ago
parent
commit
c4eeb0daec
No known key found for this signature in database
3 changed files with 61 additions and 0 deletions
  1. +9
    -0
      vim/.vimrc
  2. +49
    -0
      vim/cs.vim
  3. +3
    -0
      vim/plugins.vim

+ 9
- 0
vim/.vimrc View File

@@ -1,6 +1,13 @@
so ~/.vim/plugins.vim
so ~/.vim/cs.vim
"so ~/.vim/wal.vim

colorscheme zenburn
"colorscheme wal.vim

" Defaults for OmniSharp
so ~/.vim/cs.vim
" -- DONE

if exists('$SHELL')
set shell=$SHELL
@@ -30,4 +37,6 @@ set expandtab
set shiftwidth=2
set softtabstop=2

" Setting .ejs files to be highlighted like html files...
au BufNewFile,BufRead *.ejs set filetype=html


+ 49
- 0
vim/cs.vim View File

@@ -0,0 +1,49 @@
" Configuration borrowed from...
" https://github.com/OmniSharp/omnisharp-vim

" Use the stdio version of OmniSharp-roslyn - this is the default
let g:OmniSharp_server_stdio = 1
let g:OmniSharp_server_use_mono = 1


augroup omnisharp_commands
autocmd!

" Show type information automatically when the cursor stops moving.
" Note that the type is echoed to the Vim command line, and will overwrite
" any other messages in this space including e.g. ALE linting messages.
autocmd CursorHold *.cs OmniSharpTypeLookup

" The following commands are contextual, based on the cursor position.
autocmd FileType cs nmap <silent> <buffer> gd <Plug>(omnisharp_go_to_definition)
autocmd FileType cs nmap <silent> <buffer> <Leader>osfu <Plug>(omnisharp_find_usages)
autocmd FileType cs nmap <silent> <buffer> <Leader>osfi <Plug>(omnisharp_find_implementations)
autocmd FileType cs nmap <silent> <buffer> <Leader>ospd <Plug>(omnisharp_preview_definition)
autocmd FileType cs nmap <silent> <buffer> <Leader>ospi <Plug>(omnisharp_preview_implementations)
autocmd FileType cs nmap <silent> <buffer> <Leader>ost <Plug>(omnisharp_type_lookup)
autocmd FileType cs nmap <silent> <buffer> <Leader>osd <Plug>(omnisharp_documentation)
autocmd FileType cs nmap <silent> <buffer> <Leader>osfs <Plug>(omnisharp_find_symbol)
autocmd FileType cs nmap <silent> <buffer> <Leader>osfx <Plug>(omnisharp_fix_usings)
autocmd FileType cs nmap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)
autocmd FileType cs imap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)

" Navigate up and down by method/property/field
autocmd FileType cs nmap <silent> <buffer> [[ <Plug>(omnisharp_navigate_up)
autocmd FileType cs nmap <silent> <buffer> ]] <Plug>(omnisharp_navigate_down)
" Find all code errors/warnings for the current solution and populate the quickfix window
autocmd FileType cs nmap <silent> <buffer> <Leader>osgcc <Plug>(omnisharp_global_code_check)
" Contextual code actions (uses fzf, vim-clap, CtrlP or unite.vim selector when available)
autocmd FileType cs nmap <silent> <buffer> <Leader>osca <Plug>(omnisharp_code_actions)
autocmd FileType cs xmap <silent> <buffer> <Leader>osca <Plug>(omnisharp_code_actions)
" Repeat the last code action performed (does not use a selector)
autocmd FileType cs nmap <silent> <buffer> <Leader>os. <Plug>(omnisharp_code_action_repeat)
autocmd FileType cs xmap <silent> <buffer> <Leader>os. <Plug>(omnisharp_code_action_repeat)

autocmd FileType cs nmap <silent> <buffer> <Leader>os= <Plug>(omnisharp_code_format)

autocmd FileType cs nmap <silent> <buffer> <Leader>osnm <Plug>(omnisharp_rename)

autocmd FileType cs nmap <silent> <buffer> <Leader>osre <Plug>(omnisharp_restart_server)
autocmd FileType cs nmap <silent> <buffer> <Leader>osst <Plug>(omnisharp_start_server)
autocmd FileType cs nmap <silent> <buffer> <Leader>ossp <Plug>(omnisharp_stop_server)
augroup END

+ 3
- 0
vim/plugins.vim View File

@@ -12,6 +12,7 @@ Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'airblade/vim-gitgutter'
Plugin 'bf4/vim-dark_eyes'
Plugin 'OmniSharp/omnisharp-vim'
Plugin 'jnurmine/Zenburn'

" All of your Plugins must be added before the following line
@@ -28,3 +29,5 @@ filetype plugin indent on " required
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"
"

Loading…
Cancel
Save