Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Compare to plugins like Vimium and Tridactyl #83

Closed
2 tasks
lorenzleutgeb opened this issue Nov 3, 2020 · 30 comments
Closed
2 tasks

docs: Compare to plugins like Vimium and Tridactyl #83

lorenzleutgeb opened this issue Nov 3, 2020 · 30 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lorenzleutgeb
Copy link

lorenzleutgeb commented Nov 3, 2020

I am genuinely interested in Vieb. At the moment I use Firefox with Vimium and TreeStyleTabs, and I have tried Tridactyl. There are other similar plugins available.

I think it would be beneficial for adoption of Vieb if you could provide

  • a comparison of Vieb versus plugin-based solutions like the one I am using now, and
  • migration guides.
@lorenzleutgeb lorenzleutgeb changed the title Compare to plugins like Vimium and Tridactyl docs: Compare to plugins like Vimium and Tridactyl Nov 3, 2020
@Jelmerro
Copy link
Owner

Jelmerro commented Nov 3, 2020

Motivation

The main reason for me to start Vieb was that most plugins at the time that I tried just emulated a few keys and called it a Vim plugin. With Vieb the plan is to make it FEEL a lot more like Vim than the plugins ever did for me. I haven't tried every single plugin, and there might very well be plugins that do this properly. I never did find them, and as such I made Vieb and use it daily. Here are a few things I remember disliking about the plugins back then.

Separate modes

This meant that shortcuts often conflicted with the website shortcuts. A big part of the initial design of Vieb was the clear separation of modes, similar to Vim.

In Vieb, I haven't had an issue like this, because I only use insert mode to type text and very rarely to do other stuff (again, similar to Vim). The mode of Vieb is prominently displayed in the navbar, so there's never any confusion what the pressed keys will do.

Follow mode

Because of the issue above, picking a follow mode item is inconsistent, and sometimes has side-effects. Besides that, most plugins weren't very clear about where it would actually click, as they would show the keys on the topleft of the element, usually obstructing the view to what you would actually click on. Finally, it was fairly unclear what would happen upon clicking something, because you have to assume if it's a button, a link or something else.

In Vieb, a box is shown around the element so you know which element it is and the expected keys are on the topright so they don't overlap the element you wanted to click on. The links are all color coded based on type, and you can choose to open links in the current tab or in a new tab.

Vim-plugin limitations

Due to the nature of browser plugins, many proper integrations that you would expect just aren't possible with web extensions. I don't remember any of them having very useful settings or mappings, but it's also not possible (at least in Firefox) to modify all browser settings from a plugin.

Vieb has :set and :map commands that I personally can't distinguish from Vim in terms of syntax. I'll just end with that for now, otherwise this comment might get even longer.

What else

I can type much more about why I think Vieb is supposedly better, but I don't think that it will really mean anything if I just tell you that I think it's better. For an objective comparison, you need to ask the end-user what they think of it. That includes you, but also most people reading this extensive comment. For me the choice between using a Firefox plugin or Vieb has already been made. Though that doesn't mean that it will be better for everyone.

Conclusion

I hope this provides a bit of background on why I started Vieb. I am not in a position to make a comparison or guide myself, I haven't used these plugins long enough for that, and I also have no reasons to use them over Vieb. For me Vieb is already stable enough to be my daily/main browser for over a year. Therefor it's up to you and other contributors to make such a comparison and guide, much more objectively than I'll ever be able to.

More info

Anyone interested should be able to get a pretty complete list of features by reading through Vieb's :help page and checking the feature list on the official website. It might also help to read the changelog, especially for recently added features.

@Jelmerro Jelmerro added enhancement New feature or request good first issue Good for newcomers help wanted Help wanted with this issue, so PRs are encouraged! labels Nov 3, 2020
@ottopiramuthu
Copy link
Contributor

Regarding migrating, it would be convenient to provide custom viebrc files with the default settings from different vim plugins. This would both lower the learning curve and show new users how to customize Vieb. Maybe these could be linked in the "Examples" subsection of the "Viebrc" section of the help next to the chromium and firefox viebrc example files.

@Jelmerro
Copy link
Owner

Sure, please make pull requests for adding new example configs that emulate vim-plugins or other browsers, that sounds great!

@BachoSeven
Copy link

I might do such an example config, but in the meantime here are just a few bindings which preserve muscle memory from the Vimium plugin:

" Jumping to Omnibar
nmap o <action.toExploreMode>
nmap O <action.openNewTab><action.toExploreMode>
" Copy current url
nmap yy <action.pageToClipboard>
" vimium-like duplicate tab
nmap yt <action.openNewTabWithCurrentUrl><CR>
" Copy links like in vimium (need to press y on the focused link to copy it)
nmap yf <pointer.start><action.startFollowCurrentTab>

@ottopiramuthu
Copy link
Contributor

Here is a more complete viebrc for vimium. Please tell me if there are mistakes. @BachoSeven do you know any of vimium's caret mode mappings that I could use for pointer mode in Vieb?

@BachoSeven
Copy link

BachoSeven commented Apr 20, 2021

@ottopiramuthu from the wiki, I guess the only thing missing is the c binding from visual mode to go back to pointer mode:

vmap c <pointer.start>

Edit: actually you already had that one, so nevermind. However, I found it can improved like this:

vmap c <Esc><pointer.start>

since otherwise the visual selection is not cleared whe going back to caret(pointer) mode. This is closer to how vimium has it.

@BachoSeven
Copy link

Also, a minor issue with your T binding:

nmap T <action.toCommandMode>buffer<Space>

I also had issues trying to map this to correspond to the vimium opened tab selection: it appears that emulating user input through the binding does not activate the command-mode tab-completion, which kind of defeats the purpose of this binding. @Jelmerro do you think there is a way to make the emulated input (i.e. buffer<Space>) activate the tab-completion? this way, pressing T would list the opened tabs, making it easy to see the ids. I can open a new issue if this is something which is not doable atm.

@BachoSeven
Copy link

BachoSeven commented Apr 20, 2021

The only other issue I found is that

vmap 0 <pointer.moveLeftMax>

doesn't work, probably because 0 is recognized as a "count" multiplier, so it does not behave as expected.

Edit: Similarly, the other binding which involves 0 also doesn't work:

nmap g0 <:buffer 0>

@ottopiramuthu
Copy link
Contributor

ottopiramuthu commented Apr 20, 2021

@BachoSeven With this commit the mappings with 0 should work.

@Jelmerro
Copy link
Owner

@BachoSeven The map issue involving numbers should be fixed with the commit mentioned above.

Currently the suggestions only trigger for manual input for performance reasons. Maybe we can also add a check after executing a mapping to see if suggestions should appear, because I don't think it would be good to constantly update them while typing out a long command automatically with a mapping.

@Jelmerro
Copy link
Owner

Does this solve your use case @BachoSeven?

@ottopiramuthu
Copy link
Contributor

I've been trying to make these two mappings from vimium:

ge      edit the current URL
gE      edit the current URL and open in a new tab

Both work like <action.toExploreMode>, except they have the cursor at the right of the current url so the user can edit it.
Without making a new mapping, you can enter explore mode and press the right arrow key or <End> to get rid of the blue highlight and edit the url from the end.

Both nmap ge <action.toExploreMode><Right> and nmap ge <action.toExploreMode><End> delete the url instead of leaving it and moving the cursor to the end. @Jelmerro, is there another way to approach this that I've missed?

@Jelmerro
Copy link
Owner

Because events aren't native, they won't execute the functionality of the operating system (this includes things like copy, right arrow or end etc.). To work around this, we would need to manually implement functionality for these keys. Currently almost all keys are assumed to be characters that can be typed out, see here for the implementation. I would suggest a separate github ticket for keeping track of this.

@BachoSeven
Copy link

BachoSeven commented Apr 21, 2021

Does this solve your use case @BachoSeven?

It might, I haven't been able to run from master(npm install runs fine, but npm start seems to hang, with the electron process active but no sign of Vieb opening(with no other vieb instances open; i've also tried cleaning npm/electron cache)), so I'll let you know probably after next release.

