Created
January 1, 2011 21:32
-
-
Save wayneeseguin/762023 to your computer and use it in GitHub Desktop.
TextMate shell function to open project directory excluding some.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original code from: | |
http://www.wezm.net/technical/2009/05/exclude-directories-from-textmate-side-bar-for-faster-find-in-project/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
m() | |
{ | |
# Shell (bash/zsh) function which opens a directory as a project in TextMate | |
# excluding directories that tend to slow down "Find in Project" | |
# | |
# Add this function to your dotfiles or ~/.bash_profile or ~/.zshrc for it | |
# to be available in your shell. You can also add it as a tm_exclude_dirs.zsh | |
# file in the custom folder of an ~/.oh-my-zsh install | |
shopt -s extglob # Enable extended globbing for bash | |
# setopt extended_glob # Enable extended globbing for zsh | |
# Invoke TextMate upon all the files and directories except those listed | |
# Note: Don't open tmproj files or you'll get two windows (added to list) | |
mate !(@(cache|log|tmp|db|*.tmproj)) "$@" | |
shopt -u extglob # Disable extended globbing for bash | |
# unsetopt extended_glob # Disable extended globbing for zsh | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment