Would it be possible to create a key binding that could enable/disable Vintage mode vs. having to edit the "ignored_packages" setting?
Thanks in advance,
Rob
import sublime, sublime_plugin
class ToggleVintagePackageCommand(sublime_plugin.TextCommand):
def run(self, edit):
setts = sublime.load_settings("Global.sublime-settings")
ipacks = setts.get('ignored_packages')
if not ipacks: ipacks = []
if "Vintage" in ipacks:
ipacks.pop(ipacks.index("Vintage"))
else:
ipacks.append("Vintage")
setts.set('ignored_packages', ipacks)
sublime.save_settings("Global.sublime-settings")[
{
"keys": ["alt+f10"],
"command": "toggle_vintage_package"
}
]jps wrote:Can I ask why you want a key binding to disable Vintage mode? Staying in insert mode is more or less the same thing as disabling Vintage entirely.
jps wrote:There's no harm in having it running, and only using command mode occasionally. The reason why Vintage is disabled by default is so that anyone not familiar with vi key bindings won't unintentionally get stuck in command mode.
sfranky wrote:@Jon:
i have a better answer for you now:
because Esc as 'go to command mode' is inserted in places where it shouldn't be.
For instance:
you are in insert mode
ctrl+down a couple of times to have multiple cursors
You want to cancel your selection and go back to one cursor, so you press Esc. Oops! now you are in command mode.
You press esc again, you get one cursor, and then you have to press i to go back to your previously working mode.
sfranky wrote:@Jon:
...
because Esc as 'go to command mode' is inserted in places where it shouldn't be.
...
Users browsing this forum: Exabot [Bot], Google [Bot], MaximeIx and 11 guests