👨💻 A Lazy Developer
I am one of those “lazy developers” who is “always looking for ways to do something faster, more efficiently.”
Most of you are familiar with the virtues of a programmer. There are three, of course: « Laziness, Impatience and Hubris » — Larry Wall
My first job interview was introduced by a friend of a friend. After the interview, my new friend showed me what he was working on. I was blown away by how efficient he was on his IDE, compared to what I could do with the IDE I was using.
I realized that the key of programming efficiently is not to type faster, but to type less.
I started investing in tooling, with time and money. I looked for the most powerful IDEs, spent hours learning the features and shortcuts. I bought my first Mac to give those tools more memory, as Windows was still 32-Bit, which can only have 4GB of memory.
JetBrains IDEs
I first knew about JetBrains IntelliJ IDEA from
John Lindquist ’s videos on Flash ActionScript,
but I didn’t switch yet as I was still very happy with FDT .
Then I needed to write some Objective-C
and AppCode
was an easy pick over Xcode. I have since then used:
- AppCode for
Objective-C
andSwift
. - IntelliJ IDEA for
ActionScript
andJava
. - CLion for
C++
. - Rider for
C#
. - WebStorm for
JavaScript
andTypeScript
.
I have been mostly using WebStorm in recent years, and there are more than 100 keyboard shortcuts that I more or less used. I created a table on Notion , trying to re-organise those shortcuts. I thought I could only memorise more of them to be more efficient.
Until…
Vim
I heard about Vim for a few times in the past, but I thought I didn’t need it. I believed that I could be just as efficient at editing texts with the IDE features and shortcuts. Then one of my colleagues switched from WebStorm to NeoVim and was very passionate about it. I asked him to show me how to do a few things in Vim, which I felt inefficient to do in IDE.
It was A LOT MORE efficient in those cases.
So I decided to learn Vim and give it a proper try with the IdeaVim plugin . Not only did it make me more efficient with text editing; once I learnt about leader key mapping, it totally changed the way I use IDE.
Instead of squeezing over 200 shortcuts into combinations of ⌘⌥⌃⇧
modifiers,
any key on the keyboard (following the leader key
, which is ␣ spacebar
for me)
can switch the keyboard to a different layer,
on which each key can do a different thing.
e.g. leader s
for “Source Control”,
␣ s n
to create a New branch␣ s N
to create a New pull request
There are still places modifiers work better than leader keys:
- Repeating actions, e.g., move lines/statements up/down.
- Same mapping for the same/similar actions in different IDE contexts. e.g., move to previous/next change in the file, and previous/next diff in the diff view.
I am now settling with:
-
HJKL
with⌘⌥⌃⇧
modifiers for jumping/moving up/down and back/forward. - Leader Key Mappings for one-off actions.
Zed
While learning Vim, I started using NeoVim for text file editing like configs and notes. I liked the speed, but the cost for setting everything up (config, plugins, etc.), was too high for me.
With Zed , I get the speed, Vim mode, and the (not yet) same mappings I have with IDEs.
I do not think I will switch to Zed for big projects. But I use it for all the text editing and small projects (config, note, scripts, etc.).
Karabiner-Elements
Text/Code editing is not all I do on computer though.
I would like to use H J K L
for ← ↓ ↑ →
outside of the code editors,
and use the same shortcuts for common actions in other apps, like browsers, too:
⌃
+H
/L
for going back/forward history⌥
+H
/L
for going to previous/next tab
Karabiner-Elements to the rescue. It can do all of that and a lot more .
Together with some other tools ,
I continue the journey to be a more lazy productive Mac user.