Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recently installed Tridactyl¹ as a Firefox extension². It has a ton of features but I my original intent was to only replace the functionality of two non-WebExtension add-ons:

* VimFx³ provided handy keyboard short-cuts for working within the browser

* ItsAllText⁴ which allowed me to use GVim to edit and save the contents of a text box

While going through its builtin tutorial, I found that it also supports keyboard-based selection of text (similar to that shown in this article). While this feature is documented as not yet being stable, I’ve found that it works well in my exeriment.

I’ve yet to incorporate the rest of Tridactyl’s extra functionality into my workflow but what they’ve achieved with the WebExtensions API is very impressive. Also, and importantly, the built-in tutorial and documentation are excellent.

While working from home, I’m currently using Windows 10 so I’ve ran into one issue⁵, “Encoding of non-Latin-1 characters entered in external editor gets messed up with Unicode-based external editors on Windows” (and it looks like that should be fixed soon).

1. https://github.com/tridactyl/tridactyl

2. https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim...

3. https://github.com/akhodakivskiy/VimFx

4. https://github.com/docwhat/itsalltext/

5. https://github.com/tridactyl/tridactyl/issues/876



If you're using Tridactyl beta, you can run this script - https://github.com/tridactyl/native_messenger/blob/master/in... - to get a newer version of the native messenger that should fix 5).

It'll get a wider release once we reimplement `:restart`.

If you're on Tridactyl stable you could run the script anyway and see what happens. It's mostly compatible : )


As a newbie to using Tridactyl, I installed the stable version (1.20.4). Anyhow, I tried running the linked installer for the native messenger and noticed that GVim now opens with “fileencoding” set to “latin1”. This resulted in conversion errors (I have “encoding” set to “utf8” in my “vimrc”) but I was able to get around that by running “:x ++enc=utf-8”.

I’m now able to quickly and easily open, close and re-edit text-boxes containing UTF-8 character. Thanks.


Hmm, was it opening with a different file encoding before?

You can `:set editorcmd` to something that gives gVim more commands, like is mentioned in this issue: https://github.com/tridactyl/native_messenger/issues/18


Actually, GVim had been opening with “fileencoding” set to “utf-8” and the contents of the text-box were fine. It was only when saving that the text box would have the wrong characters. Late last Saturday night, I had edited the `editorcmd` to be

    gvim -c "set filetype=markdown fileencoding=latin1"
At that stage, I hadn’t discovered the use of `x ++enc=utf-8` to resolve the issue and gave up at that stage (I thought I had reset the `editorcmd` but must have forgot). Anyhow, with the new native messenger, I don’t need to mess with specifying character sets and I’ve now set the Tridactyl `editorcmd` to the simpler:

    gvim -c "set filetype=markdown"
Now GVIm opens with UTF-8 as both the “encoding” and “fileencoding” so I can exit it as usual with a simple `:x` and the text-box updates correctly.

Thanks again (your help with this prompted me to become a sponsor).


Bah! For some reason, GitHub had “an issue processing your payment method”. I’ll try again tomorrow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: