vimperator-labs
vimperator-labs copied to clipboard
New tab right next to the current tab
Issue type:
- Feature request
Version:
Vimperator: 3.16.0 (created: 2017/02/01 00:55:15)
Firefox: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0
Description:
When using t or any other command that open a new tab, it always opens new tab at the end of all tabs, but when I close the new using d, it will focus on the last tab instead of the tab when I create the closed new tab (previous tab, related issue #435), although I can use :q to focus on the previous tab according the context of #435, but I still want to open new tab right next to the current one. Some tab-related add-ons can do that.
So please define a variable to let us choose to open a new tab right next to the current tab or at the end of all tabs.
Put the following code to vimperatorrc. It provides the same functionality like you wished.
" open new tab next to the current tab
js<<EOF
function tabnextto(args) {
let n = gBrowser.tabContainer.selectedIndex;
liberator.execute(':tabopen ' + args);
liberator.execute(':tabmove ' + (n + 1));
}
EOF
command! tabnextto -nargs=* -complete=url :js tabnextto('<args>')
nnoremap t :tabnextto<Space>
Thanks, it works for t command, but like I said,
When using `t` or any other commands that open a new tab
If you search "new tab" in :helpall page, there are multiple commands doing something in new tab, like T, P, gP, gH, :downloads, etc., so I think it is better to modify the underlying code.
It is cool if Vimperator implements all features of Tab Mix Plus plugin, but the right way is to just install it. By the way, there is a minor bug in the master branch with the selection of new tab, I have just sent a pull request #774 with the fix.