I haven't used utl, but assuming you just want it to do :Utl
, this should work:
function! TryJump()
try
execute "normal! \<c-]>"
catch
Utl
endtry
endfunction
nnoremap <c-]> :call TryJump()<cr>
문제
I'd like to remap Ctrl+] to attempt it's default behavior (ie., jump to a tag if possible), but if that fails to try opening a link using the Utl plugin. My fingers are too hard-wired into trying Ctrl+] to jump that creating a different mapping isn't working out very well. I'm no good at VimL, but this is what I'd like to achieve in pseudo-code:
function TryJump()
try
normal ctrl-]
catch
normal Utl
endtry
endfunction
noremap <c-]> :call TryJump()<cr>
Any ideas?
해결책
I haven't used utl, but assuming you just want it to do :Utl
, this should work:
function! TryJump()
try
execute "normal! \<c-]>"
catch
Utl
endtry
endfunction
nnoremap <c-]> :call TryJump()<cr>