Sublime Forum

Use vintage commands, without enabling vintage mode?

#1

Greetings,

As the subject suggests, I’d like to use the ‘gf’ command that the Vim emulation provides, *without *enabling vintage mode. I’ve tried adding the following in my User\Default.sublime-keymap file, without success:

{"keys": "ctrl+g", "ctrl+f"], "command": "vi_open_file_under_selection"}
My rational behind this was copying how the command was defined in Vintage\Default.sublime-keymap.

Running ViOpenFileUnderSelectionCommand() or vi_open_file_under_selection on the console returns a not-defined error.

I assume I need to somehow import the vintage_commands.py code to make it available to the above keymap.

Can someone guide me on how to do that?

Thank you in advance

0 Likes

#2

Ignored packages don’t exist as far as Sublime Text is concerned–no resources will be loaded from them.

To do what you’re after, I can think of the following:

  • copy the file containing the commands you are interested in to your User folder (you will have to keep an eye on updates to Vintage)
  • enable Vintage, but delete or rename the .sublime-keymap files so that they won’t interfere (you will have to do this every time you update ST)

BTW, I don’t think the “gf” command is working well now; I believe it won’t open absolute paths…

0 Likes

#3

It worked! Thanks a lot for the suggestion.

I hoped I’d avoid having duplicate files, precisely for the reason you said. Now I’ll have to keep an eye on vintage_commands.py to see if it gets updated.

0 Likes

#4

It will get updated very soon! :wink:

0 Likes