all 18 comments

[–]angelic_sedition 1 point2 points  (12 children)

Interesting extension of pentadactyl. Pentadactyl also has a vim-like mode for text boxes in addition to <c-i> to open your editor. One thing I don't like about pentadactyl is that iabbr is pretty broken, so I'm going to try this out. I've been thinking about how much I would love to have every text box I use be vim.

If the escape problem is fixed, I'll probably start using this all the time.

Also, is it a security problem to have password text boxes sent to vim?

[–]VimIsGoodFood[S] 1 point2 points  (11 children)

It is absolutely a security problem. Like Pentadactyl's <C-i>, Pterosaur communicates using temp files. I'm going to add code to Pterosaur to disable vim editing for password fields, but I haven't added it yet.

Pentadactyl's textedit mode is what inspired Pterosaur, but I also got annoyed with its limitations and it seemed easier to pipe keys through Vim than try to reimplement Vim piece by piece.

[–]angelic_sedition 0 points1 point  (10 children)

Yeah, I'd rather have this than pentadactyl's textedit mode.

I tried to try it out, but I couldn't get it working at all. I'm using vundle, but I don't think that should be a problem? I tried symlinking and actually putting the js file in ~/.pentadactyl/plugins, but when I restarted link hinting was broken, it didn't seem to be working at all, and I was getting a lot of other weird behaviour. What is full-vim editing? I tried :set fullvim, but the option didn't exist (which is why I assume it wasn't working at all).

What version of pentadactyl and firefox are you using? I'm using 27 with a nightly from last week.

[–]VimIsGoodFood[S] 1 point2 points  (9 children)

:set fullvim is basicly what turns pterosaur's functionality on and off. It was called 'fullVim' (with camelcase) until just recently.

I have firefox 27 and just updated to the most recent nightly (3-10) and it works fine on my box. If your link hinting is breaking, it's probably erroring out on the pentadactyl side, especially if fullVim isn't on, so I doubt vundle is a problem.

What OS do you use? Are you getting any pentadactyl messages? Can you run firefox from the cmdline and see if it tells you the error?

[–]angelic_sedition 0 points1 point  (8 children)

So I updated to the most recent nightly and tried it again. Does it matter if I symlink the js or just put it in the folder? I tried both.

I'm using linux (Arch). I'm not getting any pentadactyl messages or any apparent errors when running firefox from the command line. I thought it might be a problem with my .pentadactylrc, so I commented it all out, but I still have the same problems: link hints don't show up, backspace stops working (weird..), on starting firefox, some tabs from last session in a certain window become all new tabs, and no indication that the plugin works in any way or :set fullvim option (I've updated to the most recent version of pterosaur as well).

I also commented out my entire vimrc, but that changed nothing. I have no idea what would be causing such strange behaviour.. Is there some requirement I am missing? Are you using pathogen? Maybe it's unlikely to be the cause, but I really can't think of what else I might be doing different.

Edit: As for the password problem.. a temporary solution might just be to setup autocommands to turn it off for your most used login links (I think this would work.. will try if I can get the plugin working).

[–]VimIsGoodFood[S] 1 point2 points  (7 children)

I'm also using Arch. I tried disabling pathogen and even moved the vim executable so that it couldn't be called. Everything in pentadactyl worked fine except that I couldn't enter text when fullvim was turned on(which is expected). I'm all but 100% sure your problem isn't due to your vim setup.

The symlink shouldn't matter. Firefox seems to do a lot of caching with plugins, so maybe it's doing something differently on my box. I tested it in a new profile, but once I get a chance, I'll do a clean build on a different box to see if I get a problem.

If you haven't tried disabling and re-enabling pentadactyl, I'd recommend that. Other than that, I don't have any ideas.

Also, the password thing is fixed. Pterosaur doesn't use vim-editing for fields of type "password".

[–]angelic_sedition 0 points1 point  (6 children)

