2 ms·
What does :v do?
by chris_wot 11y ago
What does :v do?
- richy_rich 11y agoIt's the same as :g!/error/d I believe
- efaref 11y ago:help :v will tell you: :[range]v[global]/{pattern}/[cmd] Same as :g!. Where: :[range]g[lobal]!/{pattern}/[cmd] Execute the Ex command [cmd] (default ":p") on the lines within [range] where {pattern} does NOT match. So :v/error/d will delete all lines that don't contain the string "error".
- creshal 11y agoWhich neatly maps to grep's -v option that does the same.
- chris_wot 11y agoOh! I've been messing about with a bit of splitting up of C++ classes into seperate headers as a bit of a test and I recently did a: sed -i "/#include <vcl\/button\.hxx>/d" $(git grep -l "vcl\/button\.hxx" *.hxx | grep -v precompiled) Knowing about a :v might have been helpful...