by blockloop · 9y ago · 0 comments
I don't find myself using ! commands when I know there are multiple commands that I need to run (like your last example). That's usually when I'll suspend and then use the command line.
Could you elaborate on "wreak havoc on your vim session?" I wasn't aware that suspending the process and bringing it back into the fg would harm anything.
You can even use :w in combination with !. For example
:w !xclip
to write the vim buffer contents to the clipboard. You could visually highlight part of the buffer and do the same thing for just the text you want. "*y
"+yOne advantage of the method you describe is that it can be limited to just part of a line. Piping output to xclip is limited to complete lines of text due to the nature of :w !.