A collection of scripts and configurations for Bash (and others)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 line
2.9KB

  1. " Configuration borrowed from...
  2. " https://github.com/OmniSharp/omnisharp-vim
  3. " Use the stdio version of OmniSharp-roslyn - this is the default
  4. let g:OmniSharp_server_stdio = 1
  5. let g:OmniSharp_server_use_mono = 1
  6. augroup omnisharp_commands
  7. autocmd!
  8. " Show type information automatically when the cursor stops moving.
  9. " Note that the type is echoed to the Vim command line, and will overwrite
  10. " any other messages in this space including e.g. ALE linting messages.
  11. autocmd CursorHold *.cs OmniSharpTypeLookup
  12. " The following commands are contextual, based on the cursor position.
  13. autocmd FileType cs nmap <silent> <buffer> gd <Plug>(omnisharp_go_to_definition)
  14. autocmd FileType cs nmap <silent> <buffer> <Leader>osfu <Plug>(omnisharp_find_usages)
  15. autocmd FileType cs nmap <silent> <buffer> <Leader>osfi <Plug>(omnisharp_find_implementations)
  16. autocmd FileType cs nmap <silent> <buffer> <Leader>ospd <Plug>(omnisharp_preview_definition)
  17. autocmd FileType cs nmap <silent> <buffer> <Leader>ospi <Plug>(omnisharp_preview_implementations)
  18. autocmd FileType cs nmap <silent> <buffer> <Leader>ost <Plug>(omnisharp_type_lookup)
  19. autocmd FileType cs nmap <silent> <buffer> <Leader>osd <Plug>(omnisharp_documentation)
  20. autocmd FileType cs nmap <silent> <buffer> <Leader>osfs <Plug>(omnisharp_find_symbol)
  21. autocmd FileType cs nmap <silent> <buffer> <Leader>osfx <Plug>(omnisharp_fix_usings)
  22. autocmd FileType cs nmap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)
  23. autocmd FileType cs imap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)
  24. " Navigate up and down by method/property/field
  25. autocmd FileType cs nmap <silent> <buffer> [[ <Plug>(omnisharp_navigate_up)
  26. autocmd FileType cs nmap <silent> <buffer> ]] <Plug>(omnisharp_navigate_down)
  27. " Find all code errors/warnings for the current solution and populate the quickfix window
  28. autocmd FileType cs nmap <silent> <buffer> <Leader>osgcc <Plug>(omnisharp_global_code_check)
  29. " Contextual code actions (uses fzf, vim-clap, CtrlP or unite.vim selector when available)
  30. autocmd FileType cs nmap <silent> <buffer> <Leader>osca <Plug>(omnisharp_code_actions)
  31. autocmd FileType cs xmap <silent> <buffer> <Leader>osca <Plug>(omnisharp_code_actions)
  32. " Repeat the last code action performed (does not use a selector)
  33. autocmd FileType cs nmap <silent> <buffer> <Leader>os. <Plug>(omnisharp_code_action_repeat)
  34. autocmd FileType cs xmap <silent> <buffer> <Leader>os. <Plug>(omnisharp_code_action_repeat)
  35. autocmd FileType cs nmap <silent> <buffer> <Leader>os= <Plug>(omnisharp_code_format)
  36. autocmd FileType cs nmap <silent> <buffer> <Leader>osnm <Plug>(omnisharp_rename)
  37. autocmd FileType cs nmap <silent> <buffer> <Leader>osre <Plug>(omnisharp_restart_server)
  38. autocmd FileType cs nmap <silent> <buffer> <Leader>osst <Plug>(omnisharp_start_server)
  39. autocmd FileType cs nmap <silent> <buffer> <Leader>ossp <Plug>(omnisharp_stop_server)
  40. augroup END