←back to thread

538 points todsacerdoti | 3 comments | | HN request time: 0.503s | source
Show context
robenkleene ◴[] No.44358285[source]
I love this, I've been iterating on workflows like this for something like a decade now. Over time I've tried to peel back as many of my custom layers as possible, because all of those layers have a maintenance cost.

Stock Vim (without `tmux`) can actually do most of what's shared in this post with `rg --vimgrep restore_tool | vim -c cb -` (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about).

(Since re-running the `rg` search can be undesirable, and I often like to analyze results in a terminal before opening them in Vim. I use a custom `tmux` command to copy the output of the last command [using this trick that involves adding a Unicode character to your prompt https://ianthehenry.com/posts/tmux-copy-last-command/], then I send that into Vim with e.g., `tmux saveb - | vim -c cb -`.)

replies(7): >>44358653 #>>44358736 #>>44360925 #>>44362611 #>>44363893 #>>44364510 #>>44403351 #
msgodel ◴[] No.44358736[source]
Ten years ago I threw out my massive multi-file, multi-package vim config and have been slowly building up a much simpler vimrc about 1-2 lines a year. I completely agree, defaults in old software are almost always there for a reason and you should try to understand that before changing them.
replies(6): >>44359927 #>>44360624 #>>44361137 #>>44362231 #>>44363110 #>>44363602 #
jmbwell ◴[] No.44361137[source]
A wise elder once advised me that if I learned to work quickly and comfortably with an application’s defaults, I would be just as quick and comfortable on any system I would likely encounter. Very zen. Great advice.
replies(1): >>44362214 #
1. deathanatos ◴[] No.44362214[source]
Is it? I should just purposefully bind myself?

Seems like using a tool to its fullest potential to get more work done is better advice.

> I would be just as quick and comfortable on any system I would likely encounter.

How often are we encountering other systems…? And even where I am rarely ssh'd into something else … are we doing so much editing of code (live in production…?) that it matters? (I heavily customize my vim, but it isn't like I'm lost on a remote system with stock vim, or nano. ed is another matter.)

But if I need tons and tons of editing, … sshfs+local vim/terminal? But this just such a rare case, it seems like one of those "we should optimize for the common case" — which this is not.

replies(2): >>44362297 #>>44362302 #
2. kjellsbells ◴[] No.44362297[source]
I see it more as like understanding how to use a hammer even if most of the time in your job you use a nailgun.

For me personally it's a classic old timer habit from the days when you had to be prepared to fix a system using only the tools in /sbin. That doesn't mean you should operate like that all the time, but you should certainly know how to do so and be comfortable doing it.

3. msgodel ◴[] No.44362302[source]
Isn't the author likely to know the tool's potential best? I get that there are special cases but those should be few and ones you know well enough to memorize the exceptions for.