Anonymous Anonymous - 1 month ago
8026 0
Other

Errors on opening a cs file

Error detected while processing C:\Users\Matt.Redmond\vimfile\vimplug\plugged\omnisharp-vim\autoload\OmniSharp.vim:
line   17:
E121: Undefined variable: g:OmniSharp_server_ports
Error detected while processing function OmniSharp#TypeLookupWithoutDocumentation[1]..OmniSharp#TypeLookup:
line    2:
E121: Undefined variable: g:OmniSharp_typeLookupInPreview
Press ENTER or type command to continue
Error detected while processing function OmniSharp#TypeLookupWithoutDocumentation[1]..OmniSharp#TypeLookup:
line    2:
E15: Invalid expression: g:OmniSharp_typeLookupInPreview || a:includeDocumentation
Bash

.gvimrc

"""""""""""""""""
""General Setup""
"""""""""""""""""
set number

colorscheme torte 

"Setup font
if has("gui_running")
	if has("gui_gtk2")
		set guifont=Inconsolata\ 12
	elseif has("gui_win32")
		set guifont=Consolas:h11:cANSI
	endif
endif

"Hide menu 
:set guioptions -=T
"Hide toolbar
":set guioptions -=m 

"Enable Windows copy and paste 
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <ESC>"+pa

""""""""""""""""""
""Vim-Plug Setup""
""""""""""""""""""
call plug#begin('~/vimfile/vimplug/plugged')

Plug 'OmniSharp/omnisharp-vim'

Plug 'w0rp/ale'

call plug#end()

"""""""""""""""""""
""OmniSharp Setup""
"""""""""""""""""""

" Note: this is required for the plugin to work
filetype indent plugin on

" Use the stdio OmniSharp-roslyn server
let g:OmniSharp_server_stdio = 1

" Set the type lookup function to use the preview window instead of echoing it
"let g:OmniSharp_typeLookupInPreview = 1

" Timeout in seconds to wait for a response from the server
let g:OmniSharp_timeout = 5

" Don't autoselect first omnicomplete option, show options even if there is only
" one (so the preview documentation is accessible). Remove 'preview' if you
" don't want to see any documentation whatsoever.
set completeopt=longest,menuone,preview

" Fetch full documentation during omnicomplete requests.
" By default, only Type/Method signatures are fetched. Full documentation can
" still be fetched when you need it with the :OmniSharpDocumentation command.
"let g:omnicomplete_fetch_full_documentation = 1

" Set desired preview window height for viewing documentation.
" You might also want to look at the echodoc plugin.
set previewheight=5

" Tell ALE to use OmniSharp for linting C# files, and no other linters.
let g:ale_linters = { 'cs': ['OmniSharp'] }

" Update semantic highlighting after all text changes
let g:OmniSharp_highlight_types = 3
" Update semantic highlighting on BufEnter and InsertLeave
" let g:OmniSharp_highlight_types = 2

augroup omnisharp_commands
    autocmd!

    " Show type information automatically when the cursor stops moving
    autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation()

    " 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>

    " Find all code errors/warnings for the current solution and populate the quickfix window
    autocmd FileType cs nnoremap <buffer> <Leader>cc :OmniSharpGlobalCodeCheck<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
Other

:scriptnames before loading CS file

1: C:\Program Files (x86)\Vim\_vimrc
  2: C:\Program Files (x86)\Vim\vim81\vimrc_example.vim
  3: C:\Program Files (x86)\Vim\vim81\defaults.vim
  4: C:\Program Files (x86)\Vim\vim81\syntax\syntax.vim
  5: C:\Program Files (x86)\Vim\vim81\syntax\synload.vim
  6: C:\Program Files (x86)\Vim\vim81\syntax\syncolor.vim
  7: C:\Program Files (x86)\Vim\vim81\filetype.vim
  8: C:\Program Files (x86)\Vim\vim81\menu.vim
  9: C:\Program Files (x86)\Vim\vim81\autoload\paste.vim
 10: C:\Program Files (x86)\Vim\vim81\ftplugin.vim
 11: C:\Program Files (x86)\Vim\vim81\indent.vim
 12: C:\Program Files (x86)\Vim\vim81\plugin\getscriptPlugin.vim
 13: C:\Program Files (x86)\Vim\vim81\plugin\gzip.vim
 14: C:\Program Files (x86)\Vim\vim81\plugin\logiPat.vim
 15: C:\Program Files (x86)\Vim\vim81\plugin\manpager.vim
 16: C:\Program Files (x86)\Vim\vim81\plugin\matchparen.vim
 17: C:\Program Files (x86)\Vim\vim81\plugin\netrwPlugin.vim
 18: C:\Program Files (x86)\Vim\vim81\plugin\rrhelper.vim
 19: C:\Program Files (x86)\Vim\vim81\plugin\spellfile.vim
 20: C:\Program Files (x86)\Vim\vim81\plugin\tarPlugin.vim
 21: C:\Program Files (x86)\Vim\vim81\plugin\tohtml.vim
 22: C:\Program Files (x86)\Vim\vim81\plugin\vimballPlugin.vim
 23: C:\Program Files (x86)\Vim\vim81\plugin\zipPlugin.vim
 24: C:\Program Files (x86)\Vim\vim81\pack\dist\opt\matchit\plugin\matchit.vim
 25: ~\.gvimrc
 26: C:\Program Files (x86)\Vim\vim81\colors\torte.vim
 27: ~\vimfiles\autoload\plug.vim
 28: C:\Program Files (x86)\Vim\vim81\ftoff.vim
 29: ~\vimfile\vimplug\plugged\omnisharp-vim\ftdetect\cake.vim
 30: ~\vimfile\vimplug\plugged\omnisharp-vim\ftdetect\csx.vim
