Skip to content

Instantly share code, notes, and snippets.

@hcs42
Created September 25, 2014 12:00
Show Gist options
  • Save hcs42/ce008b393e827c87e16b to your computer and use it in GitHub Desktop.
Save hcs42/ce008b393e827c87e16b to your computer and use it in GitHub Desktop.
Make <c-w><c-]> work with vim-erlang-tags
function! VimErlangTagsSelectSplit()
split
let orig_isk = &isk
set isk+=:
normal "_vawo
if getline('.')[col('.') - 2] =~# '[#?]'
normal h
endif
let &isk = orig_isk
endfunction
function! VimErlangTagsDefineMappings()
nnoremap <buffer> <c-]> :call VimErlangTagsSelect()<cr><c-]>
nnoremap <buffer> g<LeftMouse> :call VimErlangTagsSelect()<cr>g<LeftMouse>
nnoremap <buffer> <c-LeftMouse> :call VimErlangTagsSelect()<cr><c-LeftMouse>
nnoremap <buffer> g] :call VimErlangTagsSelect()<cr>g]
nnoremap <buffer> g<c-]> :call VimErlangTagsSelect()<cr>g<c-]>
nnoremap <buffer> <c-w><c-]> :call VimErlangTagsSelectSplit()<cr><c-]>
nnoremap <buffer> <c-w>] :call VimErlangTagsSelectSplit()<cr><c-]>
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment