Joshua Davis writes about programming tools, Vim workflows, Dijkstra's handwriting, and the culture of Hacker News and tech.
HN mostly links his post on how he learned to write like Dijkstra, which commenters summarize as practice with a goal or example.
These are all good tips but most of the anti-patterns seem to skew towards beginners (e.g. don't use the arrow keys, don't navigate in insert mode). One that I think is more common among intermediate, and even advanced, users is the misuse of tabs, windows, and buffers.
A lot of people have a tendency to think of each tab as corresponding to a single open file. This is very understandable because it closely matches the paradigm of most IDEs but it's actually an anti-pattern in VIM. Tabs are really meant to be more like workspaces where you arrange multiple windows into a desired layouts. You then have one buffer for each file that you're dealing with and view them in your windows. It's perfectly fine for multiple windows to share a single buffer or to switch out the buffer that is being viewed in any given window. This StackOverflow answer [1] and this blogpost [2] both go into a fair bit more detail.
If you're trying out this approach for the first time then you probably want to add `set hidden` to your configuration in order to avoid automatically closing buffers that aren't currently being viewed in a window. Coupling this approach with fzf.vim [3] makes managing very large numbers of files a breeze compared to using one tab per file.
[1] - http://stackoverflow.com/a/26710166
[2] - http://joshldavis.com/2014/04/05/vim-tab-madness-buffers-vs-tabs/
[3] - https://github.com/junegunn/fzf.vim
In the US we have a society where people walk around wearing suffering like a badge of honor. We worship work. I was brought up in a Midwest culture where "work ethic" was everything - if you worked hard enough, you would be successful. In contrast, if you were not successful it was because you didn't work hard enough.
Then, I got into tech. I hear "war stories" from people about sleeping under their desk at their cubicles. I hear people tell jokes about how their career strains their marriage. I hear about people wasting their 20's working every hour they can for a FAANG to get ahead... It was like that whole "work ethic gets you ahead" culture from my childhood got turned up to 11.
I'm meandering here but overall that poem reminded me of a blog post from long ago stating "Never Save Anything for the Swim Back. Ever." [1] which was introduced to me by a manager using it as justification to work a 60+ hour crunch week. I guess where I'm going here is these sort of idealizations of fiction where "work ethic trumps all" really clash with this poem. I feel like idealizations like this serve the interests of those who are capitalizing off of labor more than they do the general worker/person.
[1] https://joshldavis.com/2013/08/31/never-save-anything-for-the-swim-back/
I know you said that you like maintaining a super minimal .vimrc, but fwiw there's a couple of plugins that really helped me with the workflow issues you mentioned struggling with:
> Jumping around in longer texts: I know the basics, like searching (/), jumping to a matching bracket (%) or jumping to specific lines (for line 10, type 10G), but I still could use symbols more often for navigation.
vim-sneak is real nice for this, and has turned into one of my most-used movement commands https://github.com/justinmk/vim-sneak
> Using visual mode for moving text around: Sometimes it can be quite complicated to type the right combination of letters to cut (delete) the text I want to move around. That's where visual mode (v) shines. It highlights the selected text. I should use it more often.
vim-move was a game changer for me https://github.com/matze/vim-move
> Tabs: I know how tabs work, but all the typing feels clunky. That's why I never extensively used them. Instead, I mostly use multiple terminal tabs or an IDE with Vim bindings for bigger projects.
This is worth a read: https://joshldavis.com/2014/04/05/vim-tab-madness-buffers-vs-tabs/. Buffers + vim fzf is a really nice workflow https://github.com/junegunn/fzf.vim
Oh jesus buddy, there's always one of you. If you care that much go find a mod to ban me (or are you a mod? I don't care), and I'll go find some other corner of the internet.
You're welcome to slowly turn this place into a dustbowl by bitching at people for having conversations if that's what you enjoy doing in a community, don't let me stop you, but let me remind you of this:
You weren't involved in the conversation, and your comment history is nothing but wandering around sticking your nose in robust discussion and whining that people aren't talking to each other via the predefined rules that you like, as if human conversation is based on your two favorite links. You're not contributing here, and there's not a single post in the last several pages of your comments that implies you care about, understand or have an opinion on anything posted here, so please shush and let the rest of us get on with our sharing.
edit: http://joshldavis.com/2014/10/03/heavy-handed-hackernews/
Looks like you've been doing this for at least 16 months, congrats or something?
Firstly, this isn't about me. I'm not the one who started this project, I don't have any stake in maintaining it, and I'm definitely not the only one to notice that the tickets are piling up. Frankly I thought it was widely known.[0][1]
As it happens, I am probably in the running for worst/poorest developer on HN, and that's using the term "developer" broadly. To the degree that I have any resources that aren't being put towards subsistence, I'm not sure I could help anyone with anything. It doesn't feel particularly good to have to explain that, especially since everyone on here seems to be in a vastly different social situation, but either way, I'd appreciate fewer personal reflections.
[0]http://joshldavis.com/2014/07/26/oh-my-zsh-is-a-disease-antigen-is-the-vaccine/
[1]https://www.bountysource.com/issues/102375-move-plugins-to-separate-repositories-and-use-antigen-package-manager
"they argued about whether it’s a big enough site to include"
Wow. That sounds ridiculous. But if you try and track that site ...
From https://twofactorauth.org/
"Made with tea by Josh Davis..."
Then you follow this "Josh Davis" link to https://joshldavis.com/
... and you find this:
"
Splootysplotty: Open Source Alternative to Lewis Carroll’s Jabberwocky"
"
'Twas haplex and kuffle problem.
Projects Dalo and Jotts voluck.
It's not folazy as Lablem,
But merely fosts toontruck.
"
...interesting.