Other

:scriptnames after loading cs file

1: C:\Program Files (x86)\Vim\_vimrc
  2: C:\Program Files (x86)\Vim\vim81\vimrc_example.vim
  3: C:\Program Files (x86)\Vim\vim81\defaults.vim
  4: C:\Program Files (x86)\Vim\vim81\syntax\syntax.vim
  5: C:\Program Files (x86)\Vim\vim81\syntax\synload.vim
  6: C:\Program Files (x86)\Vim\vim81\syntax\syncolor.vim
  7: C:\Program Files (x86)\Vim\vim81\filetype.vim
  8: C:\Program Files (x86)\Vim\vim81\menu.vim
  9: C:\Program Files (x86)\Vim\vim81\autoload\paste.vim
 10: C:\Program Files (x86)\Vim\vim81\ftplugin.vim
 11: C:\Program Files (x86)\Vim\vim81\indent.vim
 12: C:\Program Files (x86)\Vim\vim81\plugin\getscriptPlugin.vim
 13: C:\Program Files (x86)\Vim\vim81\plugin\gzip.vim
 14: C:\Program Files (x86)\Vim\vim81\plugin\logiPat.vim
 15: C:\Program Files (x86)\Vim\vim81\plugin\manpager.vim
 16: C:\Program Files (x86)\Vim\vim81\plugin\matchparen.vim
 17: C:\Program Files (x86)\Vim\vim81\plugin\netrwPlugin.vim
 18: C:\Program Files (x86)\Vim\vim81\plugin\rrhelper.vim
 19: C:\Program Files (x86)\Vim\vim81\plugin\spellfile.vim
 20: C:\Program Files (x86)\Vim\vim81\plugin\tarPlugin.vim
 21: C:\Program Files (x86)\Vim\vim81\plugin\tohtml.vim
 22: C:\Program Files (x86)\Vim\vim81\plugin\vimballPlugin.vim
 23: C:\Program Files (x86)\Vim\vim81\plugin\zipPlugin.vim
 24: C:\Program Files (x86)\Vim\vim81\pack\dist\opt\matchit\plugin\matchit.vim
 25: ~\.gvimrc
 26: C:\Program Files (x86)\Vim\vim81\colors\torte.vim
 27: ~\vimfiles\autoload\plug.vim
 28: C:\Program Files (x86)\Vim\vim81\ftoff.vim
 29: ~\vimfile\vimplug\plugged\omnisharp-vim\ftdetect\cake.vim
 30: ~\vimfile\vimplug\plugged\omnisharp-vim\ftdetect\csx.vim
 31: C:\Program Files (x86)\Vim\vim81\syntax\cs.vim
 32: C:\Program Files (x86)\Vim\vim81\syntax\xml.vim
 33: C:\Program Files (x86)\Vim\vim81\syntax\dtd.vim
 34: ~\vimfile\vimplug\plugged\omnisharp-vim\ftplugin\cs\OmniSharp.vim
 35: C:\Program Files (x86)\Vim\vim81\ftplugin\cs.vim
 36: C:\Program Files (x86)\Vim\vim81\indent\cs.vim
 37: ~\vimfile\vimplug\plugged\omnisharp-vim\autoload\OmniSharp.vim
 38: ~\vimfile\vimplug\plugged\omnisharp-vim\autoload\OmniSharp\util.vim
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download