2 ms·
I really like using NeoVim for programmatic text manipulation.[1] I use Spacemacs as my main non-IDE editor and I want to reuse that basic Vim knowledge instead
by avgcorrection 4y ago
I really like using NeoVim for programmatic text manipulation.[1] I use Spacemacs as my main non-IDE editor and I want to reuse that basic Vim knowledge instead of having to worry about the differences between sed et al.
Typically I will insert a step in the pipeline like for example `nvim -Es +':%s/^/go home/' +'%p'`.
NeoVim rather than Vim since Vim is painful for pipeline text manipulation.
[1] https://vimways.org/2018/vims-social-life/ https://vimways.org/2018/vims-social-life/
- JNRowe 4y agoJoey Hess' excellent moreutils¹ comes with vipe which is a generalised solution for these types of tasks. It allows you to run whatever $EDITOR you've configured mid-pipe, making it possible to work your changes up in an interactive editor session. Useful for those of us not smart enough to write up our changes as a series of -c arguments ;) (It fixes the vim issue by virtue of using a temporary file to do the magic) ¹ https://joeyh.name/code/moreutils/ https://joeyh.name/code/moreutils/