![]() ![]() The following are a series of steps that you can take to reproduce the same results as mine. Ruby and Python deserve their own command because they are the languages whose code I publish the most, but pressing ⌃⌥3 (or 4) prompts a long list of languages to choose from as shown below (the image is cut to reduce its length): I placed these commands under the Text menu, since they are globally available for textual formats, whether I’m composing HTML, Textile, Markdown or ReST but this is entirely arbitrary and I suspect that many would consider the HTML menu instead or place a “Convert to HTML” entry in the menu of the specific language. Should I ever forget these 4 shortcuts, I can take a quick look at the Text bundle menu shown below. I could, if so inclined, associate all 4 commands to the same shortcut and be prompted by a menu every time this combination is pressed, obtaining something along the lines of the image shown below: Note that this is not necessarily the best arrangement, but it works well for me. In practice, this means that I use 1 and 2 most of the time and these shortcuts are easy enough to remember. ⌃⌥2 is for Python snippets, ⌃⌥3 for any other language, and ⌃⌥4 for any language as well but with the option of adding line numbers. When I select a snippet of Ruby code in TextMate and press ⌃⌥1 a snippet of code is transformed into the proper HTML. The result of that brief session is a hack that delivers the integration of TextMate and Pygments, so that code can be easily converted to HTML in order to beautifully present it.įirst, let’s see how I use it. So on the weekend I pulled out my big sharp razor and started yak shaving. However, switching between TextMate and the command line is not as convenient as I’d like. Pygments is a Python library but ships as a command line tool as well. But when it comes to highlighting code, for me Pygments is simply unbeatable. A few solutions exist, including embedding gist snippets, using “Create HTML from Document” in TextMate, or adopting JavaScript libraries or WP plugins. One of the problems that I had, and that others probably face too, is the less than smooth process of publishing properly highlighted code in posts and HTML pages. All of my posts are first drafted in my trusty editor before being published. Fix potential crash when deleting bundles on disk ( rm -rf).Like many, I don’t use TextMate just for coding.Setting TM_HG and TM_GIT in Preferences is no longer eclipsed by the default properties (which set them to point at /opt/local/bin).TextMate 1.x and 2.0 can now both run at the same time.Rename help book to “TextMate 2” which fixes issues where Help → TextMate Help showed TextMate 1.5’s help book.Carriage returns ( ) on the general clipboard are converted to regular newlines when pasting.With multiple carets, ⌘-clicking one of them removes it (i.e.File browser can be placed on the right side: defaults write fileBrowserPlacement right.Anti-alias can be disabled: defaults write disableAntiAlias -bool YES.HTML output can open in its own window: defaults write htmlOutputPlacement window.See below for the complete release notes: 2011–12–16 The big items here are the ability to disable text aliasing, the ability to put the file-browser on the right side of the window, and the option for HTML output to have its own window. I was delighted to see a significant update to the alpha released earlier today, with some much anticipated features/settings added. ![]() Remove folding patterns from grammar template.Fix issue with ⌃⇥ not always working to move focus to file browser.Fix issue with selection sent to commands needing entire document (e.g.Fix issue with indented soft wrap having the prefix string wider than the wrap column.Tab bar can be made always visible: defaults write disableTabBarCollapsing -bool YES.to text.html to only have the “save on lost focus” enabled when editing HTML files - alternatively one can introduce a custom scope like attr.save-on-deactivate and set that for specific projects via a scopeAttributes setting in. The approach in 2.0 also allows to run some code, for example reloading the currently open browsers, and it can be scoped e.g.This allows creating a command with “Save” set to “Modified Documents” and thereby recreating TextMate 1.x’s ability to save modified documents on lost focus. The scope selector is matched against the “current scope” of the visible document (in each window). A command with this class will be executed when the application gain/lose focus. Introduced -activate and -deactivate as two new semantic classes.Disabling that auto hide makes Textmate 2’s functionality like that of Textmate 1. This release allows you to disable the functionality that hides the tab bar when only one file is open. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |