Editor Keystrokes

It’s surprising to me that many people still don’t know where some of the keystrokes we use everyday in our editors came from. The most famous example, I suppose, is why Vi(m) uses the j k h l keys for cursor navigation but there are others.

The thing with Emacs and Vi is that they’re really old for software and when they were developed, keyboards didn’t look at all like they do now. Anuj Kumar has a short post that explains all this, primarily for Emacs and Vi but also for more general frameworks like X11 and the CUA.

If you’re already familiar with this lore, you probably won’t learn much new except for the names of some of the people who influenced the design in various ways. If you aren’t familiar with it, take a look at Kumar’s post. If you’re using Emacs or Vi(m), you really should know this stuff.

Posted in General | Tagged , | Leave a comment

Zettelkastens in 10 Minutes

Tomas Vik has a very nice post introducing the Zettelkasten concept. He says that rather than spending hours researching the Zettelkasten idea, you can just read his post and get a good introduction. I especially liked his section on the slip-box method.

The TL;DR for the slip-box method is:

  1. Make notes as you read: The most important point here is to write the notes in your own words. Doing that forces you to understand the material
  2. Write atomic, self-contained, concise, permanent notes
  3. Link the notes together
  4. Tag the notes: The important thing here is to use tags that capture the concept that you think you will want to retrieve the note by.

The other useful aspect to Vik’s post is his software recommendation. He says that the best bet for most people is Zettlr. It uses Markdown for recording notes and stores them in separate files. It’s open source and works on Linux, macOS, and Windows. If you’re not an Emacs user, Zettlr seems like a good solution.

If you are an Emacser, there’s Org-roam, which is getting very good reviews. As I said before, I’ve installed it but still haven’t found time to configure it or move my (very few) notes over to it. The nice things about the Zettelkasten idea is that you can implement it in many different ways, including the original method of writing the notes on index cards and storing them in a box. That’s where the term “slip-box” came from. Slip-box, in turn, is a translation of the original German term, “Zettelkasten.”

If you’re at all interested in Zettelkastens, Vik’s post is definitely worth your time.

Posted in General | Tagged , | Leave a comment

What Could Go Wrong?

Over at Six Colors, Jason Snell tells us that congress wants to tinker with the COVID-19 tracking framework set up by Apple and Google. Why not? What could go wrong? The same people who brought you the Government Healthcare Website, the botched and confused response to COVID-19, and, of course, the DMV want to try their hand at designing a secure, privacy protecting health tracking application. They seem sure that Apple and Google could use the help.

You don’t have to be a cynic or a fortune teller to predict that what this will mean in practice is that the privacy guarantees will be weakened in the name of getting more data. Local and federal health officials all want as much data as they can get so that they can more effectively track the spread of the virus. That’s a legitimate desire but it can’t come at the cost of a robust privacy guarantee.

I say that not as a privacy absolutist but as a pragmatist. Americans are famously curmudgeonly and suspicious of government intrusions into their business. As Snell points out, there’s a very real danger that privacy concerns will cause a significant number of Americans to opt out of participating in the program resulting in less data and probably rendering the program ineffective. As nice as it would be for various congressmen to see their names on legislation aimed at combating COVID-19 perhaps they could leave this one alone.

Posted in General | Tagged | Leave a comment

A Handwriting Font

Sacha Chua has perpetrated a truly wonderful hack. She’s built a font based on her handwriting. She’s using it for blog post titles and a few other places on her website, so take a look there to see what it looks like.

The reason I really like her project is because it’s such a great example of software engineering. Think for a moment how you would do it. You want to take examples of your printing and turn it into a font. I, for one, would have no idea where to start. I’d probably think of something like Knuth’s Metafont but it’s not clear how to proceed from there or even if it’s the right tool. Like me, Chua has no experience with typography but using open source tools she came up with a very nice looking font. It’s much more than throwing together a bunch of pictures of letters to make a monospace font—most of us could probably do that. Her result is a proportional font complete with kerning.

Another great thing about her project is she did it in a literal way by using Org mode and code blocks to write and document her code. You can see that code here. Of course, she also did a lot of hand tweaking to get things just right. Doubtless her artistic talents were a big help there.

Most of us probably don’t need a “handwriting font” but it’s a great hack and definitely worth talking a look at.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Atom and VSCode

I recently saw a tweet that has some things to say about Atom and VSCode that are sure to make certain heads explode. It’s red meat, it’s Friday so here’s today’s Red Meat Friday offering:

For the Emacsers among you, at least it provides proof that it’s never too late for someone to see the light and move to Emacs.

Posted in General | Tagged , | Leave a comment

Summarizing Class Notes

Matheus Augusto da Silva has an interesting video that details how he uses Emacs and Org-mode to write summaries of his class notes. After a class, he likes to write a half page summary of his notes. He finds that limiting the summary to half a page helps him to think about the important points and distill down the content. You may or may not like that approach but his workflow could be useful in other situations.

What’s nice is that there’s quite a bit of formatting of his PDF output but da Silva handles all that with a LaTeX include file and headers. The actual text is entered in an Org file and includes virtually no LaTeX other than some coloring macros.

Even if you no longer need to worry about organizing your study materials, da Silva’s workflow shows how it’s easy to produce richly formatted PDF output by entering plain text into an Org file. He doesn’t have a link to his include file but there is a link to his configuration that includes the skeletons that he uses for his Org file headers.

The video is 9 minutes and 55 seconds so you can probably watch it during a coffee break. As I said, I like the way he abstracts all the formatting to files so that he doesn’t need to think about it once his environment is set up.

Posted in General | Tagged , | Leave a comment

More on the Websockets Port Scanning

This is a short update to my Websockets: Why We Can’t Have Nice Things post. That post discussed a tactic used by several Web sites that uses Websockets to scan for open localhost ports. There was some speculation that this was in service of an attempt to determine if remote processes were running on the computer, a security risk. Whatever the original purpose, Steve Stagg discovered that it was possible to connect to these ports and recover possibly sensitive data.

Bleeping Computer has an update on the matter that among other things lists some or all of the sites using this tactic. Their article also sheds light on the reason for the port scanning. It turns out that—at least on the part of the major sites—it is a security measure. You can read their article for the details but the TL;DR is that they’re all running a script from Lexis Nexis’ Threat Matrix service that performs the port scanning.

I expect that the browser manufacturers will soon put an end to this—especially in light of Stagg’s revelations—and, in fact, it’s already possible to disable it in Firefox. In the mean time, I doubt that this is really anything to worry about. It’s more about the audacity of Web sites thinking they have the right to run any code they want on our machines. Just imagine their response if we uploaded code to their servers to help prevent the download of malware. This sort of thing really needs to be made illegal.

Posted in General | Tagged | Leave a comment

Arizona Sues Google

As I said previously, if you care about privacy, you shouldn’t be using an Android phone. My point was that even if you believe Android phones are technically superior or equivalent to the iPhone, no reasonable person can doubt that Apple is much better on privacy than Google’s Android-based phones. That argument was based on especially egregious behavior by Android phone manufacturer Xiaomi. But it turns out that maybe you don’t need Xiaomi to make that case.

Arizona is suing Google over allegations it illegally tracked Android smartphone users’ locations. This is not Xiaomi or any other manufacturer: it’s Google’s Android operating system itself that’s being challenged. The Arizona DA says that Google tracks users even if they disable it. The DA claims that Google still collects some location information unless the user turns off another hard-to-find option.

Everyone here knows I’m not a fan of Google but I’m conflicted about this. It’s certainly true that Google makes it extraordinarily difficult to stop them from tracking you and their behavior is otherwise reprehensible but I’m not sure about these charges.

The functions for which Google still collects data is Maps and Weather. A case can be made, I think, that gathering location information is needed to make these applications useful. I’m pretty outraged that the French and Italians are fining Apple over their slowing down old iPhones to preserve battery power and going after Google for getting location data for Maps or Weather feels the same to me.

Of course, just because you need to figure out where a user is to deliver optimal Maps or Weather results doesn’t mean you have to record and send the data back to Google. The Washington Post article doesn’t make it clear exactly what’s happening but you don’t have to be a cynic to be suspicious of Googles intentions. They do, after all, have a track record.

Posted in General | Tagged | Leave a comment

More On The Magit Initial Status Page

A couple of weeks ago, I wrote about setting the initial visibility of Magit sections. It was a bit of a nuisance but without it I had large expanded sections that invited an inadvertent stage command that could freeze Emacs for up to a minute. The change worked well in that the sections were folded when I first invoked the Magit status page but I found that sometimes I’d still stage a large set of files by mistake. That’s because when I have to choose a file to stage, I often just type s and let Ivy give me a list to choose from. If the point was on one of the folded sections, it would stage everything in that section.

So the problem was that the initial status page opens with the point on one of the folded sections instead of at the Head section at the top. Given my success with controlling the initial visibility I felt confident that there would be a way of controlling the initial point position. It was a bit hard to find but easy to configure. It’s a configurable parameter if you like doing things that way. Otherwise simply add

(setq magit-status-initial-section nil)

to your init.el. You can set it start on any section but the nil says to start with it on the Head section at the top of the page. I’ve been running with this latest change for the last few days and so far I haven’t inadvertently staged a bunch of files.

This probably isn’t a problem for most of you because as Alan Third noted it’s easily solved by the judicious use of the .gitignore file but if it is, just set the initial point to the Head section. You can, of course, set it to any section if that suits your workflow better; see the documentation for the variable magit-status-initial-section for details.

Posted in General | Tagged , | Leave a comment

Escape from VSCode

Zameer Ul Haque has an interesting post in which he describes his escape from VSCode. Usually when you see stories like this, they’re about escaping from Vim and moving to Emacs or the other way around. Now that the new hotness is VSCode, we’re seeing a lot of people discover that there are better editors and moving to Vim or Emacs. As I’ve said before, which one you choose depends on what you want from an editor. As I’ve also said before, if you’re a top flight engineer, you probably use one or the other of them.

One of the things about the post that surprised me was that Ul Haque considered Vim and Emacs essentially magic accessible only to Elite. That’s a comforting notion to us Emacers and Vimers, of course, but, really, it’s nonsense. Yes, they have a slightly higher learning curve but that’s mostly because they’re more powerful. If an editor can do more things, it takes longer to learn how to do all those things.

One interesting thing I learned from his post is that there’s a plugin for VSCode that implements the Spacemacs (hence Vim) key sequences. Ul Haque used that to get used to Spacemacs keybindings. Once he felt comfortable with them he moved to Spacemacs and finally to Doom Emacs.

Take a look at his post if you want to see how one man moved from VSCode to the promised land of Emacs.

Posted in General | Tagged | Leave a comment