← Back to context

Comment by sojournerc

6 years ago

what got me to switch was being able to run terminal commands in a buffer...

https://neovim.io/doc/user/nvim_terminal_emulator.html

I don't use it that often (I just open up another terminal), but you can also use ^Z to put vi in the background. It would be more useful if I didn't always forget and open up a new vi which would refuse to write to the file :)

  • I honestly do both. When I'm running something I want the output from (some to yank), I'll run in a buffer.

    If doing file manipulation, CLI, etc. etc. I'll ctrl-z out.

    I do the opposite of you pretty often too, always trying to `fg` a non-existent vim

    • Hmmm. I hadn't thought about being able to yank output from a command... That's a really good point. (Honestly I would probably use 'xsel -bi' and ':r !xsel -bo', but that's pretty ugly.)

Serious question: why not just open another terminal?

  • The integration is nice, it behaves as a normal buffer. So you can use all the standard modes and motions, splits, copy output to another buffer easier etc.

    • But modern terminals can do all that, with an editing mode that is tailored to terminal use rather than editing text.

      Sorry I just don't understand why I'd want to use a text editor as my command line.

      1 reply →

  • You can use it as a normal buffer. Run command, switch to visual, go copy and paste. Way nicer than `:r !command`.