See Using TextMate for WordPress Code Cleanup for two useful commands: removing trailing whitespace from files and changing spaces to tabs at the beginning of lines.įinding commands and snippets within all the options available in TextMate can be challenging-unless you commit their shortcuts to memory. Utc Add a UTC time stamp in any file, using `date -u +%D\ %R` UTC as the snippet triggered when you type those letters and hit tab.ībug Add border: 1px solid red to a stylesheet for a quick CSS debug in a browser. TextMate is at its best when you extend it with your own snippets and commands to go along with all the great ones that come bundled. It’s hard to explain with text and a screenshot, so here’s a video example:, look for Working With Numbers & Columns. This functionality can save lots of time by editing multiple lines in the document at the same time. Multi-line editing with column selection in TextMate is pretty sweet. Use Ctrl-Shift-u for lowerase and Ctrl-Opt-u for title case.į5 Sort lines in the document, with an option to remove duplicates.Ĭtrl-s Inline search: keep hitting the same command to find the next result in the document. I use this one often, especially for super-long variable names in PHP files I just type the first few letters of the variable and hit Esc until I find a match. For example, if your cursor is inside the quotes on the word node in code like this: array( "node" ) you would use this command to toggle to single quotes.Ĭtrl-Shift-v Check syntax, also works in other formats.Ĭmd-/ Comment/uncomment a line or block, also works in other formats.Įsc Complete a word based on the current document. Select the lines you want to align, and then invoke the command.Ĭtrl-Shift-' Toggle single/double quotes. PHPĬmd-Opt-] Align assignments for code prettification, like in arrays or variable declarations. ! Type an exclamation point then use the tab key to insert !important quickly. CSSĬmd-Shift-c Insert a color value from the OS X color dialog, adding it to the current document as a hexadecimal value.Ĭtrl-q Format CSS, also works in other formats like HTML. Close an element, based on the opening tag. Useful for wrapping a bunch of lines with lis when making a list.Ĭtrl-Shift-l Wrap text as a link, taking URL from clipboard.Ĭmd-Opt. This is smart enough to know the self-closing tags ( img, hr, br, input).Ĭtrl-Shift-w Wrap selection in HTML tags. HTMLĬtrl-< Make an HTML element from a word file. Great for when deep down in a nested project and you need to see the context. Example of Cmd-t to open a file quickly.Ĭmd-Ctrl-r Reveal current file in project drawer. Super handy if you have tons of tabs open, or files nested deep inside folders. Running mate on a directory or set of files will make a new project in TextMate.Ĭmd-t Find a file in a project quickly. Or just open a file: mate foobar.txt.ĭragging files or folders to TextMate icon on the Dock creates a new project with the selected items. For example, take stdout and open in TextMate: ls | grep foo | mate. You can also use it to send output from other commands into a TextMate document. Mate Quickly open files from the command line-a simple yet powerful technique. In the talk I only had time for a few of my favorite tips and tricks, which I’d like to share with you-plus a few more. I recently gave an ignite-style talk about TextMate power tips, in the context of craftsmanship and tools.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |