Vimafarian


Posted by acrollet

This is a GreaseKit plugin for Safari. (Currently only tested with Safari beta 4 on a mac.) It attempts to emulate the excellent Vimperator. As of svn rev 15, it only represents an evening's worth of hacking, so there's not a whole lot implemented, but already enough to satisfy a good bit of your muscle memory if you're used to vimperator...

Key commands currently implemented:
gg
G
gh (sort of, you have to edit the js file to set your homepage due to Safari limitations)
gu (go up one level)
gU (go to top level of site)
j
k
r (reload page)
t (open new {tab,window})
^c
^f
^d
^b
^u
^o (back one page) (count is working)
^i (forward one page) (count is a little fubared)
^z

I haven't worked out yet if Safari will let javascript respond to ctrl-letter combinations. Figured this out - yeah for insomnia.

To Install, just get GreaseKit installed and click the link below...

Comments

Fantastic Idea!! Unfortunately, it seems that many of the hotkeys have become broken in Safari 4. As a fellow Vimperator user that would like to be able to dump Firefox for its insane memory hogging, I'm very excited to see this! I'd love to contribute to this. Perhaps we can bring it up to speed with Safari 4 and work on some more basic Vimperator functionality :D


Hi David,

glad you like it! I've thrown it up on github, feel free to fork and improve as you wish - it's reached the 'scratched the itch' point for me...

http://github.com/acrollet/vimafarian/tree/master


I made a copy of the vimafarian file and added it as a new script to be able to experiment with it and try out some ideas in a more direct fashion without having to reinstall it everytime I broke something.

When I was messing around I quickly realized (and checked) that since vimafarian (actually all GreaseKit scripts) is loaded on a per tab basis you can't have any global variables like a stack, making it impossible to add support for the undo operation that re-opens a closed tab.

One ugly work-around might be to implement some local ajax service that can act as a storage engine for the global vimafarian state. Another might be to use CouchDB, a DBMS that natively supports the CRUD-operations via http to implement a similar solution.

If there are more ways of creating a 'global' state of kinds that are more feasible I'd be very interested in contributing, but until then I'll probably just use/modify vimafarian as/to be an accessibility aid.

I'm thinking about digging into the vimperator code to see how things are done, especially the hinting function, one of the things I've been missing most since I switched back to safari from firefox (+vimperator).


for global data storage, why not use the HTML5 client DB storage API? (example here) That's a great idea, by the way. I would encourage you to check out the script on github and fork with any improvements, I'll gladly roll new stuff in...


Wow, that's one sweet demo :D.

I'm a little embarrassed to admit this but I don't really know how to use git, so I'll have to look into that first :P. But with that DB storage API I'm really interested in writing some serious code. It would also enable multi-key commands, making gt (among other commands) possible.

I was also thinking about the "statusbar" that vimperator provides.. Do you have any suggestions as to how one would go about to implement a similar feature? My thoughts immediately go to adding a div that is above everything on the page (really high z-index) at the bottom of the screen, but I think it would be ugly in the end because of its limitations in its interaction with safari, e.g. would it be possible (or even desirable) to have the wget-style loading-bar, among other things?

Another thing that I'm considering is how to make a statusbar like the one that vimperator provides, only better or at least more eye-appealing. In my mind I'm seeing something like quicksilver but with a much higher y-value so that it doesn't just barge in going "HAAI GAAAIS" in the middle of the page.

There's one thing that I'm really missing from vimperator - hinting to follow links. I'd like to discuss this feature and how it would be implemented before delving into it.

/Emilio


You may want to give Uzbl a try, it uses WebKit and can be made to behave like Vimperator.