Sven [email protected] ©1995-2001 | Last update: Sun Oct 08 20:39:33 MET DST 2000 |
Every now and then I think about some problem and I think it can be done with a simple mapping. But I am not always pleased with my solution. Maybe you can think of a better solution? Let me know!
Analysis: This is a job for the "global" command. Now, we could easily copy all matching lines after the end of the current buffer with g:#foo#co $, but creating a new buffer to display the result is nice - and also easy done with :new. A mark to remember the former end-of-buffer is necessary for deleting the resulting lines, of course. The last two commands simply delete the resulting empty line.
Solution:
000505: Yes - it certainly is possible with an ex command:
Now all that is missing is a simple emthod to make sure that the register A is cleared before using the mapped commands. Anyone?
000515: Frank Baruch [email protected] pointed me at the Vim's "let" command which allows to fill the contents of a register:
Comments? Improvements? Send them to me!
URL: http://www.math.fu-berlin.de/~guckes/vim/chall.html URL: https://www.vim8.org/chall.html (mirror) Created: Sun Oct 08 12:00:00 MET DST 2000Send feedback on this page to