Closed zhuochun closed 8 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.*
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.
Is it possible to add services.sync.prefs.sync.extensions.VimFx.*
prefs manually via about:config, just to test stuff?
Ah right, good idea! Will test on Monday when I'm back home
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.
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.
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.
@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?
I’m actually in favor of a .vimfx file now.
This is what I suggest:
~/.vimfxrc
(<drive>:/users/<user>/_vimfxrc
or something on Windows). There is also a “Help” button that takes you to online documentation. There could possibly be a button that re-reads the configuration file so that you don’t have to restart Firefox each time you edit it.unmapAll
in such a block to blacklist sites. Or you could unmap
just the commands you want to (as requested in #255).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.
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.
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.
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.
map | <command id>
to it. The pipe character shows where the cursor would be automatically placed. <command id>
is the command id of the command whose add button you pressed. This corresponds to the current behavior of opening a prompt when clicking an add button.<Left>
at the cursor. Pressing ctrl+shift+a would insert <c-A>
. Pressing “q” would insert q
. This way we achieve the “key capturing instead of string entry” feature that has been discussed before. There is also a keyboard shortcut for this button.map ...
directive that adds that shortcut, letting you edit or remove it. (Perhaps the text area could feature a “remove line” button/shortcut to make it easier to remove mappings.) If the shortcut you clicked was a default shortcut, unmap <command id>
could be prepended instead. (Perhaps there should be a remap
directive, too, that is short for unmap
followed by map
?)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:
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.
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.
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...
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.
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?
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.
I’m just worried because all Firefox sync docs on MDN are archived …
In the latest development version it is now possible to optionally configure VimFx via a config file.
No Firefox Sync support yet, though.
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.
Import/export is now available in the development version, but no syncing.
Support export and import customized shortcuts?