Finally.
never stop living this way.
Finally.
DO WANT (to make myself)
Ich möchte Teil einer Handbewegung sein.
Download the MarkedBonusPack.zip.
The Marked Bonus Pack is a collection of scripts, commands and services. Some work with multiple editors, some are specific to certain editors. The Services will generally work with any editor that has the necessary capabilities. The rest are organized in folders based on the application they work with.
Installation and Usage
Services
Put the Services in
~/Library/Services, where ~ is your user's home folder. If you want hotkeys for the services, assign them in System Preferences->Keyboard->Shortcuts->Services.TextMate
Double-click on the Marked bundle to open it in TextMate's Bundle Editor. You can access the preview commands using Control-Command-M. There are two of these commands, one previews the current document and will watch the associated file for future changes, the other previews the current selection using a temporary file. The latter will not update automatically.
There's a third command for stripping header id's out of HTML documents. This can be done by setting "Compatibility Mode" in Marked Preferences, but this also causes other MultiMarkdown features to be disabled. To keep MultiMarkdown features and remove the auto-generated header ID's from the HTML output, use this command.
Sublime Text 2
Copy the Marked.sublime-build file to
~/Library/Application Support/Sublime Text 2/Packages/User/. It will show up in the "Build Systems" section of the Tools menu in Sublime. When selected, pressing Command-B will open the current file in Marked for preview. Once opened, changes to the file will be tracked automatically by Marked.Vim
Add the following to your .vimrc file
:nnoremap <leader>m :silent !open -a Marked.app '%:p'<cr>\m (or your preferred leader) will now open the current file in Marked.
AppleScript
There's one AppleScript included that performs essentially the same function as the Open in Marked Service, but with some special accommodations for Notational Velocity and nvALT. In order to use it, two configuration variables need to be edited at the top of the script. Open the .applescript file in AppleScript Editor and modify the
propertylines at the top, then save it as a compiled script (scpt) file. You can then run it from the AppleScript menu (enabled in the AppleScript Editor preferences), or from a hotkey-capable application like FastScripts.The nvALT scripts do their best to figure out the file, but don't always work. The next version of nvALT should make this a lot easier.
I'd donate my organs to brett terpstra any day.
Quick tips are random posts regarding something I discovered on my way to something bigger. They usually get longer than “quick” would imply, for which I refuse to apologize.
I just (accidentally) discovered the command
topswhile working in Terminal. I’m not seeing many of mentions of it (any) on the web, but it could be too early in the morning for me to form a coherent query. Regardless, I thought I’d give it a mention. The man page is quite complete, and has a succinct explanation of the command:tops - perform in-place substitutions on code.It’s not just useful for code, though, it makes a great tool for batch modifications to any text file(s). With an easy-to-grok syntax, it does in a few words what I usually do in three or more piped oneliners (grep, awk, sed, etc.). There’s a
replacemethodoption specifically for replacing Objective-C-style method names, which leads me to believe that this is an OS X-only tool, possibly only part of the Developer Tools. If anyone more familiar with this command has insight, I’d be curious.Tops can read a script file with rules for search and replace, or take commands as arguments to process changes in a text file instantly. Simple example:
[Select all]tops replace "Word" with "Markdown" writing.*All instances of “Word” in all files with the name “writing” were just replaced with “Markdown.” Try it, it’s cool. The options go far beyond my simplistic example, but the more complex options are primarily specific to Objective-C. If this piques your curiosity anyway, spend some time with
man tops.