FolderSpecificSettings

Reference.FolderSpecificSettings History

Hide minor edits - Show changes to markup

December 16, 2011, at 21:20 UTC by Infininight -
Changed lines 76-81 from:

TM_MAKE_TARGET = rmate

to:

TM_MAKE_TARGET = rate

[ vendor/MASPreferences/**/*.{m,h} ] tabSize = 4 softTabs = true TM_C_POINTER = " *"

December 16, 2011, at 20:10 UTC by Infininight -
Changed lines 37-38 from:

It will read from current folder and up until either it reaches `~` or `/`. If it reaches `/` then it will additionally read `~/.tm_properties`. This means you can have “global” settings in that file and they work even when opening stuff not under your home folder.

to:

It will read from current folder and up until either it reaches ~ or /. If it reaches / then it will additionally read ~/.tm_properties. This means you can have “global” settings in that file and they work even when opening stuff not under your home folder.

Changed lines 41-42 from:

In the variable part you have a few variables, the usual `$TM_FILEPATH` and friends, but you also have `$CWD`, this is the folder containing the property file. This is useful if you put a `.tm_properties` file in the root of your project, for example I use this file with Avian:

to:

In the variable part you have a few variables, the usual $TM_FILEPATH and friends, but you also have $CWD, this is the folder containing the property file. This is useful if you put a .tm_properties file in the root of your project, for example I use this file with Avian:

Changed lines 79-80 from:

As you can see I set the `Makefile` via `CWD` — here I can’t use `TM_FILEPATH` or similar, because those will be the “current file”, not the project root.

to:

As you can see I set the Makefile via CWD — here I can’t use TM_FILEPATH or similar, because those will be the “current file”, not the project root.

Changed lines 83-84 from:

While the `.tm_properties` can contain both settings and environment variables, while interpreting the file, Avian doesn’t distingish between the two, so it is possible to mix them in the value part and also reference already set variables, e.g. if we want to extend the default `exclude` setting we can do:

to:

While the .tm_properties can contain both settings and environment variables, while interpreting the file, Avian doesn’t distingish between the two, so it is possible to mix them in the value part and also reference already set variables, e.g. if we want to extend the default exclude setting we can do:

Changed line 89 from:

The value is a glob so we use brace expansion to add the `*.o` extension.

to:

The value is a glob so we use brace expansion to add the *.o extension.

December 16, 2011, at 20:08 UTC by Infininight -
Changed lines 85-87 from:

exclude = '{$exclude,*.o}'

to:
exclude = '{$exclude,*.o}'
December 16, 2011, at 20:08 UTC by Infininight -
Changed lines 3-34 from:
	exclude = "{*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\{arch\},blib,*~.nib}"
	include = "{.tm_properties,.htaccess}"

	TM_HG  = "/opt/local/bin/hg"
	TM_GIT = "/opt/local/bin/git"

	[ "/usr/include/{**/,}*" ]
	tabSize = 8

	[ *.{txt,md,mdown,markdown} ]
	softWrap = true

	[ .git/COMMIT_EDITMSG ]
	softWrap         = true
	spellChecking    = true
	spellingLanguage = 'en'

	[ *.{icns,ico,jpg,jpeg,m4v,nib,pdf,png,psd,pyc,rtf,tif,tiff,xib} ]
	binary           = true

	[ source.ruby ]
	softTabs         = true
	tabSize          = 2

	[ "/System/Library/Frameworks/**/Headers/**/*" ]
	encoding         = "MACROMAN"

	[ "{README,INSTALL,LICENSE,TODO}" ]
	fileType         = "text.plain"

Load Order

to:
exclude = "{*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\{arch\},blib,*~.nib}"
include = "{.tm_properties,.htaccess}"

TM_HG  = "/opt/local/bin/hg"
TM_GIT = "/opt/local/bin/git"

[ "/usr/include/{**/,}*" ]
tabSize = 8

[ *.{txt,md,mdown,markdown} ]
softWrap = true

[ .git/COMMIT_EDITMSG ]
softWrap         = true
spellChecking    = true
spellingLanguage = 'en'

[ *.{icns,ico,jpg,jpeg,m4v,nib,pdf,png,psd,pyc,rtf,tif,tiff,xib} ]
binary           = true

[ source.ruby ]
softTabs         = true
tabSize          = 2

[ "/System/Library/Frameworks/**/Headers/**/*" ]
encoding         = "MACROMAN"

[ "{README,INSTALL,LICENSE,TODO}" ]
fileType         = "text.plain"

Load Order

Changed lines 43-76 from:
	# Settings
	tabSize              = 3
	projectDirectory     = "$CWD"
	windowTitle          = "$TM_DISPLAYNAME — ${CWD/^.*\///}"
	excludeInFileChooser = "{$exclude,*.xib}"

	# Variables
	TM_ORGANIZATION_NAME = 'MacroMates'

	TM_SYS_HEADER_PATH   = '${TM_SYS_HEADER_PATH:?$TM_SYS_HEADER_PATH:/usr/include/c++/4.0.0:/usr/include:/System/Library/Frameworks}:$CWD/Shared/include:${BUILD_DIR:-$CWD/build}/Avian/public'
	TM_TODO_IGNORE       = '/(disabled(-src)?|onig-.*|build|cache|CxxTest|(FScript|BWToolkitFramework).framework)/'

	TM_MAKE_FILE         = '${CWD}/Makefile'
	TM_MAKE_TARGET       = 'Avian/run'

	[ target ]
	fileType         = "source.tm-properties"

	[ *.{h,pch} ]
	fileType         = "source.objc++"

	[ Makefile.* ]
	fileType         = "source.makefile"

	[ attr.untitled ]
	fileType         = 'source.c++'

	[ "tests/*.{cc,mm}" ]
	scopeAttributes  = 'attr.test.cxxtest'
	TM_MAKE_TARGET   = '${TM_FILEPATH/^.*?([^\/]*)\/tests\/.*$/$1/}/test'

	[ "rmate/*" ]
	TM_MAKE_TARGET   = rmate
to:
# Settings
tabSize              = 3
projectDirectory     = "$CWD"
windowTitle          = "$TM_DISPLAYNAME — ${CWD/^.*\///}"
excludeInFileChooser = "{$exclude,*.xib}"

# Variables
TM_ORGANIZATION_NAME = 'MacroMates'

TM_SYS_HEADER_PATH   = '${TM_SYS_HEADER_PATH:?$TM_SYS_HEADER_PATH:/usr/include/c++/4.0.0:/usr/include:/System/Library/Frameworks}:$CWD/Shared/include:${BUILD_DIR:-$CWD/build}/Avian/public'
TM_TODO_IGNORE       = '/(disabled(-src)?|onig-.*|build|cache|CxxTest|(FScript|BWToolkitFramework).framework)/'

TM_MAKE_FILE         = '${CWD}/Makefile'
TM_MAKE_TARGET       = 'Avian/run'

[ target ]
fileType         = "source.tm-properties"

[ *.{h,pch} ]
fileType         = "source.objc++"

[ Makefile.* ]
fileType         = "source.makefile"

[ attr.untitled ]
fileType         = 'source.c++'

[ "tests/*.{cc,mm}" ]
scopeAttributes  = 'attr.test.cxxtest'
TM_MAKE_TARGET   = '${TM_FILEPATH/^.*?([^\/]*)\/tests\/.*$/$1/}/test'

[ "rmate/*" ]
TM_MAKE_TARGET   = rmate
Changed line 85 from:
	exclude = '{$exclude,*.o}'
to:

exclude = '{$exclude,*.o}'

December 16, 2011, at 20:05 UTC by Infininight -
Deleted lines 0-1:
  1. Folder Specific Settings
