Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "ZZ" as "save and exit" #853

Closed
5 of 8 tasks
xuhdev opened this issue Dec 18, 2016 · 5 comments
Closed
5 of 8 tasks

Implement "ZZ" as "save and exit" #853

xuhdev opened this issue Dec 18, 2016 · 5 comments

Comments

@xuhdev
Copy link

xuhdev commented Dec 18, 2016

  • I've searched for duplicates – also closed issues
  • I've looked at the change log
  • I've provided the below details:

VimFx version: 0.20.6
Firefox version: 50.1
OS: Debian Jessie
Keyboard language: English

This is

  • A bug report
    • I've filled in steps to reproduce below
  • A feature request
    • I've given a detailed example below
  • Somehting else

Firefox is known to have the builtin ability to save session (e.g. all tabs) when it exits. It would be nice to implement "ZZ" (the Vim keybinding for save and exit) as the key to save the current session and exit, which provide some flexibility to choose between a "plain" exit or an exit with session saving.

@lydell
Copy link
Collaborator

lydell commented Dec 19, 2016

This won't make it into the default set of commands.

However, I encourage you to try to add it as a custom command (see config file). I guess you could base it off of the Close window custom command. Could be as easy as setting the "save session" pref right before, and re-setting it on startup.

@lydell lydell closed this as completed Dec 19, 2016
@xuhdev
Copy link
Author

xuhdev commented Dec 26, 2016

@lydell How do I add code on startup then?

@lydell
Copy link
Collaborator

lydell commented Dec 27, 2016

Just stick it directly into config.js. If you put console.log('Hello!') in it, "Hello!" will be logged in the console every time the config file is run (such as on startup).

@xuhdev
Copy link
Author

xuhdev commented Jan 5, 2017

@lydell Thanks. while it can do now, it seems that WebExtension does not support modifying preferences... Do you have any suggestions?

@lydell
Copy link
Collaborator

lydell commented Jan 5, 2017

Yes: Do not use any non-WebExtension add-ons. Then you won’t miss any functionality when Mozilla stops supporting “legacy” add-ons (which is planned to happen at the end of 2017). VimFx will become a WebExtension during the year (EDIT: it won't #860), but it will take a long time. It will take an even longer time before WebExtensions are able to do “everything” that add-ons can do today. There are features in VimFx that will never work as a WebExtension. This is a bit sad, but also a necessary evil to be able to move the Firefox project forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants