In Sublime Text 2 how can I pass the current file path to a command called
by a key binding
I'm working with sublime text 2 build 2221, on Windows 8; python 2.7.
I want to pass the name of the file I'm currently working on in st2 to a
command by calling a key binding like this:
{ "keys": ["ctrl+shift+1"],"command": "my_command", "args":{"argument":"$1" }
where "$1" gets replaced with the name of the file in the current view,
i.e. the file I'm looking at when hitting the keys. How would I go about
this?
I found the following references here and here which seem to talk about
this but I couldn't get it to work.
Relevant quotes from the links:
Link 1:
...
"args": {
"contents": "console.log('=== HEARTBEAT $TM_FILENAME
[$TM_LINE_NUMBER] ===');${0}"
...
--------------------------------------------------------------------------------------------
Link 2:
$TM_FILENAME Filename of the file being edited including extension.
No comments:
Post a Comment