Changed line 33 from:
  1. Load Order
to:

Load Order

December 16, 2011, at 20:04 UTC by Infininight - Page created
Added lines 1-85:
  1. Folder Specific Settings

Many settings can be specified per folder and even per file type, here are the default values:

	exclude = "{*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\{arch\},blib,*~.nib}"
	include = "{.tm_properties,.htaccess}"

	TM_HG  = "/opt/local/bin/hg"
	TM_GIT = "/opt/local/bin/git"

	[ "/usr/include/{**/,}*" ]
	tabSize = 8

	[ *.{txt,md,mdown,markdown} ]
	softWrap = true

	[ .git/COMMIT_EDITMSG ]
	softWrap         = true
	spellChecking    = true
	spellingLanguage = 'en'

	[ *.{icns,ico,jpg,jpeg,m4v,nib,pdf,png,psd,pyc,rtf,tif,tiff,xib} ]
	binary           = true

	[ source.ruby ]
	softTabs         = true
	tabSize          = 2

	[ "/System/Library/Frameworks/**/Headers/**/*" ]
	encoding         = "MACROMAN"

	[ "{README,INSTALL,LICENSE,TODO}" ]
	fileType         = "text.plain"
  1. Load Order

It will read from current folder and up until either it reaches `~` or `/`. If it reaches `/` then it will additionally read `~/.tm_properties`. This means you can have “global” settings in that file and they work even when opening stuff not under your home folder.

In the file you can do sections with a glob against full path to restrict the following settings to just those which match the glob.

In the variable part you have a few variables, the usual `$TM_FILEPATH` and friends, but you also have `$CWD`, this is the folder containing the property file. This is useful if you put a `.tm_properties` file in the root of your project, for example I use this file with Avian:

	# Settings
	tabSize              = 3
	projectDirectory     = "$CWD"
	windowTitle          = "$TM_DISPLAYNAME — ${CWD/^.*\///}"
	excludeInFileChooser = "{$exclude,*.xib}"

	# Variables
	TM_ORGANIZATION_NAME = 'MacroMates'

	TM_SYS_HEADER_PATH   = '${TM_SYS_HEADER_PATH:?$TM_SYS_HEADER_PATH:/usr/include/c++/4.0.0:/usr/include:/System/Library/Frameworks}:$CWD/Shared/include:${BUILD_DIR:-$CWD/build}/Avian/public'
	TM_TODO_IGNORE       = '/(disabled(-src)?|onig-.*|build|cache|CxxTest|(FScript|BWToolkitFramework).framework)/'

	TM_MAKE_FILE         = '${CWD}/Makefile'
	TM_MAKE_TARGET       = 'Avian/run'

	[ target ]
	fileType         = "source.tm-properties"

	[ *.{h,pch} ]
	fileType         = "source.objc++"

	[ Makefile.* ]
	fileType         = "source.makefile"

	[ attr.untitled ]
	fileType         = 'source.c++'

	[ "tests/*.{cc,mm}" ]
	scopeAttributes  = 'attr.test.cxxtest'
	TM_MAKE_TARGET   = '${TM_FILEPATH/^.*?([^\/]*)\/tests\/.*$/$1/}/test'

	[ "rmate/*" ]
	TM_MAKE_TARGET   = rmate

As you can see I set the `Makefile` via `CWD` — here I can’t use `TM_FILEPATH` or similar, because those will be the “current file”, not the project root.

Some things of interest is how e.g. test files get the scope augmented, this is because I have unit test snippets I only want active in test files. Additionally I change the make target for test files.

While the `.tm_properties` can contain both settings and environment variables, while interpreting the file, Avian doesn’t distingish between the two, so it is possible to mix them in the value part and also reference already set variables, e.g. if we want to extend the default `exclude` setting we can do:

	exclude = '{$exclude,*.o}'

The value is a glob so we use brace expansion to add the `*.o` extension.