Skip to content

Instantly share code, notes, and snippets.

@brandondrew
Created June 20, 2015 03:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save brandondrew/56a6ce0c0170c3e5e216 to your computer and use it in GitHub Desktop.
Save brandondrew/56a6ce0c0170c3e5e216 to your computer and use it in GitHub Desktop.
TextMate environment variable reference
#!/usr/bin/env ruby
###############################################################
#
# Paste this into a TextMate document,
# press ⇧^⌥R and choose 'Ruby' from the menu that appears,
# and then press ⌘R to run this in the context of TextMate
# to see all TextMate environment variables and their values
#
###############################################################
def display(environment_variable)
puts "### #{environment_variable} ###"
puts ENV[environment_variable]
puts
end
display 'TM_APP_IDENTIFIER'
display 'TM_APP_PATH'
display 'TM_BUNDLE_ITEM_NAME'
display 'TM_BUNDLE_ITEM_UUID'
display 'TM_BUNDLE_SUPPORT'
display 'TM_COLUMN_NUMBER'
display 'TM_COMMENT_START'
display 'TM_COMMENT_START_2'
display 'TM_COMMENT_END_2'
display 'TM_CURRENT_LINE'
display 'TM_CURRENT_THEME_PATH'
display 'TM_DISPLAYNAME'
display 'TM_DOCUMENT_UUID'
display 'TM_FULLNAME'
display 'TM_GIT'
display 'TM_LINE_INDEX'
display 'TM_LINE_NUMBER'
display 'TM_LINK_FORMAT'
display 'TM_MATE'
display 'TM_PID'
display 'TM_QUERY'
display 'TM_RUBY'
display 'TM_SCM_COMMIT_WINDOW'
display 'TM_SCOPE'
display 'TM_SCOPE_LEFT'
display 'TM_SELECTION'
display 'TM_SOFT_TABS'
display 'TM_SUPPORT_PATH'
display 'TM_TAB_SIZE'
display 'TM_THEME_PATH'
@schinckel
Copy link

TM_HG
TM_FILEPATH
DIALOG1
DIALOG1_PORT_NAME
DIALOG_PORT_NAME
MATEFLAGS
TM_ERROR_FD
TM_FILENAME
TM_FILE_IS_UNTITLED
TM_ORGANISATION
TM_PROPERTIES_PATH

@brandondrew
Copy link
Author

There's now a better way to do this, though I have no idea when it was added. Use command-control-/ to open a list of all set TextMate variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment