Emacs microhabit: Switching windows with windmove, ace-window, and ace-jump

When I work with a large monitor, I often divide my Emacs frame (what most people call a window) into two or more windows (divisions within a frame). I like this more than dealing with multiple Emacs frames, even if I could spread those frames across multiple monitors. I find it easier to manage the windows using keyboard shortcuts than to manage the tiling and display of frames.

One of the Emacs micro-habits I’m working on is getting better at switching between windows. When there are only two windows, C-x o (other-window) works just fine. However, when there are three or more, it can take a few repetitions of C-x o to get to where I want. I could get around that by binding other-window to M-o instead, replacing the default keymap for that. Or I could try to get the hang of other ways to move around.

Here’s an 8-minute video showing windmove, ace-window, and ace-jump:

https://www.youtube.com/watch?v=nKCKuRuvAOw&list=UUlT2UAbC6j7TqOWurVhkuHQ

Windmove lets you move around with cursor keys, if you set up the appropriate keyboard shortcuts. Ace-window works like ace-jump. In addition, you can use C-u to swap windows and C-u C-u to delete windows. Ace-jump works across windows, so that’s handy too.

Here’s my relevant code snippet for Windmove. I changed this to use define-key instead of bind-key.

(defvar sacha/windmove-map (make-sparse-keymap))
(define-key sacha/windmove-map "h" 'windmove-left)
(define-key sacha/windmove-map "t" 'windmove-up)
(define-key sacha/windmove-map "n" 'windmove-down)
(define-key sacha/windmove-map "s" 'windmove-right)
(define-key sacha/windmove-map "[left]" 'windmove-left)
(define-key sacha/windmove-map "[up]" 'windmove-up)
(define-key sacha/windmove-map "[down]" 'windmove-down)
(define-key sacha/windmove-map "[right]" 'windmove-right)
(key-chord-define-global "yy"     sacha/windmove-map)

Here’s the cheat sheet I made for myself:

2015-01-12 Emacs microhabit - window management -- index card #emacs

2015-01-12 Emacs microhabit – window management – index card #emacs

And here’s a simpler reference that you can personalize with your own shortcuts:

2015-01-18 Emacs microhabit - Switching windows -- index card #emacs #microhabit

2015-01-18 Emacs microhabit – Switching windows – index card #emacs #microhabit

Naturally, after recording the video, I thought of a better way to manage my windows. I took advantage of the def-repeat-command that abo-abo posted on (or emacs so that I could repeat keybindings easily. I modified the function to accept nil as the first value if you don’t want the keymap to run a command by default, and to use kbd for the keybinding definitions.

  (defun sacha/def-rep-command (alist)
    "Return a lambda that calls the first function of ALIST.
It sets the transient map to all functions of ALIST,
allowing you to repeat those functions as needed."
    (lexical-let ((keymap (make-sparse-keymap))
                  (func (cdar alist)))
      (mapc (lambda (x)
              (when x
                (define-key keymap (kbd (car x)) (cdr x))))
            alist)
      (lambda (arg)
        (interactive "p")
        (when func
          (funcall func arg))
        (set-transient-map keymap t))))

Here’s my new binding for yy. It lets me bounce on y to use other-window as normal, use the arrow keys to move between windows thanks to windmove, and use ace-window as well: h is the regular ace-window, s swaps, and d deletes.

(key-chord-define-global "yy"   
      (sacha/def-rep-command
       '(nil
         ("<left>" . windmove-left)
         ("<right>" . windmove-right)
         ("<down>" . windmove-down)
         ("<up>" . windmove-up)
         ("y" . other-window)
         ("h" . ace-window)
         ("s" . (lambda () (interactive) (ace-window 4)))
         ("d" . (lambda () (interactive) (ace-window 16)))
         )))

Neat, eh?

Writing: Open loops, closed loops, and working with forgetfulness

I think I’ve written about something before, but I can’t find it. I have thirteen tabs open with Google search results from my blog. I’ve tried countless keywords and synonyms. I’ve skimmed through posts I only half-remember writing. (Was that blog post really that short? I thought I wrote more details.) I still haven’t found the post I want.

I wonder: Did I really publish it? Or did I just outline or sketch it? Am I confusing it with something similar that I wrote, or someone else’s post that I admired?

Ah, well, time to write it from scratch. It’s a little like writing code. Sometimes it would take so long to find an appropriate open source module that you’re better off just writing the code yourself. Sometimes it would take so long to find an existing post that it’s better to just write it from scratch.

I was looking for that particular post because of a conversation with Flavian de Lima where I mentioned the benefits of blogging while you’re learning something. He resonated with the idea of sharing your notes along the way so that other people can learn from them, even if you’ve moved on to different topics.

Despite having a clear memory of writing about this topic, when I went to the post that I thought was related to it (spiral learning), it didn’t mention blogging at all. “Share while you learn” didn’t quite address it, either. After trying lots of searches, I gave up and started writing a new post. After all, memories are fallible; you could have full confidence in an imagined event.

The reason this came up was because Flavian described how he often took advantage of open loops when working on writing. He would stop with an incomplete thought, put the draft away, and let his subconscious continue working on it. Sometimes it would be days or weeks before he got back to working on the article. He mentioned how other authors might take years to work on novels, dusting off their manuscripts and revising scenes here and there.

Keeping loops open by stopping mid-sentence or mid-task is a useful technique often recommended for writing or programming. Research describes this as the Zeigarnik effect: an interrupted task stays in your memory and motivates you to complete it.

But after reading David Allen’s Getting Things Done, I had become a convert of closed loops: getting tasks, ideas, notes out of your head and into a trusted system so that you don’t have to waste energy trying to remember them. I noticed that if I kept too many loops open, my mind felt buzzy and distracted. To work around this, I got very good at writing things down.

In fact, I took closing loops one step further. Publishing my notes on my blog helped me get rid of the guilt and frustration I used to feel whenever I found myself wanting to move on to a different project. Because my notes were freely available for anyone who was trying to figure out the same thing, I could go ahead and follow the butterflies of my interest to a different topic. My notes could also help me pick things up again if I wanted to.

I didn’t stop mid-sentence or mid-thought, but I published in the middle of learning instead of waiting until I finished. Even my review posts often included next steps and open questions. So I got a little satisfaction from posting each small chunk, but I still left dangling threads for me to follow up on. I closed the loops enough so that the topics didn’t demand my attention.

Writing helped me clear my mind of strong open loops–but it worked a little too well. I tried to close things off quickly, so that I could revisit them when I wanted to. The trick was remembering that they were there. Sometimes I forgot the dangling threads for a year or more. I never followed up on others. Even with my regular review processes, I often forgot what I had written, as in the search that prompted this post.

Writing and memory have an ancient trade-off. Even Socrates had something to say about it, quoting an ancient Egyptian king in Plato’s The Phaedrus:

“…for this discovery of yours will create forgetfulness in the learners’ souls, because they will not use their memories; they will trust to the external written characters and not remember of themselves.”

as quoted in On writing, memory, and forgetting: Socrates and Hemingway take on Zeigarnik

In 2011, Sparrow, Liu, and Wegner showed that people remember less if they think a computer will keep their notes for them, and they tend to remember how to get to the information rather than the information itself. Having written the words, published the posts, and indexed the titles, I’ve forgotten the words; and now I can’t find my way back.

Hence my immediate challenge: sometimes I forget how to get to the information I’ve stored, like a squirrel stashing nuts. (More research: tree squirrels can’t find 74% of the nuts they bury. So I’m doing slightly better than a squirrel, I think.)

Google helps if I can remember a few words from the post, but since it tends to search for exact words, I have to get those words right. Hah, maybe I need to use search engine optimization (SEO) techniques like writing with different keywords – not for marketing, but for my own memory. It reminds me of this SEO joke:

How many SEO copywriters does it take to change a lightbulb, light bulb, light, bulb, lamp, bulbs, flowers, flour…?

My blog index is helpful, but it isn’t enough. I need to write more descriptive titles. Perhaps I should summarize the key point as well. Maps can help, as can other deliberate ways of connecting ideas.

Let me take a step back and look at my goals here. Linking to posts helps me save time explaining ideas, build on previous understanding, and make it easy for people to dig into more detail if they want. But I can also accomplish these goals by linking to other people’s explanations. With so many people writing on the Web, chances are that I’ll find someone who has written about the topic using the words I’m looking for. I can also write a new post from scratch, which has the advantages of being tailored to a specific question and which possibly integrates the forgotten thoughts even without explicit links.

It’s an acceptable trade-off, I think. I’ll continue writing, even with the increased risk of forgetting. If I have to write from scratch even when I think I’ve probably written about the same topic before, I can accept that as practice in writing and thinking.

Other writers have better memories. Flavian told me how he can remember articles he wrote in the 1990s, and I’ve heard similar accounts from others. Me, I’ve been re-reading this year’s blog posts in preparation for my annual review, and I’ve come across ones that pleasantly surprised me. Posts two or three years back are even fuzzier in my memory. I can try to strengthen my memory through exercises and processes. The rest of the time, I can work with the brain that I have. In fact, I’m inclined to build more memory scaffolds around myself, moving more of my memory outside my mind.

[I do not] carry such information in my mind since it is readily available in books. …The value of a college education is not the learning of many facts but the training of the mind to think.

  • Albert Einstein, as Wikiquotes cites from Einstein: His Life and Universe (2007)

And really, how much difference would perfect memory make? I might add more links, include more citations, cover more new ground. I can still learn and share without it.

Forgetful squirrels have their uses. Forgotten acorns grow into oaks for others to enjoy. From time to time, I hear from people who’ve come across old posts through search engines, or I come across old posts in a review. Loops re-open, dangling threads are taken up again, and we continue.

Emacs kaizen: helm-swoop and editing

Continuing on this quest to focus on one tiny little workflow change at a time, so that I can get even better at using Emacs…

One of those packages I installed but never got around to trying out was all, which lets you interactively edit all lines matching a given regular expression. It’s like an editable occur, sorta.

It turns out that helm-swoop lets you use C-c C-e to edit matching lines interactively (so you can use keyboard macros or replace-regexp or whatever). You can type C-x C-s to save it back to the buffer.

On a related note, I’m still tickled pink every time I use dired-toggle-read-only (C-x C-q) to make a Dired buffer editable so that I can batch-rename filenames.

Sketchnote Hangout: Playing with colour

The recent Sketchnote Hangout organized by Makayla Lewis was a good kick in the colour palette.

2015-01-17 Thoughts from Sketchnote Hangout - colour -- index card #color #drawing

 

Before the hangout, I’d settled into a pattern of black-text-with-a-little-accent (although blue ink isn’t much of an accent colour). This, despite an almost embarrassing number of recent attempts to break out of the colouring rut:

Exploring sketchnote colour styles (December 2014)

2014-12-01 Colouring inspiration guide - drawing

2014-12-01 Colouring inspiration guide – drawing

 

Building a habit of drawing with colours (January 2014)

2014-01-02-What-would-it-take-to-make-colour-part-of-my-workflow.png

 

Sketchnote Lesson: Adding color (September 2013)

2014-01-03 Exploring colours

This time! Really! It helps that I’ve added a red pen and a green pen to the ones I carry around in my vest, and that I make myself use them when I use index cards. Digitally, I’m forcing myself to expand my colour vocabulary. Since Adobe Color CC (formerly Kuler) lets you pick a pleasing colour scheme (you can also trust in the gods of randomness or popularity), I’m less likely to have the angry-fruit-salad effect, and I can push myself by using arbitrary colours until I develop a sense of what feels better. Next time I sketch on my computer, if my colour scheme isn’t already set based on a book, I might grab a screenshot and use the eyedropper to pick out colours from that.

Someday I might get back to that sheer primary-colour exuberance of my Nintendo DS sketches. Someday.

In the meantime, you may want to check out other people’s colour experiments:

Filling in the occupational blanks

Following up on an interview, a journalist asked:

If I were to say that you freelance as [blank] consultant, what would be the word that fills that blank?

2015-01-14 Filling in the occupational blanks -- index card #experiment #occupation

2015-01-14 Filling in the occupational blanks – index card #experiment #occupation

Tricky question. “Freelance” is definitely the wrong word for it, since I doubt I’ll be taking on any more clients and the word obscures my current fascination with a self-directed life. It might make sense to use the word “independent” if we really need to contrast this with stable employment.

Technically, I spend a fraction of my time consulting, and I can define the kind of consulting that I do in a compact phrase. But based on my 2014 numbers, that’s only 12% of my time. This is much less than the 37% of the time I spend sleeping, or even the 18% of the time I spend on discretionary projects or the 15% of the time I spend taking care of myself (not including the 7% of the time I spend on chores, errands, and other things).

Since no one gets introduced as a sleeper even though that’s what we mostly do with our lives, maybe my discretionary projects will yield a neat occupational description for people who need to have that introductory phrase.

  • Am I a writer (3%)? (“Author” is a smidge more self-directed and respectable, maybe, but I still don’t feel like I’ve written Real Books since all my resources are compilations of blog posts). A blogger? This is a category so large, it could mean anything.
  • A sketchnoter (3%)? Alternatively: a sketchnote artist or a doodler, depending on whether I’m making it sound more respectable or more approachable. But the popular understanding of sketchnotes (if there is one) is that of recording other people’s thoughts, and I’m focusing on exploring my own questions.
  • An Emacs geek (2%)? Too obscure; it doesn’t provide useful information for most people. Maybe an open source developer, which also includes the 1% of the time I spend coding – but I do more writing about software than writing actual software or contributing to projects. An open source advocate? But I don’t push it on people or try to change people’s minds.

In the rare meetups I go to, I usually mention a bunch of my interests (drawing, writing, coding, experimenting), and people pick whatever they’re curious about. But most times, I try to preempt the “What do you do?” question with something more interesting for me, like what people are learning about or interested in. It’s so much easier when someone recognizes me from my blog, because then we can jump straight to the interests we have in common.

From time to time, I come across people who persistently ask, “But what do you do? What’s your day job?” I confess it’s a bit fun to tweak the box they want to put me in. One approach I’ve heard other people use is to playfully acknowledge the difficulty of categorization. “On Mondays, I _. On Tuesdays, I _. On Wednesdays, I___. …” Others gleefully embrace descriptions like “I’m unemployed.”

But I’m missing the purpose of that introductory phrase or that short bio here. It’s not about shaking up the other person’s worldview. At its best, that occupational association helps the listener or reader quickly grasp an idea of the other person’s life and where the other person is coming from. An accountant probably has a different way of looking at things than a primary school teacher does. One’s occupation provides the other person with the ability to contextualize what one says (“Oh, of course she thinks of things as systems and processes; she works with code all day.”). During small talk, it gives people easy things to talk about while they’re waiting for a more interesting topic of conversation to appear: “What kinds of things do you write?”

Let’s say, then, that my goals for this phrase would be:

  • to help people understand my context quickly, and how that might differ from their perspective
  • to make the other person more comfortable by:
    • being able to associate me with a stereotype that adds information, possibly fleshing out this mental profile with differences later on
    • in conversation, letting them easily think of questions to ask, addressing the phatic nature of small talk (we’re not actually talking, we’re making polite noises)
  • to branch off into more interesting conversations, avoiding the dead-end that often comes up after the ritualistic exchange of “What do you do?”

Of these goals, I like the third (interesting conversations) the most.

Here are a few of my options:

  • I can accept convention and pick one aspect of what I do, especially if I tailor it to their interests. For example, at a business event, I might introduce myself as a social business consultant who helps really large companies improve internal collaboration through analytics and custom development for enterprise social network platforms (well, isn’t that a mouthful). At visual thinking events, I might introduce myself as a sketchnoter focusing on exploring my own ideas.
  • I can waffle by introducing several aspects, still within the vocabulary of regular occupations: a consultant and a writer, for example.
  • I can say, “It’s complicated!” and explain my 5-year experiment, self-directed living, and learning/coding/writing/drawing/sharing.

Anyway, circling back to this writer and his likely use of some kind of occupation as a way to introduce and contextualize me:

  • It might be interesting to play with no occupational categorization. Some context may be provided by age (31) – it’s common enough in newspapers and books. The editor might send it back with a question, “Yes, but what does she do?”, but there it is.
  • It might also be interesting to play with my difficulty of categorization. “Sacha Chua, who couldn’t come up with a single phrase to describe her occupation, …”
  • Or, since it’s no skin off my back if this is not fully representative, I could just let him write whatever he wants to write. Freelance consultant. Blogger. Sketchnoter. Amateur experimenter. Independent developer. “Consultant” is a very small part of my identity, actually, so developer or blogger might be interesting. A possible missed opportunity here is that the wrong frame might result in people not being able to identify with and learn from stuff (“Of course she can deal with this, she’s a coder”; “Bah, another blogger, is that all she does?”; “Why should I listen to her? Freelance is just a fancy word for unemployed.”). But it’ll do under time pressure. =)

I’m writing this on January 14 and posting this in the future (because I limit posts to one a day), so the article will likely be out by now. If I remember, I’ll update this with what he actually used. =) But I needed to think about it out loud, and I’m sure the situation will come up again in the future. Perhaps by then I’ll have a more compact way to describe myself.

Since other people have figured this out before, I can learn from them. (And possibly from you!) After all, I’m nowhere near as interesting as Benjamin Franklin or Leonardo da Vinci, and somehow they managed to settle down into a sequence of nouns. Here’s the one from Wikipedia’s entry for Leonardo da Vinci:

Leonardo di ser Piero da Vinci (15 April 1452 – 2 May 1519) was an Italian painter, sculptor, architect, musician, mathematician, engineer, inventor, anatomist, geologist, cartographer, botanist, and writer.

Three or four nouns should be a good thing for me to strive for, eh? Even one or two nouns, if I can get to some level of distinction.

As for introductions – people can pick whatever aspect they want. I am multi-faceted and growing. =)

Weekly review: Week ending January 23, 2015

I posted nine blog posts this week, relaxing that once-a-day bottleneck that I’ve been using for the past few years. Mainly, it’s because I want to talk about Emacs more than once a week while still keeping lots of variety so that I can talk about non-tech topics too. Daily readers: Is the volume unmanageable? How can I make this better for you?

On my consulting gig, I leveled up in terms of using Tableau. I think I’ve gotten the hang of dashboard actions now, and I’m more comfortable using calculated fields for attributes and aggregates. Whee!

This has been a good week for planning ahead and learning from others. The Quantified Self Toronto meetup on Monday got me thinking about an Epic Quest of Awesome, and that spun off a long, thoughtful conversation about questions. I’m looking forward to fleshing that out a bit more over the next few weeks.

Oh, and I finally applied for my passport, picked up my Cultural Access Pass, and took care of a number of other errands. Have day pass, will Get Stuff Done.

The Emacs microhabit I’m going to focus on this week is selecting multiple things in Helm, since that’s one of its key features. =)

Blog posts

  1. Weekly review: Week ending January 16, 2015
  2. Minimizing upward or downward skew in your sketchnotes
  3. Improving my evil plans for Emacs
  4. Breaking down the skill of outlining
  5. Developing Emacs micro-habits: Abbreviations and templates
  6. Move your goalposts to get around an inability to finish projects How redefining your projects can help you satisfy a novelty-seeking brain, and how you can deal with interests or experiments that don’t have clear ends
  7. Emacs Chat with Steve Purcell
  8. Visualizing the internal citation network of my blog
  9. Filling in the occupational blanks

Sketches

  1. 2015.01.17 Evening tweaks – index card #routines
  2. 2015.01.17 My Evil Plans for Emacs are yielding results – index card #emacs #sharing
  3. 2015.01.17 Playing with the index card format – index card #drawing
  4. 2015.01.17 Thoughts from Sketchnote Hangout – colour – index card #color #drawing
  5. 2015.01.17 Weekend routines – index card #life #routines
  6. 2015.01.18 Digging into my thoughts about emptying one’s cup – #emacs #writing
  7. 2015.01.18 Emacs microhabit – Switching windows – index card #emacs #microhabit
  8. 2015.01.18 Journey to Emacs – Beginnings – index card #emacs #beginner
  9. 2015.01.18 Journey to Emacs – stages – index card #emacs
  10. 2015.01.18 Narratives – index card #storytelling #perspective
  11. 2015.01.18 The Sense of Style – index card #book #writing
  12. 2015.01.18 Thinking about evil-mode and Emacs – index card #emacs
  13. 2015.01.19 A good way to track writing revisions – index card #editing #tech
  14. 2015.01.19 Deeper outlines – index card #writing
  15. 2015.01.19 How can I get better at research – index card #learning
  16. 2015.01.19 Imagining an editing experiment – index card #delegation #writing #editing
  17. 2015.01.19 Improving my sharing – index card #writing #sharing
  18. 2015.01.19 Quantified Self Toronto – epic quests, kids, stopwatches, art projects
  19. 2015.01.20 Asking better questions – index card #asking
  20. 2015.01.20 Skill trees – asking questions – index card #skill
  21. 2015.01.20 Skill trees – web – index card #skill #coding
  22. 2015.01.20 Skill trees – writing – index card #skill
  23. 2015.01.20 What do I want from this quest list and skill tree visualization – index card
  24. 2015.01.21 Goal strategies – index card #popular-goals
  25. 2015.01.21 Playing with popular goals – Happiness – index card #popular-goals
  26. 2015.01.21 Popular goals – Fame – index card #popular-goals
  27. 2015.01.21 Popular goals – Health – index card #popular-goals
  28. 2015.01.21 Popular goals – Knowledge or experience – index card #popular-goals
  29. 2015.01.21 Popular goals – Meaning – index card #popular-goals
  30. 2015.01.21 Popular goals – Power – index card #popular-goals
  31. 2015.01.21 Popular goals – Wealth – index card #popular-goals
  32. 2015.01.21 Popular goals – tranquility, equanimity – index card #popular-goals
  33. 2015.01.21 What if I tried on common goals – index card #popular-goals
  34. 2015.01.22 Book – Leading the Life You Want – Friedman 2014 – index card #book
  35. 2015.01.22 Buffet of other goals – index card #goals
  36. 2015.01.22 Goals and skills – index card #goals
  37. 2015.01.22 Imagining a good quest or skill discussion – index card #goals #conversation
  38. 2015.01.22 Thesis projects for 2015 – ideas – index card #sharing #plans
  39. 2015.01.23 Book – Leaving a Trace – Alexandra Johnson – index card #writing #book
  40. 2015.01.23 Passport – mail or pickup – index card #decision
  41. 2015.01.23 Rough notes on goals and questions – for follow up – index card #rough #notes
  42. 2015.01.23 Tech upgrade triggers – index card #decision
  43. 2015.01.23 What would help me enjoy travel – index card

Link round-up

Focus areas and time review

  • Business (40.9h – 24%)
    • Earn (9.3h – 22% of Business)
      • Deposit cheque
      • Earn: E1: 1-2 days of consulting
    • Build (18.2h – 44% of Business)
      • Drawing (7.1h)
      • Delegation (0.0h)
      • Packaging (0.0h)
      • Paperwork (1.8h)
      • Fix cucumber for travis
      • Look into recently uploaded images
    • Connect (13.3h – 32% of Business)
      • Go to Quantified Self Toronto meetup
      • Post Quantified Self notes
      • Check out Sketchnote Hangout
      • Check out #lrnbook
  • Relationships (3.7h – 2%)
    • Call pharmacy
  • Discretionary – Productive (21.0h – 12%)
    • Emacs (5.9h – 3% of all)
      • Have Emacs Chat with Steve Purcell
      • Move my text-scale-increase binding
      • Check out speed-type
      • Figure out how to make pivot tables in Org
      • Figure out how to define abbreviations in Org Mode
      • Revise transcript for Steve Purcell
      • Look at Yasnippet doc TODOs
      • Try out Tern
    • Apply for passport – State “WAITING” from “STARTED” [2015-01-16 Fri 15:51]
    • Redeposit into TFSA
    • Invest in bonds in TFSA
    • Analyze index cards so far
    • Make Epic Quest of Awesome sheet
    • Pick up cultural access pass from Front and Parliament
    • Reflect on asking questions
    • Apply for passport
    • Type in goals
    • Brainstorm ideas for final project
    • Start git directory for drafts
    • Writing (8.1h)
  • Discretionary – Play (6.6h – 3%)
  • Personal routines (22.8h – 13%)
  • Unpaid work (14.7h – 8%)
  • Sleep (58.3h – 34% – average of 8.3 per day)