1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.25k stars 326 forks source link

Doesn't open a new tab when open :bookmark #685

Closed Armog closed 3 years ago

Armog commented 5 years ago

When we use "b" to open bookmarks, bookmark opens in current tab, but not in a new tab. It is not useful if you want to open a new bookmark from the current worked tab. Thanks for cVim!

andremeireles commented 5 years ago

Ctrl + Enter

D12EA177E12 commented 5 years ago

@andremeireles Ctrl + Enter doesn't work for me here.

andremeireles commented 5 years ago

@D12EA177E12, maybe there is something wrong by your side. I have tested on vivaldi (chromium based) and opera browsers and just works. Linux and windows

Armog commented 5 years ago

Ctrl + Enter works fine in Chrome and opens bookmark in new tab as well. Maybe it will be handy if bookmarks open without additional shortcut. For example, in case with 't' (open tab) URL opens in new tab by default.

andremeireles commented 5 years ago

I read the doc and saw that is possible remap the b shortcut permanetly on cvim's options, like you want whit this snnipet:

map b :bookmarks!<space> - will works like t but for bookmarks.

I think it doesn't come by default this way because it's a specific case. Not all people want a bookmark to open in a new tab.

conceptrat commented 4 years ago

When you use the bookmarks shortcut "b" it essentially triggers the command mode ":bookmarks " and goes straight to searching bookmarks. Because the "bookmarks" command opens links you can apply the properties mentioned in the "Tabs" section of the cVim Help here https://github.com/1995eaton/chromium-vim#tabs.

So press "b". Then search/select the bookmark you want to open, add the property(s) at the end and press [ENTER] or you can backspace one character type in the property(s) first, then a [SPACE], then select the bookmark and press [ENTER]. To open the bookmark in a newtab use "!", a new window "$" and a new incognito window "|". And if you don't want it to be focused (load in background) then also add "&".

For example after pressing "b" and doing everything but pressing [ENTER] you might see this in the command window:

:bookmarks https://slashdot.org/$&

Which would open the bookmark "https://slashdot.org/" in a new window in the background (not focussed).