←back to thread

539 points todsacerdoti | 1 comments | | HN request time: 0.001s | 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 #
kannanvijayan ◴[] No.44360624[source]
I haven't had to in a while as I've lapsed into IDE usage as of late, but my vimrc is something I committed to memory a long time ago.

  set tabstop=4
  set shiftwidth=4
  set expandtab
  set showmatch
  set nohlsearch

  set background=dark
  syntax on
Typing that config into a file is emotionally associated with a system feeling "ready" for me. "ah, now I can _do_ things".
replies(2): >>44361343 #>>44361559 #
1. mtlmtlmtlmtl ◴[] No.44361559{3}[source]
No accounting for taste, but my similarly terse vim config includes relativenumber and number. Relativenumber is just so damn useful for doing things to larger chunks of code without having to count lines or anything.

I'm also an IDE user though. I tend to maintain a dichotomy between emacs(with evil-mode, of course) as the "kitchen sink" set up, with all the fixings, and vim with a config so short I can type it in as commands if I need to.

Vanilla vim is really perfect for quick edits to config files, scripts on random servers/VMs etc.

Bigger projects, at least for my usage, all happen on the same system , and having a bit more involved of an emacs set up makes sense there.

I suppose one could do a similar dichotomy with vim/neovim, if one had a distaste for emacs.