A tiny bit of Vim

by gabebw

I’m trying to reorganize my monolithic zshrc into discrete files, so I was putting e.g. all the setopt commands in ~/.zsh/opts, and I discovered a neat thing.
You can visually select a chunk of text, do :w file_name, and Vim will create a new file named file_name, with just the selected text in it, while leaving you in your original file.
I just discovered this. My thought process: “I only want to write out part of this file…I’ve heard Vim is kind of like a language for text editing, so let’s see if this works…YES! IT WORKS!” And then I stared at the screen in wonder. No, really. For like 10 seconds, just staring.

Vim is pretty awesome.