39 min read / 4 for this part
VIM diary
Part: 1 | 2 | 3 | 4 | 5 | 6 | 7
While learning the basics of Vim over the course of a few months I kept a simple diary. I recorded what I had been Googling for and what I'd learned during my struggles.
# March 2024
So that's it, 6 months of Vim.
Let's round it out:
- What would I tell myself 6 months ago?
- What does my
.vimrclook like now? - What are the continuing annoyances?
# What would I tell myself 6 months ago?
Exercises like this are always fraught with hindsight bias. I don't want to criticise how I went about my learning, because I'm happy with where I am now.
Still, there were a few surprises that would have been nice to know from the start that I hadn't fully appreciated:
Practice your touch-typing.Get rid of your bad habits. Spend the time to learn the right way around the keyboard. Practice every week.There are "tiers" of frustrationand they get increasingly taller before they ease up again. It's worth it, but it sure doesn't feel like it during the slog.- Vim is
not just a customisable editor. It's also a gateway to learning more about the CLI and the Unix Philosophy in general. Get to that part as soon as you can.
The last point is particularly worth driving home. The more you hold-off rolling your own config and depend on a bunch of plugins, the longer this "world of integration" will be just out of reach without you really realising it.
It would be remiss of me not to state that, for me at least, I really needed little projects to spur myself along with all this. I was lucky enough to stumble upon Denote and Solv which gave me a way of learning Vim outside of my day-to-day work. I really could not afford to run the experiment of learning Vim on the job.
# What does my .vimrc look like now?
Since February I refactored my whole config with a "progressive enhancement" strategy:
- Common settings + keybindings are configured first.
- Environment detection, helpers for Vim/NeoVim/OSes etc.
- Conditionally load plugins based on the above.
After plugins load (or not!) the following are configured:
- QuickFix / Arglist
- Buffers / Splits / Tabs
- Diff / Undo
- Filetree / FuzzyFind / Search + Replace
- ALE / CoC
- Colours
- Terminal / Tmux integration
If I forget to install vim-plug, it will work. If I forget to run
:PlugInstall it will work. If a certain plugin is available over another, the
same remaps will be used. If a plugin is not available, a fallback is
configured.
# What are the continuing annoyances?
My ALE + Prettier combo are so slow at formatting I've disabled the "on save"
feature completely. Yes, this is mostly down to Node itself taking up to 5
seconds to start on my work commissioned Surface, but I'm not going to give the
hardware all the blame when the following runs in a snap:
git diff --name-only --staged | xargs dprint fmt --
Merge Conflicts. The VSCode interface for this is so much more intelligent
than any CLI tool I've yet found. I'm doing a little more with vim-fugitive
when I can (since it is now more of a part of my day-to-day workflow) but the
process is undoubtably slower.
Corporate Extensions like SonarQube. Although the VSCode extensions for
things like this are temperamental at best, as an integrated solution they work
reasonably well. I have yet to try SonarQube CLI, so perhaps this is only a
temporary annoyance.
# My Heart Desires More Waffles
That's my closer for this Diary: A ChatGPT-suggested mnemonic for the ordering of a crontab command:
.----------------------- Minute
| .--------------------- Hour
| | .------------------- Day
| | | .----------------- Month
| | | | .--------------- Weekday
M H D M W
* * * * * command
I didn't think that would be one of my side-quests while learning Vim.
# Commands Learned
Copy-pasting one visual block over another:
- Ctrl-v select, then
yank jj(move to start of next block)1v(select a block the same size as our last visual selection)p(paste)
25 Mar, 2024