Here is a quick and dirty hack that meets your needs.
let s:marks = {}
function! s:Mark(name)
echomsg "new mark: " a:name
" todo: record the winnr/bufnr as well
let s:marks[a:name] = tabpagenr()
exe 'normal! m'.a:name
endfunction
function! s:Jump(how, name)
if has_key(s:marks, a:name)
let nr = s:marks[a:name]
tabfirst
let first = tabpagenr()
while tabpagenr() != nr
tabnext
if tabpagenr() == first
break
endif
endwhile
if tabpagenr() == nr
exe 'normal! '.a:how.a:name
" nominal termination
return
endif
endif
echoerr "tab-mark " . a:name . " not set"
endfunction
nnoremap m :call <sid>Mark(nr2char(getchar()))<cr>
nnoremap ` :call <sid>Jump('`', nr2char(getchar()))<cr>
nnoremap ' :call <sid>Jump("'", nr2char(getchar()))<cr>
Questions:
- Values
for each buffer are usually common. Here all the tags are global. Perhaps we should instead display \m, \', ang\*backtick*
This does not allow for split windows.
source
share