Home Download Buy Blog Forum Support

Use vintage commands, without enabling vintage mode?

Use vintage commands, without enabling vintage mode?

Postby Kicweed on Mon Jan 09, 2012 9:52 am

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:

Code: Select all
{"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
Kicweed
 
Posts: 22
Joined: Mon Jan 09, 2012 9:48 am

Re: Use vintage commands, without enabling vintage mode?

Postby guillermooo on Mon Jan 09, 2012 10:06 am

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...
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Use vintage commands, without enabling vintage mode?

Postby Kicweed on Mon Jan 09, 2012 12:29 pm

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.
Kicweed
 
Posts: 22
Joined: Mon Jan 09, 2012 9:48 am

Re: Use vintage commands, without enabling vintage mode?

Postby guillermooo on Mon Jan 09, 2012 12:43 pm

It will get updated very soon! ;)
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Ivan171 and 31 guests