I have a file that is made up of two vertical parts. On the left side, the data is already formatted and I don't want to change it. I only want to format the data on the right side. Say I have a file with lines like

foo=bar baz     # Neato       Junk
quux=xyzzy      # Bilbo Baggins Ring

with many more lines like that. I only want to modify the text to the right of the '#' character. I selected the text I want with the following expressions:


but if I then try to modify it (say, with :'<,'>!column -t), it actually modifies the entirety of every line. What is the correct expression to use to only modify the visually selected parts?

  • 2
    You could try the vis plugin from Dr. Chip or my NrrwRgn plugin. Both should handle it just fine. Mar 16, 2016 at 18:45

1 Answer 1


You can also try:

:%!column -t

From :h :visual_example:

Currently the ":" command works on whole lines only. When you select part of a line, doing something like ":!date" will replace the whole line. If you want only part of the line to be replaced you will have to make a mapping for it. In a future release ":" may work on partial lines.

See also :h visual-operators for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.