Take the 2-minute tour ×

am trying to get the path of the current file + the files name (without extension) in a Key Binding file in Sublime Text 2. $file_path or ${file_path} are both not working.

The reason is, that i want to execute an *.exe file, which was build before (but dont want both building and executing in one step), so if anybody has a better idea?


share|improve this question
Why did you specify "without extension"? The task sounds like it would be fairly simple with a plugin. I don't think there is a way to do what you want purely in the sublime keybinding file. –  BoundinCode Aug 8 '12 at 2:10
Because I want to perform the shortcut in the *.c or *.cpp file, from which i build the *.exe before. –  mvuajua Aug 8 '12 at 7:25

1 Answer 1

you may try the sublime-snippet, this is my code:

#filename: filename.sublime-snippet
    <description>the current file name</description>

when you type 'fn' in python source files, you will get your filename.

share|improve this answer

Your Answer


