QuinnComendant

Herein lies my stream-of-consciousness log since switching to TextMate. These include bugs, suggestions, and hacks.
— quinn at strangecode dot com

TextMate Log

  • Symbols menu should not display until after the document is parsed. Otherwise you get a short menu list and wonder, "why isn't the function I'm looking for in this file?"
  • [BUG] Search doesn't work inside the bundle editor (although using apple + E to set the search command does work).
  • [BUG] In some instances if you switch between themes and the preferences window goes in the background while editing bundles a theme will be overwritten with one previously selected.
  • [BUG] Add a file via the contextual menu in the drawer. Try to hit the short-cut hotkey for one of the templates (Empty file is apple+1). Instead of the template being selected, the first tab in the current project window is selected. Update: I see the command shortcuts for choosing a template have been removed.
  • [DISASTER] Desperately need unlimited find panel history! Oh it's torture to lose a huge regex because the find dialog has a short memory. Extra bonus feature: upon selecting a find history item, TM auto selects the replace string that was used for that search.
  • Select multiple items in the Bundle Editor to rearrange/copy/delete/drag-to-finder them.
  • Allow a larger tab size than 32. Useful when manipulating tab-separated data files with long lines. Ideally, this feature would allow different tab sizes for each column!
  • [BUG] If I have a live project open, saved to ~/Code/mydir and I move mydir out and replace it with a new folder with the same name, and then save the project it saves a copy of the tmproj file in the new mydir directory.
  • Blank lines cannot be selected when selecting by lines in some cases. Currently if selecting a series of lines (by triple-clicking a line and dragging up or down) and intend to select a blank line above or below the selection it doesn't select the blank line, instead skips over the blank line and selects the line of the next line of text.
  • Line manipulation functionality is inconsistent when start-of-selection rests in the middle of a line. This problem exists for Shift Left/Right and Comment Line functions. Ex: If you click the cursor to the middle of a line and cmd-/ the WHOLE line is commented. But then if you make a selection across multiple lines, and the beginning of the selection is in the middle of the line and cmd-/ the first line comments begin where the selection began (rather than at the beginning of that line). Workaround: I created macros that select the entire line(s) before applying manipulations.
  • Create a key command for "Replace" (In addition to Replace and Find). Workaround: This feature exists, it's just called "Replace All in Selection."
  • Multi-file search needs an option to ignore files based on file attribute patterns (filename, owner, type).


  • Allow multi-file search on an arbitrary directory. I often will need to quickly search through a folder of files to find some code I've used before for utilization in a current project.


  • Multi-file search needs to have multiple results windows.
  • Allow multi-file recursive find differences of directories and files. This feature is the only reason I have yet to rm -fr BBEdit.
  • Search form should remember Regular Expression checkbox choice.
  • If "Regular Expression" is the currently used choice for search, patterns selected with apple-E should be preg_quoted. (i.e. [ ] $ { } etc are changed to \[ \] \$ \{ \}.
  • When find/replacing, why does \n expand only when using regular expression searches?
  • Save search/replace pairs for later use. Workaround: One could use macros to store and replay search/replace operations, however I often need to recall a commonly-used regex and modify it slightly before executing. Which brings me to...
  • Find in Project doesn't give any feedback if a search returns no matches. It should.


  • Allow editing of macro items.
  • Find differences between top two windows.
  • Different syntax coloring for different languages (i.e. use "Pastels on Dark" for PHP, but "IDLE" for plain text, etc).
  • Add commands for delete to beginning/end of line, forward delete character/word with shift-delete. Workaround: macros!
  • Allow some commands to run if no windows are open (such as the Restart command). No windows need to be available to run the command, but TextMate won't run any command unless a window is open. Maybe use a scope called "textmate" or "system" or "windowless" to specify which commands are safe to run? Likewise for HTML output windows, such as "Search the TextMate Mailing List."
  • Newly created and opened windows are positioned about 23 annoying pixels below the menubar, putting the status bar below the bottom of the screen. Workaround: use an applescript command to move the window back to the top of the screen.
  • In some cases "Find Next" will cause the screen to scroll right (soft wrap is off) to better reveal a match even if it would fit within the screen if it hadn't scrolled right. Subsequently found text extending beyond the left of the screen often does not cause the screen to scroll far enough left.
  • Beginning and end PHP tags do not have a scope applied to them (i.e. <?php .. ?>). Workaround: I modified the HTML language bundle...
 
    php = { patterns = (
            {   name = 'source.php.embedded.html';
                comment = 'match only multi-line PHP with leading whitespace';
                begin = '(?:^\s*)(<\?(?:php|=)?)(?!.*\?>)';
                end = '(\?>)(?:\s*$\n)?';
                beginCaptures = { 1 = { name = 'source.php.opentag'; }; };
                endCaptures = { 1 = { name = 'source.php.closetag'; }; };
                patterns = ( { include = '#php-source'; } );
            },
            {   name = 'source.php.embedded.html';
                begin = '(<\?(?:php|=)?)';
                end = '(\?>)';
                beginCaptures = { 1 = { name = 'source.php.opentag'; }; };
                endCaptures = { 1 = { name = 'source.php.closetag'; }; };
                patterns = ( { include = '#php-source'; } );
            },
        );
    };
 
  • Auto arrange windows! I frequently need to see two windows side-by-side. Workaround: I created a series of applescript commands like the following:
 
osascript -e '
tell application "TextMate"
    set bounds of window 1 to {1, 0, 640, 832}
    set bounds of window 2 to {641, 0, 1279, 832}
end tell
' &>/dev/null &
 
  • I added a mysql command to Describe table under word and display output as a tooltip:
 
require_cmd mysql
query=${TM_SELECTED_TEXT:-$TM_CURRENT_LINE};
mysql --table -e "describe $TM_CURRENT_WORD;" "$MYSQL_DB"
 
  • I added a PHP command to display Documentation for Codebase Function from my web-framework lib directory:
 
cd $CODEBASE_DIR/lib;
grep -iB 18 "function $TM_CURRENT_WORD(" * | sed -e 's/^ *//' | grep -E '^.*?(/\*|\* |function)';
 
  • Added Count Occurrences of Selection in Document command:
 
#!/usr/local/bin/php
<?php
$document = file_get_contents('php://stdin');
$selection = getenv('TM_SELECTED_TEXT');
if ('' != $selection) {
    printf('%s occurrences of "%s" in document', substr_count($document, $selection), $selection);
} else {
    echo 'No text selected';
}
?>
 
  • The "Go to FIle" window should have an option to remember the last entered search string. And/or allow the selection and opening multiple files at once. Often I need to open versions.php, versions_list.ihtml, and Version.inc.php all at once or subsequently.