akhodakivskiy / VimFx

Vim keyboard shortcuts for Firefox
https://addons.mozilla.org/firefox/addon/vimfx
Other
1.41k stars 175 forks source link

Export and import customized shortcuts (partially fixed in dev) #245

Closed zhuochun closed 8 years ago

zhuochun commented 10 years ago

Support export and import customized shortcuts?

nogweii commented 10 years ago

I would very much love to see Sync support included as well.

I haven't looked into the documentation much for FF APIs, but as I understood it it should be as simple as flagging the various about:config settings to be synced. If it is that simple, then enabling sync on extensions.VimFx.commands.* and extensions.VimFx.hint_chars is probably enough.

EDIT: Seems like I was right. The Sync documentation documents how to flag a preference for sync. A lot of boolean true services.sync.prefs.sync.extensions.VimFx.*

akhodakivskiy commented 10 years ago

Yeah, seems trivial. There are two open questions: 1) We need to test this. Testing requires releasing a version with this feature. 2) Will wildcards work? Testing will answer this question if the documentation doesn't answer this question.

lydell commented 10 years ago

Is it possible to add services.sync.prefs.sync.extensions.VimFx.* prefs manually via about:config, just to test stuff?

akhodakivskiy commented 10 years ago

Ah right, good idea! Will test on Monday when I'm back home

noc7c9 commented 10 years ago

Might I you guys take this as a chance to implement a .vimfx file instead of export/import? This is in addition to sync of course.

lydell commented 10 years ago

Nope, no .vimfx file. A similar idea was discussed in #149, in there @akhodakivskiy sums it up:

On top of that where is this file supposed to be stored? In Extension package? How are we going to modify it? Also proper way to store customizations for users in Firefox is via standard preferences.

dvarrazzo commented 10 years ago

Would it be possible to just have a box where to configure the custom key mapping as Vimium for Chrome has? That solution is perfectly usable by people used to text files, which are the only people who would use vim-inspired keybindings, and allows porting the bindings back and forth between chromium and firefox.

bohrshaw commented 10 years ago

@dvarrazzo Vanilla text presentation of key mappings would also allow porting between multiple Firefox profiles, which is another feature request, other than syncing.

And as we rarely configure these keys after the initial setup, I think the advantages or convenience the current mapping interface provides are less than needed, especially when syncing is implemented. But of course I still appreciate the current beauty of the mapping interface. I guess we should first figure out how to sync. Do we have any progress on this somewhat trivial problem?

lydell commented 10 years ago

I’m actually in favor of a .vimfx file now.

This is what I suggest:

Lastly, the current key customization UI in the help dialog is not optimal, and it is buggy. I’ve been meaning to improve it, but never got around to it. That’s one of the more boring parts of VimFx. I’d rather spend time on implementing the simple configuration file and improving and adding features to VimFx, than on fixing that UI.

What do you think, @akhodakivskiy? I know that you’ve said that you want all prefs to be done the standard Firefox way, but I don’t think the standard Firefox way fits VimFx very well. JSON strings as pref values make me iffy.

bohrshaw commented 10 years ago

Manipulating plain texts is for sure more enjoyable for us Vim users. But I guess we don't need such an external configuration file. Instead, I suggest keep all customizations in a single editable text area, inside the addon's option page.

lydell commented 10 years ago

I think I’ve come up with the perfect compromise between the current customization, a plain text area of configuration and a .vimfxrc file, that let us get all the benefits of text configuration without changing the current look and feel. I’ll post my ideas soon.

lydell commented 10 years ago

I think the “help dialog” should have a tab which consists of a text area, where the user can configure VimFx.

You will still be able to customize the keyboard shortcuts (semi-)interactively, just like now.

Blacklisting using the toolbar button works like before. But instead of modifying the blacklist string setting, the configuration is modified, by adding and removing blacklist directives.

Lastly, some random notes:

bashseb commented 10 years ago

Hello @lydell and @akhodakivskiy. Have you made up your mind about this topic? I ran git grep sync and grep -R sync, but didn't find any update on the topic.

I'm just a normal user, so sync via firefox sync would be greatly appreciated. However, I can workaround with git dotfiles as well.

Let me also say thanks for your previous work.

lydell commented 10 years ago

Nope, we haven’t decided on anything, and haven’t implemented Firefox sync support.

My vision is this:

I start my vacation next week, and plan to devote some more time on VimFx then.

lindhe commented 9 years ago

What's the status on this? I'd really like to be able to export/import settings, since I make extensive use of custom key bindings...

lydell commented 9 years ago

This is not a priority right now. I’d suggest looking for an add-on that can import and export Firefox prefs in general. Perhaps OPIE is a good choice.

lydell commented 9 years ago

I just realized that at least enabling Firefox Sync support for what we already have might be quick and simple. However, the MDN dkcs @evaryont linked to is now in the "Archive of obsolete content". I don't use Firefox Sync myself, so I don't know much about it. Is it no longer possible to sync add-on prefs?

akhodakivskiy commented 9 years ago

I do use Firefox Sync, and it is possible to sync add-on prefs. We just need to set up a few additional properties to enable sync, e.g. properties like services.sync.prefs.sync.extensions.vimfx.some_property_to_sync. I remember trying this back in the time, it didn't work quite well right away, but it does work well for other addons as of today.

lydell commented 9 years ago

I’m just worried because all Firefox sync docs on MDN are archived …

lydell commented 9 years ago

In the latest development version it is now possible to optionally configure VimFx via a config file.

No Firefox Sync support yet, though.

lydell commented 8 years ago

https://discourse.mozilla-community.org/t/how-to-sync-preferences-of-a-bootstrapped-extension-via-sync/3024/10?u=lydell:

The old Sync service was replaced with a new service that uses Firefox Accounts. I don't see any documentation around its sync feature, though.

Time won’t be spent on an obsolete feature. If anyone’s into this Firefox Accounts thing, feel free to open a new issue for it.

lydell commented 8 years ago

Import/export is now available in the development version, but no syncing.