Skip to content

Commit 5e6e5a0

Browse files
committed
Add <Plug> and default testrunner mappings
1 parent f873429 commit 5e6e5a0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

ftplugin/omnisharptest/OmniSharp.vim

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@ set foldlevel=2
66
set foldmethod=syntax
77
set signcolumn=no
88
9-
nnoremap <silent> <buffer> <F1> :call OmniSharp#testrunner#ToggleBanner()<CR>
9+
nnoremap <buffer> <Plug>(omnisharp_testrunner_togglebanner) :call OmniSharp#testrunner#ToggleBanner()<CR>
10+
nnoremap <buffer> <Plug>(omnisharp_testrunner_run) :call OmniSharp#testrunner#Run()<CR>
11+
nnoremap <buffer> <Plug>(omnisharp_testrunner_debug) :call OmniSharp#testrunner#Debug()<CR>
12+
nnoremap <buffer> <Plug>(omnisharp_testrunner_navigate) :call OmniSharp#testrunner#Navigate()<CR>
13+
14+
function! s:map(mode, lhs, plug) abort
15+
let l:rhs = '<Plug>(' . a:plug . ')'
16+
if !hasmapto(l:rhs, substitute(a:mode, 'x', 'v', ''))
17+
execute a:mode . 'map <silent> <buffer>' a:lhs l:rhs
18+
endif
19+
endfunction
20+
21+
call s:map('n', '<F1>', 'omnisharp_testrunner_togglebanner')
22+
call s:map('n', '<F5>', 'omnisharp_testrunner_run')
23+
call s:map('n', '<F6>', 'omnisharp_testrunner_debug')
24+
call s:map('n', '<CR>', 'omnisharp_testrunner_navigate')

0 commit comments

Comments
 (0)