I’ve always used dark color schemes for coding. I never use dark themes for writing, and I’m not a fan of Dark Mode in Mojave, but for some reason I’ve always gravitated to light-on-dark for coding. I decided to try a change, and I’ve been quite happy with the results.
I’m still using Sublime Text. As much as I dig many things about VSCode, I haven’t been able to dedicate myself to it and leave behind the comfortable environment I’ve built in Sublime. So this color scheme is for Sublime Text.
I also wrote this theme in the old PLIST format from TextMate which even TextMate doesn’t use anymore. Lack of necessity is the only reason I haven’t converted it to JSON, but feel free to submit a pull request.
I created Lucky Charms based on some of the ideas I loved from the original Espresso editor light theme. Part of my draw to dark themes is the contrast it offers for highlighted syntax. Lucky Charms aims to close that gap for me. It uses transparency and background colors to highlight function names and property keys with blue moons, regular expressions with yellow stars, and strings with green clovers (colors I mean, no emoji involved).
Without further ado, a screenshot:
Grab the theme on GitHub. I haven’t added it to Package Control, but you can just copy the tmTheme file into ~/Library/Application Support/Sublime Text 3/Packages/User/ and open the Sublime Text->Preferences->Color Scheme… menu to use it.
As always, I’m open to all criticism, but if your complaints are about light themes in general, consider > /dev/null.
Thanks to PDFpen for sponsoring BrettTerpstra.com this week!
PDFpen is the ultimate tool for editing PDFs. The latest features in version 10.2 include support for dark mode on Mojave as well as smoother scrolling, faster thumbnail drawing, and increased maximum zoom.
Using PDFpen, you can:
Go paperless with scanning and OCR
Markup and highlight PDFs
Search and redact sensitive info, such as account numbers
Here’s a handy trick I use at the command line to quickly find filenames matching simple wildcard patterns in nested folders. It’s called lsgrep because that’s essentially what it does: grep a list of filenames and return matches.
This function uses The Silver Searcher (ag), which can be installed via Homebrew (brew install the_silver_searcher). It could easily be modified to work with ack or other grep replacement (or grep itself, with the right options).
Copy the function below into your ~/.bash_profile (or wherever you source functions from at login). Source the file to test it out (e.g. source ~/.bash_profile).
By default it recurses 3 levels deep into folders. You can modify this in the last line by changing the number after the --depth flag.
You’ll note that when it creates the $NEEDLE search term, it substitutes basic “*” and “?” wildcards for actual regular expressions. It also escapes “.” to search for a literal period. Spaces are converted to “.*” searches, meaning any number of characters can exist between the arguments. Thus:
In the first example you can see that the “?” wildcard only allowed one random character between “d” and “rty”, so the file containing “dirty” was returned. In the second example the search was converted to “d.*rty”, so any file with containing a “d” and then an “rty” at any point after is matched.
Limit By Filetype
The literal period substitution allows you to add an extension at the end of the query to limit the filetype.
It’s a great shortcut to find files you know the name of, and in iTerm you can then just Command-Click a result to open it in the appropriate editor. You can also use it in another command like cat $(lsgrep d?rty). I hope you find it as useful as I do!
I’ve mentioned Workona before, and it remains my favorite tab/window/workspace management solution for Chrome. The developers recently solved the problem of potentially increased CPU usage when you had too many tabs/workspaces open, and now it’s not only the most convenient tab manager, it’s the fastest way to work with a TON of windows and tabs.
It’s No-Shave November and National Novel Writing Month. I figured as long as we’re letting our body hair grow while toiling over literary masterpieces, I should probably make sure everyone has the best possible writing tools.
During November, Marked 2 will be 30% off ($9.99). No coupon needed, and the price applies to both the Mac App Store and Direct versions. Go get it while it’s hot!
Even if you’re not joining me in the Marked sale, do check out No-Shave November and help support cancer awareness and research.
Why Every Novel Writer Should Use Markdown
Whether you’re shaving or not, if you’re writing there’s good cause to get into Markdown. Here’s the number one reason: it’s just text.
You don’t have to learn a darn thing. If you’re most concerned about getting words on the page, using a text editor that relieves you of any considerations about formatting, images, and fonts means you focus on getting your ideas out.
Markdown is just plain text, you already know how to write it. You can learn more to add images, links, text emphasis, tables, etc., but for 99% of novel-writing, you don’t need those things anyway.
Marked can show you beautifully formatted versions of what you’re writing without you needing to touch a font palette at all. So pick a text editor, get Marked, and get to writing.
(Additionally, using Markdown and Marked 2 means you’re definitely not using a typewriter, so there’s zero chance for males of catching that beard you’re growing on a carriage return.)
But Is There Anything New?
The latest update (version 2.5.27) just went out. Since I last blogged about it, there have been several releases, including a plethora of improvements and fixes, so here are some highlights:
The URL Handler can add new Custom Styles directly from files. See StyleStealer, my recent bookmarklet for turning any web page into a Marked custom style.
A full set of Mojave Dark Mode improvements (including fixing the black-on-black “Report Issue” window)
Improvements for “Multi Column” mode (choose Multi-Column from the Style menu)
Multi-column theme page numbers
Multi-column theme document progress indicator
New Status bar icons
Offer suggestions for Use Alternate marks when highlighting (with default Plain English Campaign word list items only)
Handle Highland-specific text directives
Allow Highland files to be Markdown instead of Fountain
Option to process any document as Fountain, even without a Fountain extension
In-document search improvements
MindNode 5 integration handles both single file and package formats
There’s a new preference to syntax highlight only fenced code blocks which have a language specified
Fixed various crashes
Handling of images linked to other images with inline syntax
Collapsing sections caused display errors with highlighted code blocks
Cmd-D and backtick will now both set a new bookmark at the first available bookmark index
IA Block syntax rendered inside fenced code blocks
A long time ago I wrote an extension for Safari called TabLinks. It simply generated Markdown lists of links to all the currently opened tabs. It’s been updated a few times over the years, but recent changes to Apple’s handling of Safari extensions has discouraged me from further updates.
I didn’t realize how many people used and relied on the extension until it was suddenly no longer available. Since the release of macOS Mojave, Apple now requires that extensions be released as apps through the Mac App Store, codesigned and approved by Apple. I could do this, but it’s a lot of extra effort and it’s a pretty simple extension for all that work.
So, what I’m proposing is moving the functionality outside of Safari. There’s already a Service in the Markdown Service Tools that grabs all of the open Safari tabs and inserts a list of them into your text editor. The only thing that TabLinks really added to that was templating, allowing the format of the list to be customizable.
If I expanded that Service to allow templating and the storing of templates in persistent preferences, I think it would cover the needs of those who used TabLinks. What I’m curious about, and putting forth as a question to be answered in the comments is: are there other aspects of TabLinks that you use and would miss? Are there additional features you’d like to add?
A cool little macOS utility for people who listen to music on their headphones. When an external sound passing a set threshhold occurs, it will pause your music and amplify the sound through your input device (all customizeable) basically making sure that when someone starts talking to you, you don’t have to pause your music and ask them to repeat themselves.
Thanks to Cammeleon for sponsoring BrettTerpstra.com this week!
Cammeleon is an app that gives you the worry-free ability to send and share photos hidden in plain sight, private and encrypted. As photos have become an extension of the way we communicate on a daily basis, we feel it is a necessity to ensure that everyone has the tools at their disposal to maintain their privacy.
Cammeleon is an app that seamlessly allows you to hide your pictures on your phone and other devices. It uses state-of-the-art technology to hide one picture inside another picture, allowing you to send the picture (with the other picture hidden inside) via your favorite messaging apps. To view the hidden picture, the recipient simply needs to open it with their instance of Cammeleon. It’s that simple.
Right now we’re running an IndieGogo campaign to help support the development of the next version. The upcoming features include even more security, fingerprint and facial recognition, updated encryption, and improved integration with existing messaging apps. Backing the campaign means you’ll be the first to receive the latest and greatest, and access to private versions you can run on your own servers. Check out the campaign here!
I’m releasing a minor update to PopMaker, my little tool for creating custom PopClip extensions. I hadn’t realized that the icon feature had broken, but since I was in there fixing that I made a few other tweaks, mostly layout and error handling.
I’ve updated the StyleStealer bookmarklet that I published a while ago. In addition to a bit more accurate styling, it can now add styles directly to Marked 2 (2.5.11 or newer) without requiring any file saving or manual adding in Marked’s preferences.
This tool is great if you’re on online writer who wants to see how their work will appear on the destination blog or publication. It’s also great if you like to Markdownify articles and be able to read them later with their original look.
(What it’s not great for is stealing other people’s work and using it to publish your own. Let’s not do that.)
(If you already have StyleStealer installed, it’s already updated. Congratulations.)
To add it to Safari or Firefox, just drag the button below to your bookmarks/favorites bar.
In the latest version of Chrome, you can no longer drag in-page links to the bookmarks bar. This now requires:
Bookmark the current page to the bookmarks bar (CMD-D or click the star in the url bar)
Right click on the bookmarklet button below and choose “Copy Link Address”
Right click on the new bookmark in the bar and select “Edit…”
Change the Name to the bookmarklet name and paste the copied address into the URL field
(StyleStealer may work in additional browsers, these are the ones I’ve tested.)
Note that the bookmarklet is designed for desktop use, because it uses Marked 2’s url handler it won’t be of much use on mobile browsers.
On a page with styling you’d like to duplicate:
Click the bookmarklet
The browser enters inspection mode and a blue bar appears across the top of the page.
Hovering over elements will outline the closest container elements, and show their selector at the top of the screen
Click a container that holds the entire article but not any sidebars or excess cruft
Note: The outline may disappear when you’re over a paragraph, but the best bet for getting the right section is actually to just click the first paragraph of text in the article/post
Enter a name for the style (defaults to the site name) when prompted
Click the “Add to Marked” link that appears
The style will appear in Marked’s style picker, as well as in the Preferences->Style->Custom CSS list where you can use the “-“ button to remove it.
When you name the style, it gets written to a file called [name].css in Marked’s application support directory. Using the same name again will overwrite the file, which means if the bookmarklet failed to match the style you can try again and update the existing style. If you have a preview window open and that style selected, Marked will even update the preview live to show you whether it worked or not!
As a technical note, the bookmarklet makes use of Marked’s new URL handler method, addstyle. With this method you can add a style from a url-encoded string or from a file on disk. To add an encoded string, use:
(If no name parameter is provided with file, the filename will be used.)
This url method will make it easier to share new styles, and eventually (hopefully) for me to build a style-sharing site for people to share their favorites. For now, if you have a great style you want to share, feel free to add it here or contact me to have me share it for you!