5/20 VI question that isn't answered in TFM: I have a line that looks
like: a b c d e f g h i j k l m n o
and I want to cut/yank d through j then paste onto a diff line.
how do I only cut d through j and put in a memory buffer?
\_ Place cursor on 'd'. Then type 7dw. There, it's cut into a
buffer. You can paste using p/P. With VIM, you can hit 'v'
and go int visual mode, hilight the text you want, hit d, and
there ya go.
\_ the 7dw is far too tedious when d-f is really many paragraphs
but the vim solution is perfect! This is perhaps the 3rd thing
I've seen about vim that's better than vi. Thanks MOTD answerer!
\_ if you wanted to do it the vim way, you should just be using
Emacs.. the vi way to do that is either dtj then p or if
it's across multiple lines, d/j^M p (where j is something
decently specific to search for) --dbushong
\_ If you're trying to cut multiple LINES, as opposed
to characters on a single line, then go to the first line
and type "ma". Go to the last line, and do a "d'a",
which will delete from the cursor to the line that
you marked with 'a'. Then you can paste with P/p,
or reference the buffer.
\-if the cursor is on d, then M-z j. if the cursor is
on j, then C-u - M-z f. --psb
\_ they didn't ask for emacs help dork
\_ Beware the wrath of the psb, infidel! --psb #1 Fan
\_ If you don't like to count words, you can also dtj if j is
really a letter, or d/j if j is some longer word. |