Also I don't know if you had thought of this, but it might have been more economical to add a "command" which activates completion, so one could add <activateCompletion> at the end of a mapping to activate command-line completion after some input. This way, it would not be activated for all mappings.

@Jelmerro
Copy link
Owner

Could you start with npm start -- --debug and see if the startup fails on something? If so, please open a new issue for it, as there have been a couple of reworks lately to make Vieb's code more modular, but I haven't tested that on many systems yet.

It's not just completion though, they are suggestions. You can see them when you type, so you know what's right and what isn't and use that to know you're typing it correctly. You can then tab to them if you want to autocomplete. I know Vim doesn't have the realtime suggestions by default, but they can be turned off if desired. For now I made it so that after executing a mapping that ends in one of the modes with suggestions, it will show them once at the end.

@BachoSeven
Copy link

Right, I meant suggestions. Just tried using --debug so I could test the feature, it works as expected, thank you.

As for why it fails to start without --debug, I've opened #162.

@ottopiramuthu
Copy link
Contributor

ottopiramuthu commented Apr 27, 2021

I have made a viebrc for Tridactyl here.
Some questions, @Jelmerro:

  • Let me know if the searchwords+= syntax is preferred to searchwords=url1,url2, ... or not.
  • On lines 51-54 I make a custom command to visit a "homepage". I'm not really sure if this should be included and if so how it should be implemented.
  • Tridactyl has a ton of aliases for things in command mode. Should any of these be added as custom commands?
  • The last mapping is an Easter egg from Tridactyl. Should it be kept?

@Jelmerro
Copy link
Owner

  • I like the += syntax, but I think the first entry needs to be = or there needs to be a searchwords= at the top, otherwise reloading the config would lead to duplicate entries.
  • The homepage command looks alright, but users will probably override it anyway with a different url if they really want such a command, so I wouldn't spend too much time on it. It's also possible for users to open multiple pages this way, there are no homepage related settings, such functionality is best implemented with custom commands like this one.
  • What kind of aliases are we talking about? Because it might actually be alright to add them to regular Vieb by default, depending on what they are. Though if they are Tridactyl specific, I would just add them in the example config indeed.
  • I don't mind, as it's not exactly easy to run by accident, and it does show how close you can actually make Vieb behave like other plugins.

@ottopiramuthu
Copy link
Contributor

ottopiramuthu commented Apr 27, 2021

Here is the list of aliases.

A lot of them like "authors":"credits" are specific to Tridactyl.
There are also shorthand aliases like "h":"help" that work in Vieb already.
The aliases that are similar to Vim's shorthand commands that Vieb doesn't have could be nice to add.
At a glance the only alias I see that is like that is "noh":"clearsearchhighlight", which could be command noh <action.emptySearch> in the viebrc. I remember spending some time looking for this setting when I was first setting up my viebrc and didn't know how it would be named. It would be nice to have this in default Vieb to save people the trouble :)

If you find any other aliases you want from the list please let me know.

P.S. There is a typo in the Custom commands section of the help: :command homepage <Esc>evieb.dev<Enter> should be :command homepage <Esc>vieb.dev<Enter>.

@Jelmerro
Copy link
Owner

The e is for entering explore mode. And regarding the aliases, I don't think these really need to be included in Vieb, but some of them are probably nice to include in the Tridactyl example.

@ottopiramuthu
Copy link
Contributor

Here is a rough migration guide from Vimium.

I use vieb:// links to reference the help, but those links don't show up in the markdown preview. @Jelmerro, let me know how links to the help should be handled.

I am unsure how much explanation of things like mappings should be written out and how much should be deferred to sections of the help. Please let me know if anything is explained too much/too little.

@lorenzleutgeb is this what you had in mind? Let me know if there's anything you would change.

@Jelmerro
Copy link
Owner

Jelmerro commented May 7, 2021

