Skip to content

Commit

Permalink
Map the new no_build test mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
nickspoons committed Mar 2, 2022
1 parent 8f434e9 commit 04231db
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 29 deletions.
61 changes: 32 additions & 29 deletions README.md
Expand Up @@ -158,35 +158,38 @@ The mappings all use a common prefix, except for these exceptions: `gd`, `<C-\>`

The full list of mappings is as follows:

|Action |LHS |Full default mapping |
|----------------------------------|------------|------------------------------------------------------------------------------------|
|Go to definition |`gd` |`nmap <silent> <buffer> gd <Plug>(omnisharp_go_to_definition)` |
|Find usages |prefix+`fu` |`nmap <silent> <buffer> <LocalLeader>osfu <Plug>(omnisharp_find_usages)` |
|Find implementations |prefix+`fi` |`nmap <silent> <buffer> <LocalLeader>osfi <Plug>(omnisharp_find_implementations)` |
|Preview definition |prefix+`pd` |`nmap <silent> <buffer> <LocalLeader>ospd <Plug>(omnisharp_preview_definition)` |
|Preview implementations |prefix+`pi` |`nmap <silent> <buffer> <LocalLeader>ospi <Plug>(omnisharp_preview_implementations)`|
|Type lookup |prefix+`t` |`nmap <silent> <buffer> <LocalLeader>ost <Plug>(omnisharp_type_lookup)` |
|Show documentation |prefix+`d` |`nmap <silent> <buffer> <LocalLeader>osd <Plug>(omnisharp_documentation)` |
|Find symbol |prefix+`fs` |`nmap <silent> <buffer> <LocalLeader>osfs <Plug>(omnisharp_find_symbol)` |
|Find type |prefix+`ft` |`nmap <silent> <buffer> <LocalLeader>osft <Plug>(omnisharp_find_type)` |
|Fix usings |prefix+`fx` |`nmap <silent> <buffer> <LocalLeader>osfx <Plug>(omnisharp_fix_usings)` |
|Signature help (normal) |`<C-\>` |`nmap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)` |
|Signature help (insert) |`<C-\>` |`imap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)` |
|Navigate up |`[[` |`nmap <silent> <buffer> [[ <Plug>(omnisharp_navigate_up)` |
|Navigate down |`]]` |`nmap <silent> <buffer> ]] <Plug>(omnisharp_navigate_down)` |
|Global code check |prefix+`gcc`|`nmap <silent> <buffer> <LocalLeader>osgcc <Plug>(omnisharp_global_code_check)` |
|Code actions (normal) |prefix+`ca` |`nmap <silent> <buffer> <LocalLeader>osca <Plug>(omnisharp_code_actions)` |
|Code actions (visual) |prefix+`ca` |`xmap <silent> <buffer> <LocalLeader>osca <Plug>(omnisharp_code_actions)` |
|Repeat last code action (normal) |prefix+`.` |`nmap <silent> <buffer> <LocalLeader>os. <Plug>(omnisharp_code_action_repeat)` |
|Repeat last code action (visual) |prefix+`.` |`xmap <silent> <buffer> <LocalLeader>os. <Plug>(omnisharp_code_action_repeat)` |
|Rename |prefix+`nm` |`nmap <silent> <buffer> <LocalLeader>osnm <Plug>(omnisharp_rename)` |
|Code format |prefix+`=` |`nmap <silent> <buffer> <LocalLeader>os= <Plug>(omnisharp_code_format)` |
|Restart server |prefix+`re` |`nmap <silent> <buffer> <LocalLeader>osre <Plug>(omnisharp_restart_server)` |
|Start server |prefix+`st` |`nmap <silent> <buffer> <LocalLeader>osst <Plug>(omnisharp_start_server)` |
|Stop server |prefix+`sp` |`nmap <silent> <buffer> <LocalLeader>ossp <Plug>(omnisharp_stop_server)` |
|Run test under cursor |prefix+`rt` |`nmap <silent> <buffer> <LocalLeader>osrt <Plug>(omnisharp_run_test)` |
|Run all tests in file |prefix+`rat`|`nmap <silent> <buffer> <LocalLeader>osrat <Plug>(omnisharp_run_tests_in_file)` |
|Debug test under cursor |prefix+`rdt` |`nmap <silent> <buffer> <LocalLeader>osrdt <Plug>(omnisharp_debug_test)` |
|Action |LHS |Full default mapping |
|----------------------------------|-------------|-----------------------------------------------------------------------------------------|
|Go to definition |`gd` |`nmap <silent> <buffer> gd <Plug>(omnisharp_go_to_definition)` |
|Find usages |prefix+`fu` |`nmap <silent> <buffer> <LocalLeader>osfu <Plug>(omnisharp_find_usages)` |
|Find implementations |prefix+`fi` |`nmap <silent> <buffer> <LocalLeader>osfi <Plug>(omnisharp_find_implementations)` |
|Preview definition |prefix+`pd` |`nmap <silent> <buffer> <LocalLeader>ospd <Plug>(omnisharp_preview_definition)` |
|Preview implementations |prefix+`pi` |`nmap <silent> <buffer> <LocalLeader>ospi <Plug>(omnisharp_preview_implementations)` |
|Type lookup |prefix+`t` |`nmap <silent> <buffer> <LocalLeader>ost <Plug>(omnisharp_type_lookup)` |
|Show documentation |prefix+`d` |`nmap <silent> <buffer> <LocalLeader>osd <Plug>(omnisharp_documentation)` |
|Find symbol |prefix+`fs` |`nmap <silent> <buffer> <LocalLeader>osfs <Plug>(omnisharp_find_symbol)` |
|Find type |prefix+`ft` |`nmap <silent> <buffer> <LocalLeader>osft <Plug>(omnisharp_find_type)` |
|Fix usings |prefix+`fx` |`nmap <silent> <buffer> <LocalLeader>osfx <Plug>(omnisharp_fix_usings)` |
|Signature help (normal) |`<C-\>` |`nmap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)` |
|Signature help (insert) |`<C-\>` |`imap <silent> <buffer> <C-\> <Plug>(omnisharp_signature_help)` |
|Navigate up |`[[` |`nmap <silent> <buffer> [[ <Plug>(omnisharp_navigate_up)` |
|Navigate down |`]]` |`nmap <silent> <buffer> ]] <Plug>(omnisharp_navigate_down)` |
|Global code check |prefix+`gcc` |`nmap <silent> <buffer> <LocalLeader>osgcc <Plug>(omnisharp_global_code_check)` |
|Code actions (normal) |prefix+`ca` |`nmap <silent> <buffer> <LocalLeader>osca <Plug>(omnisharp_code_actions)` |
|Code actions (visual) |prefix+`ca` |`xmap <silent> <buffer> <LocalLeader>osca <Plug>(omnisharp_code_actions)` |
|Repeat last code action (normal) |prefix+`.` |`nmap <silent> <buffer> <LocalLeader>os. <Plug>(omnisharp_code_action_repeat)` |
|Repeat last code action (visual) |prefix+`.` |`xmap <silent> <buffer> <LocalLeader>os. <Plug>(omnisharp_code_action_repeat)` |
|Rename |prefix+`nm` |`nmap <silent> <buffer> <LocalLeader>osnm <Plug>(omnisharp_rename)` |
|Code format |prefix+`=` |`nmap <silent> <buffer> <LocalLeader>os= <Plug>(omnisharp_code_format)` |
|Restart server |prefix+`re` |`nmap <silent> <buffer> <LocalLeader>osre <Plug>(omnisharp_restart_server)` |
|Start server |prefix+`st` |`nmap <silent> <buffer> <LocalLeader>osst <Plug>(omnisharp_start_server)` |
|Stop server |prefix+`sp` |`nmap <silent> <buffer> <LocalLeader>ossp <Plug>(omnisharp_stop_server)` |
|Run test under cursor |prefix+`rt` |`nmap <silent> <buffer> <LocalLeader>osrt <Plug>(omnisharp_run_test)` |
|Run test under cursor (no build) |prefix+`rnt` |`nmap <silent> <buffer> <LocalLeader>osrnt <Plug>(omnisharp_run_test_no_build)` |
|Run all tests in file |prefix+`rat` |`nmap <silent> <buffer> <LocalLeader>osrat <Plug>(omnisharp_run_tests_in_file)` |
|Run all tests in file (no build) |prefix+`rant`|`nmap <silent> <buffer> <LocalLeader>osrant <Plug>(omnisharp_run_tests_in_file_no_build)`|
|Debug test under cursor |prefix+`rdt` |`nmap <silent> <buffer> <LocalLeader>osrdt <Plug>(omnisharp_debug_test)` |
|Debug test under cursor (no build)|prefix+`rdnt`|`nmap <silent> <buffer> <LocalLeader>osrdnt <Plug>(omnisharp_debug_test_no_build)` |

The default prefix is `<LocalLeader>os`.
Vim's default local-leader is `\` which means that the default prefixed mappings all begin with `\os`.
Expand Down
3 changes: 3 additions & 0 deletions ftplugin/cs/sharpenup.vim
Expand Up @@ -62,8 +62,11 @@ if get(g:, 'sharpenup_create_mappings', 1)
call s:map('n', s:pre . 'sp', 'omnisharp_stop_server')

call s:map('n', s:pre . 'rt', 'omnisharp_run_test')
call s:map('n', s:pre . 'rnt', 'omnisharp_run_test_no_build')
call s:map('n', s:pre . 'rat', 'omnisharp_run_tests_in_file')
call s:map('n', s:pre . 'rant', 'omnisharp_run_tests_in_file_no_build')
call s:map('n', s:pre . 'rdt', 'omnisharp_debug_test')
call s:map('n', s:pre . 'rdnt', 'omnisharp_debug_test_no_build')
endif

if get(g:, 'sharpenup_map_legacy_csproj_actions', 1)
Expand Down

0 comments on commit 04231db

Please sign in to comment.