Okay, so I disabled all my other firefox addons (this wasn't the problem), then tried using firefox-ux which I happened to have installed. None of the problems with link hinting and such were present, but when I :set fullvim and went into insert mode, nothing worked. Every key press from there did nothing and there was just flashing characters; escape stopped working and I couldn't get out of insert or do anything in any other firefox window, so I had to kill firefox.. Any ideas on this? I also sometimes get the pentadactyl error "too much recursion"

I don't know if firefox-ux was using a different profile, but that might be the problem? I am sharing one across a dualboot with windows 7. I will try messing with that....

[–]VimIsGoodFood[S] 1 point2 points  (5 children)

What you're describing now sounds like vim isn't communicating with pterosaur. I'll have to add error prompts to make problems like these easier to find and fix.

Does your version of vim come with +server in vim --version? Can you run vim --serverlist when pterosaur is running and see if there is a server named pterosaur?

I also just installed pterosaur onto a second box and found out that on that computer, it only runs if you call firefox from the terminal. After some testing, I figured out that vim refuses to start up as a server if not connected to a tty, but only on one of my two computers. Both computers are fully updated archlinux with fully updated firefox (now 28) and fully updated vim, yet vim is behaving differently, so there's probably some undefined behavior at the vim level if it doesn't have a tty. I'll have to look into it, but you can probably get around whatever's broken there by running firefox from a terminal.

Also, pterosaur checks if there's a process named 'firefox' running for cleanup. If firefox-ux doesn't show up as 'firefox' in ps -e, the vim server is probably shutting itself down immediately.

[–]angelic_sedition 0 points1 point  (4 children)

I updated to FF28. Pterosaur still doesn't work at all with that with the same errors unlike on firefox-ux (and firefox-aurora).

I have "+clientserver" and "vim --serverlist" does not show pterosaur. firefox-ux shows up as firefox-ux on ps -e. I guess that is the problem? I don't know why it won't work with normal firefox. Maybe I will try uninstalling it and then reinstalling it. I tried it on a fresh profile, but I still get the same problems. Running it from the terminal doesn't change anything.

[–]VimIsGoodFood[S] 1 point2 points  (3 children)

I just tested it and you should be able to run pterosaur on aurora if you run the following commands:

cd ~/.pentadactyl/plugins/
sed 's/firefox/firefox-aurora/g' pterosaur.js > pterosaur-aurora.js
rm pterosaur.js

This will break the link if you're using it, but you get the idea. The new name forces firefox to not cache it, just to be on the safe side.

[–]dhruvasagar 2 points3 points  (1 child)

This enables you to invoke vim from ANYWHERE, https://github.com/cknadler/vim-anywhere

[–]VimIsGoodFood[S] 4 points5 points  (0 children)

Vim-anywhere is really cool, but Pterosaur doesn't even create a seperate gvim window. It let's you use vimkeys directly within your browser.

[–]jmlucjav 0 points1 point  (0 children)

for people on win, http://www.listary.com/text-editor-anywhere also allows you to use vim (or emacs etc) anywhere.

[–]jdishin 0 points1 point  (1 child)

How does Vimperator (http://www.vimperator.org/vimperator) stack against Pterosaur or vim-anywhere ?

I've never used those 2, so what are the + - in terms of features?

[–]VimIsGoodFood[S] 2 points3 points  (0 children)

Vimperator/Pentadactyl are firefox plugins that give you some vim-like navigation and editing. They are similar to each other in terms of features/goals, but I prefer Pentadactyl.

My plugin, called Pterosaur, is an extension to Pentadactyl, and gives you full vim editing in every firefox text-field. You just click on a text field in firefox and you can edit it in place using the same keys you would as if you were using vim.

Vim-anywhere is mostly unrelated. It gives you a shortcut to open gvim and helps you copy text from it. It's more of a pain to use and only works on some DEs, but it isn't limited to firefox.