Vim: can global marks switch tabs instead of the file in the current tab?
Tabs may not be the best way to do what you are trying to do. When a file is open, it isn't necessarily open in just one tab. It's open in a buffer, which is a concept not tied to a tab.
In fact, you can have the same buffer open in multiple tabs (or even multiple panes within the same tab). A tab is more like a window into one or more of your currently open buffers.
It may be better to learn about how to switch between buffers in your current tab or pane. Just a suggestion.
The problem is that the mark-jumping commands are designed to move to the mark within the current window as there can theoretically be many windows to the same file. You need to switch to a new window first using :sbuf
or :tabnext
or CTRL+WW. If you have set switchbuf=useopen,usetab
then using :sbuf <otherfile>
first will be sufficient to jump to the other tab where your file is open. But 'A will not create a new window for you (or re-use an existing one in another tab).
You can probably create a mapping for '
and `
which uses getpos()
, setpos()
, :sbuf
and switchbuf
to jump to an existing window in another tab, but it would involve writing a page of vimscript.
See :help switchbuf
and :help getpos()
and :help setpos()
.