< expLog

Commands I wish I knew earlier

Introduction   ignore

This is a collection of simple shortcuts and tricks that I was surprised existed (both in a good and a bad way) and (sometimes) wish I had known about earlier. Everyone's going to have a different set, YMMV.

Obviously not exhaustive; I also plan to keep updating this list over time.

Custom Styling   ignore


Process Substitution   

Create a fd for a piped process: this can be useful for piping in the output of multiple programs into a single one, etc.

A nonsensical example to show what I mean

vimdiff <(cat file1) <(cat file2)

SSH Escape Sequences   

Before I found out about ~. I would consistently kill and open new terminal windows while waiting for SSH to disconnect.

Note that ~ is only recognized as an escape sequence after a newline: that would frequently trip me up before I RTFM'd.

Supported escape sequences:
 ~.   - terminate connection (and any multiplexed sessions)
 ~B   - send a BREAK to the remote system
 ~C   - open a command line
 ~R   - request rekey
 ~V/v - decrease/increase verbosity (LogLevel)
 ~^Z  - suspend ssh
 ~#   - list forwarded connections
 ~&   - background ssh (when waiting for connections to terminate)
 ~?   - this message
 ~~   - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

Android Shell: Toolbox   dislike

Toolbox's chmod doesn't support characters: in other words, chmod +x doesn't actually do anything meaningful.


Winner Mode   

After wasting a lot of time recreating my perfect window configurations only to have them decimated by a help command, an accidental agenda command, etc. — I found out about winner mode to quickly restore previous configurations.

C-c left: Undo window changes
C-c right: Redo window changes

Lexical Binding   

I've never really written much code in languages that don't support Lexical Binding — and finding that my SICP inspired stateful closures weren’t working in elisp definitely threw me off.

I’m going to find out the hard way how this behaves in conjunction with org-babel.

(setq lexical-binding t) ; buffer local by default