This can be done using a special command:
import sublime_plugin, getpass
class OpenCustomFileCommand(sublime_plugin.WindowCommand):
def run(self, file_name):
if("{username}" in file_name):
file_name = file_name.replace("{username}", getpass.getuser())
self.window.open_file(file_name)
and the following (Default.sublime commands):
{
"caption": "Edit my config",
"command": "open_custom_file",
"args": { "file_name": "/Users/{username}/.myconfig" }
}
And of course, you can extend OpenCustomFileCommand with your own replacements.
P.S. ST2, open_custom_file.py