@@ -50,25 +50,29 @@ endfunction
50
50
51
51
command ! ErlangTags call VimErlangTags ()
52
52
53
- function ! VimErlangTagsSelect (split )
54
- if a: split
55
- split
56
- endif
53
+ " Execute the given tag lookup for current word, where 'iskeyword' is
54
+ " temporarily set such that modules, records, and macros are included.
55
+ function ! s: GoToErlangTag (cmd)
57
56
let orig_isk = &isk
58
- set isk += :
59
- normal " _vawo
60
- if getline (' .' )[col (' .' ) - 2 ] = ~# ' [#?]'
61
- normal h
62
- endif
57
+ set isk += :,#,?
58
+ let ident = expand (' <cword>' )
63
59
let &isk = orig_isk
60
+
61
+ execute a: cmd ident
64
62
endfunction
65
63
66
64
function ! VimErlangTagsDefineMappings ()
67
- nnoremap <buffer> <c-]> :call VimErlangTagsSelect(0)<cr><c-]>
68
- nnoremap <buffer> g<LeftMouse> :call VimErlangTagsSelect(0)<cr><c-]>
69
- nnoremap <buffer> <c-LeftMouse> :call VimErlangTagsSelect(0)<cr><c-]>
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-]>
65
+ nnoremap <buffer> <c-]> :<C-U> call <SID> GoToErlangTag('tag')<cr>
66
+ nnoremap <buffer> g<LeftMouse> :<C-U> call <SID> GoToErlangTag('tag')<cr>
67
+ nnoremap <buffer> <c-LeftMouse> :<C-U> call <SID> GoToErlangTag('tag')<cr>
68
+ nnoremap <buffer> g] :<C-U> call <SID> GoToErlangTag('tselect')<cr>
69
+ nnoremap <buffer> g<c-]> :<C-U> call <SID> GoToErlangTag('tjump')<cr>
70
+ nnoremap <buffer> <c-w><c-]> :<C-U> call <SID> GoToErlangTag('stag')<cr>
71
+ nnoremap <buffer> <c-w> ] :<C-U> call <SID> GoToErlangTag('stag')<cr>
72
+ nnoremap <buffer> <c-w> g] :<C-U> call <SID> GoToErlangTag('stselect')<cr>
73
+ nnoremap <buffer> <c-w> g<c-]> :<C-U> call <SID> GoToErlangTag('stjump')<cr>
74
+ nnoremap <buffer> <c-w> } :<C-U> call <SID> GoToErlangTag('ptag')<cr>
75
+ nnoremap <buffer> <c-w> g} :<C-U> call <SID> GoToErlangTag('ptjump')<cr>
74
76
endfunction
77
+
78
+ " vim:set expandtab sw = 4 ts = 4 :
0 commit comments