3 ms·
put a marker at the begining of what you want to cut (mb) b is an arbitrary character but I use b becaues b = begin. find the end of the block with search, or j
by matthewaveryusa 9y ago
put a marker at the begining of what you want to cut (mb) b is an arbitrary character but I use b becaues b = begin.
find the end of the block with search, or jkl; or whatever. mark the end of the block (me) e is for end. now type `b, that will bring you back to the start. type v, that puts you in visual mode. type `e, that selects your text from begin to end. x to cut it.
so all in all it's mb<search>me`bv`ex
now if your say you can search your text faster with your mouse than with keystrokes you have a different problem: you don't know how to use the search features in vim efficiently.*
I think it's nearly impossible to be faster with a mouse than a keyboard when it comes to search.
*and yes, to be efficient at it there's a 2 month learning curve that pays dividends over the next 30 years of your programming career -- it's up to you if you think it's worth the investment or not. Use it or lose it, if you don't make an effort you'll stay at your local maximum.
- jonahx 9y ago> so all in all it's mb<search>me`bv`ex why not just? v<search>x
- matthewaveryusa 9y agoJust another suggestion. sometimes visual mode is overwhelming, or you don't want to be in it while your search for the end of the selection without being sure where it is. Another thing is if you start with line visual mode (V), and then you end up not wanting line selection the markers help you out -- it's a finer-grained set of commands that's a bit more flexible and a bit less efficient.