I also don't really know where these guides should ideally be hosted for maximum visibility for new users. Regarding the help, I usually just tell people to run :h examples with the right argument for their question/feature, but I'm also considering an online version of the help docs so it can be more easily linked to from outside of Vieb. Looks like a nice guide overall, though I do have a couple of comments:

  • Smooth scrolling is possible, just not for the entire window, pointer scrolling is at a specific location and smooth, regular scroll actions are instant, see :h scrolling
  • Vieb supports multiple searchengines and giving them custom names using search words, as you also mention later, so I don't understand why it's listed as something Vieb doesn't have
  • I'm not sure if the plan was to list all *map commands, but there is also mmap for mapping keys when the menu is open
  • Maybe it's also nice to have a list of feature that ARE compatible, so people have a more balanced view of what is, and isn't possible, now the first part reads more like a list of shortcomings than an actual migration guide

Otherwise a good guide, but it's probably better to ask feedback about it from more experienced Vimium users, as I have used that a couple of hours at most.

@ottopiramuthu
Copy link
Contributor

Thank you for the feedback. I have added mmap and fixed the help links so far.

Vieb supports multiple searchengines and giving them custom names using search words, as you also mention later, so I don't understand why it's listed as something Vieb doesn't have

Vimium shows that a custom searchengine is being used differently from Vieb. It shows the engine's "nickname" in grayed-out text. For example, say you have this searchengine definition:

w: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia

When you press o to do a search and type w for wikipedia and press , it'll use the "nickname" you give it in the definition after the URL to tell you which engine you are searching with:
image

That "Wikipedia" can be whatever the user wants. This kind of nickname is not in Vieb.

Maybe it's also nice to have a list of feature that ARE compatible

To me it seems like the migration guide already shows a reader what Vieb can do that is compatible with Vimium. Maybe I can put the list of things it can't do at the end of the guide, so it doesn't look so negative?

Let me know what you think.

@Jelmerro
Copy link
Owner

Jelmerro commented May 7, 2021

I see what you mean with the nicknames, that's a concept I wasn't familiar with. For what it's worth, V5 of Vieb will have suggestions for searchwords, so that's something, but it's still different from these nicknames.

I think showing what Vieb can do is better highlighted now that the links to the help are actually working, so that's nice.

Finally, I would prefer the missing list to be at the bottom, but I'm probably too biased in favor of Vieb to make a neutral decision on that 😉

@ottopiramuthu
Copy link
Contributor

I've put the missing list on the bottom. From a reader's point of view, it's clearer to have one long part of the guide list things that can be done, rather than interrupting that with the missing list.

@ottopiramuthu
Copy link
Contributor

Here is a viebrc for Qutebrowser. Please let me know if there's anything I need to change.

@Jelmerro
Copy link
Owner

Jelmerro commented Jun 1, 2021

That's pretty cool, will you be opening a PR for that in the future?

@ottopiramuthu
Copy link
Contributor

I will as long as no one finds any errors.

@Jelmerro
Copy link
Owner

Jelmerro commented Apr 1, 2023

Since example configs have been a thing, I have not seen people request this (at all). Does this mean that we can close this ticket as completed in the form of the example configs, since it makes learning Vieb shortcuts not required as you can change them easily to match a specific plugin? Or is there still a market for actual guides (which will to be fair probably become outdated much faster than the examples)? Just interested to hearing how we can aim to close out this fairly old ticket, since there has been little progress on it (and unlike other old tickets doesn't seem blocked).

@Jelmerro
Copy link
Owner

Jelmerro commented Apr 6, 2023

I think the current examples provide enough help for new users to Vieb, and if there are plugins or mappings missing, feel free to open new PRs or issues for specific issues. I will however be closing this broad overview ticket, as I feel this has been mostly addressed by having so many example configs available within Vieb, but also because I have recently been adding more default mappings that are similar to both Firefox and some plugins, if they don't conflict with existing mappings. So feel free to suggest more mappings in the future, but please do so in a new PR or issue.

@Jelmerro Jelmerro closed this as completed Apr 6, 2023
@Jelmerro Jelmerro removed the help wanted Help wanted with this issue, so PRs are encouraged! label Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants