Toggling iTerm2 Full Screen Mode

This post is Apple Mac specific so Linux and Windows users can have the day off.

I came across this tweet that has a very useful piece of parenthetical information:

I’m a heavy user of winner-mode so that part of the tweet wasn’t news to me. What was news is that ⌘ Cmd+Return toggles full screen mode in iTerm2. I don’t often use a non-Emacs shell but when I do I use iTerm2 and sometimes find it useful to have it in full screen mode but making it full screen in the normal macOS way (clicking buttons) was just enough friction that I often didn’t bother. This method is fast and easy and doesn’t involve the mouse at all.

Posted in General | Tagged , | Leave a comment

Implementing the Eisenhower Matrix in Org-mode

The Eisenhower Matrix—so named because it was used by Dwight Eisenhower—is a technique of visualizing and prioritizing decisions by marking them urgent/non-urgent and important/non-important. If you mark each task with the two attributes, it will fall into one of four quadrants: important/urgent, important/non-urgent, non-important/urgent, non-important/non-urgent. The quadrant a task falls in helps you decide when, if ever, to deal with it. Take a look at the link above to see the details.

A few years ago, Tom Purl wrote a short post showing how to implement the Eisenhower Matrix in Org-mode. His system works pretty much the way you think it would. He has two potential tags for each task: “important” and “urgent”. The tasks get tagged with 0, 1, or 2 of the tags, which effectively puts them in one of the quadrants.

The rest of the system is a set of four agenda searches, which he labels “1”, “2”, “3”, and “4”. For example, the “2” search looks for the tags “+important-urgent”. Take a look at Purl’s post for the others if you are in any doubt.

The idea is simple but effective. If you’re looking for a way to get a handle on your tasks, first read the Eisenhower Matrix article and then Purl’s post for a simple implementation. You won’t need any fancy websites or apps: just Emacs.

Posted in General | Tagged , | Leave a comment

A Long Form Writing Environment

Ryan Rix, who has the most well thought out and complete Emacs environment that I’ve seen has a post on the setup he uses for long form writing. By “long form” he means more than a paragraph or two on some subject. It’s mostly used for his blog and a set of private notes.

Most of the configuration deals with generating static pages for his blog. He uses a package called org-page to do most of the heavy lifting. That and the Org publishing system does just about everything he needs.

If you like Rix’s description of his Emacs working environment, you may enjoy his latest post too.

Posted in General | Tagged , | Leave a comment

Working Remotely

I’ve long been enamored of the idea of working from anywhere. These days, that seems boringly quotidian but just a few years ago it was a radical idea fiercely resisted by the type of manager who believed that unless you could peer over a worker’s shoulder you couldn’t really manage them.

Still, as much as I like the idea and thrive under it, it’s definitely not for everyone. Even more importantly, it’s non-trivial for companies that want to embrace the idea to get it right.

Viktor Petersson has a decade’s experience both working remotely and managing others who do so. He’s written a nice post that explores what he’s learned from a decade of remote working. The post takes the point of view of both the remote worker and his manager. His first point is that the experience is not for everyone. Some workers simply lack the discipline to work remotely. Others miss the face-to-face social interaction with their colleagues.

For those can deal with working remotely, there are many benefits. They save a lot of time commuting that can be spent on more productive activities. Perhaps more importantly, it lets them get a full night’s sleep with all the benefits that brings to both the employee and employer.

The other side of that coin is that companies can’t have it both ways. They must either commit to remote work entirely or not at all. The problem with trying to have it both ways is that the “office workers” come to enjoy a privileged position at the expense of the remote workers.

Those companies that do opt for a remote work force get to choose from a much larger talent pool than those trying to hire locally. Still, in-person interaction is important and Petersson stresses the necessity to have regular face-to-face encounters.

If you’re thinking of working remotely or of managing remote workers, you should definitely give Petersson’s post a read. He’s got a lot of good advice.

Posted in General | Tagged | Leave a comment

Some Useful Bash Variables

In a computing world that often seems increasingly captured by the “point and click” mindset, it’s useful, now and then, to be reminded of the power and value of the command line. I’m not a “I do everything in the terminal from the command line” guy but I do often find that certain tasks are more easily accomplished that way.

Over at zwischenzugs, Ian Miell illustrates that power with his post, Seven Surprising Bash Variables. If you’ve been using Bash for a while, you’re probably familiar with some of them but there’s likely some on his list that you haven’t seen. I was surprised to learn about the REPLY variable and how it can make getting interactive responses in the shell easier. Take a look at his post for the details and some other useful Bash variables.

If you like that post you might also enjoy his post on Bash options, Eight Obscure Bash Options You Might Want to Know About. Both posts are definitely worth a few minutes of your time. Unless you’re permanently stuck in point and click mode.

Posted in General | Tagged | Leave a comment

Magit in Spacemacs

Jack of Some is back with another video in his Absolute Minimum Series. This time, he takes a look at using Magit from within Spacemacs. Like his last video on Refactoring in Spacemacs, this one is applicable for all Emacs users whether or not you worship in the Church of Spacemacs, There are a couple of Spacemacsisms but they’re mainly the keystrokes to invoke Magit status.

Most of the action takes place in Magit which looks and works the same regardless of the Emacs installation you’re using. Jack covers all the “everyday” things that you need to do with Magit.

He starts off explaining how navigate on the Magit status page and bring up diffs for the files that have been changed. He continues with a demonstration of committing changes including how to commit just some of the parts of a changed file. Once he’s got his changes committed, he’s ready to push them upstream but, of course, he doesn’t want to push to the Master branch so he shows how to create and push to another branch instead.

His next topic is pulling and merging. He creates a repository and local copy that have conflicting changes. He uses that to show how to resolve merge conflicts using ediff. I particularly liked his exposition of that process.

Finally, he looks at git blame and stashing. Those are really simple operations that some tutorials make heavy going of but Jack shows how they’re simple and straightforward.

The video is 8 minutes, 25 seconds so it’s easy to watch it on a coffee break. I recommend it to all Magit users.

Posted in General | Tagged | Leave a comment

Collaboration in ed(1)

As some of you know, I satisfy my retro-computing itch by occasionally firing up ed for a simple editing task. In truth, I do it mainly to stay current with ed against the day that I need it. That and the fact that it’s fun even if I wouldn’t want to use it as my main editor.

This week, the proprietor of Programming Praxis didn’t have time to come up with a real programming exercise so he shared what he described as an insane example of collaboration using ed. Actually, it’s not really “collaboration” but a way of sending some lines in one ed session to another. There is, of course, no built-in way of doing that in ed but the originator of the idea came up with an amusing solution.

I’ll let you go over to Programming Praxis to see how it’s done. Just to make things clear, the idea is to send lines 15–21 from session a) to session b) and have them inserted after line 13 in session b). If you’re familiar with Vi/Vim, you’ll have no trouble understanding what’s going on. Don’t worry about the -p in the ed invocations; that’s just to set the prompt to make it easier to follow what happens during the “collaboration.” None of this has any import at all, of course, but it is an amusing diversion on a lazy Sunday afternoon.

Posted in General | Tagged | Leave a comment

A Nice AWK One-liner

How would you solve this problem?

Given a file of text lines, remove duplicate lines keeping the original order.

The first thing that springs to mind is using

sort | uniq

or perhaps

sort -u

but these solutions fail to maintain the original order.

Lazarus Lazaridis has a very nice solution that accomplishes the task with an AWK one-liner. I wrote about the power of AWK one-liners a couple of weeks ago so this is a nice coda. Lazaridis’ solution leverages AWK’s associative arrays so a similar solution is available in many other languages. Try, though, to implement it in, say, Python. It’s straightforward but it’s definitely not a one-liner.

Lazaridis’ post explains his solution in detail so it’s worth reading even if you aren’t an AWK user. He also explains how you can solve the problem with sort, although not in a trivial way.

Notice how the AWK solution leverages the two powerful features of AWK that I discussed in my AWK post: the implicit main loop and associative arrays. It’s amazing how many problems can be trivially solved by using those two features.

Posted in General | Tagged | Leave a comment

An Emacs Journey

Someone tweeted a link to a 6-month-old post by Murat Demirbas, a computer scientist at SUNY Buffalo. The post, My Emacs Journey, describes Demirbas’ use of Emacs and his embracing of Org mode. He’s been using Emacs for over 20 years and says that he has reached the stage where his Emacs knowledge is mostly held in his muscle memory. He says that if you ask him what the key sequence for some command is, he can’t tell you until he types it and observes what he typed. I experience something similar: if you give me a key sequence and ask me what it does, I’ll have to stop and think and possibly won’t know even though I use it all the time without conscious effort. As Demirbas says, the knowledge is held in my muscle memory.

He writes at length about how Org mode changed his workflow. Like me, he uses it for writing, task management, and even to organize his thinking. I liked how he uses Org for his writing. It reminded me of a technique I’d forgotten about. When he’s writing a paper and defines a term, he turns it into a radio-target so that every time he uses it in the sequel, the new use gets turned into a link back to the definition. That’s a natural thing to do but I always forget about it.

I spent a long time reading his post because he had several interesting links to other posts or information. Take a look at his post to see what I mean.

Posted in General | Tagged , | Leave a comment

Adding Your YouTube Subscriptions to Elfeed

If you’ve been around Irreal for a while, you know that I’m a very happy user of elfeed for my RSS needs. It’s easy, fast, and, of course, I can read my feeds from within Emacs. Just the other day, I was wishing that there were some way of adding my YouTube subscriptions to elfeed. As things stand now, I have to check each of the channels everyday. Yes, I know that Google will send me a notification of new videos but I’ve stopped using Gmail for the obvious reasons and only check it once a month. I should probably just forward it to one of my active accounts.

Over at Codingquark, Dhavan Vaidya shows how to add those YouTube subscriptions to elfeed and download the videos. I briefly thought about doing this but I didn’t know that you could export your subscriptions from YouTube so I couldn’t figure out where to look for new videos. Vaidya has all that handled and it turns out to be very easy to set up.

All you need is youtube_dl and, of course, elfeed. Add a little bit of Elisp to your init.el, export your subscriptions from YouTube, and you’re set to go. I’m really happy about this; it’s one more function absorbed into Emacs.

Posted in General | Tagged | Leave a comment