Skip to content

Commit 162b8d1

Browse files
committed
Override <c-w>] key mapping
Just like we override <c-]> (jump to tag) to use ':' as a keyword character, we now also override <c-w>] (split window and jump to tag).
1 parent 3efa61f commit 162b8d1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

plugin/vim-erlang-tags.vim

+11-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ endfunction
5050

5151
command! ErlangTags call VimErlangTags()
5252

53-
function! VimErlangTagsSelect()
53+
function! VimErlangTagsSelect(split)
54+
if a:split
55+
split
56+
endif
5457
let orig_isk = &isk
5558
set isk+=:
5659
normal "_vawo
@@ -61,9 +64,11 @@ function! VimErlangTagsSelect()
6164
endfunction
6265

6366
function! VimErlangTagsDefineMappings()
64-
nnoremap <buffer> <c-]> :call VimErlangTagsSelect()<cr><c-]>
65-
nnoremap <buffer> g<LeftMouse> :call VimErlangTagsSelect()<cr>g<LeftMouse>
66-
nnoremap <buffer> <c-LeftMouse> :call VimErlangTagsSelect()<cr><c-LeftMouse>
67-
nnoremap <buffer> g] :call VimErlangTagsSelect()<cr>g]
68-
nnoremap <buffer> g<c-]> :call VimErlangTagsSelect()<cr>g<c-]>
67+
nnoremap <buffer> <c-]> :call VimErlangTagsSelect(0)<cr><c-]>
68+
nnoremap <buffer> g<LeftMouse> :call VimErlangTagsSelect(0)<cr>g<LeftMouse>
69+
nnoremap <buffer> <c-LeftMouse> :call VimErlangTagsSelect(0)<cr><c-LeftMouse>
70+
nnoremap <buffer> g] :call VimErlangTagsSelect(0)<cr>g]
71+
nnoremap <buffer> g<c-]> :call VimErlangTagsSelect(0)<cr>g<c-]>
72+
nnoremap <buffer> <c-w><c-]> :call VimErlangTagsSelect(1)<cr><c-]>
73+
nnoremap <buffer> <c-w>] :call VimErlangTagsSelect(1)<cr><c-]>
6974
endfunction

0 commit comments

Comments
 (0)