:keep sometext
(Custom VIM command) -> :%g!/sometext/d
(existing syntax)
How can the above transformation be achieved in VIM?
:keep hello
-> %g!/hello/d
(as an example)
njachowski
1,1776 silver badges15 bronze badges
asked Jan 12, 2016 at 14:03
1 Answer 1
Give this cmd a try:
command! -buffer -nargs=1 Keep v/<args>/d
then you can :Keep pattern
:h command
for details.
answered Jan 12, 2016 at 14:14