RE: delete buffer questions
-Original Message- From: alebo [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 2:51 PM To: [EMAIL PROTECTED] Subject: delete buffer questions I need som things explained about the automatic delete buffers 1-9. When I delete rows using dd the deleted text is put in the default buffer, using dd again will put it in 1 and so on. But if I use another kind of deletion like dw, I couldnt fetch it from the buffers 1-9, only from the first unnamed buffer. Why is this so and which kind of delete operations are supported in the delete buffers? You might want to try my plugin: YankRing.vim : Maintains a history of previous yanks and deletes http://www.vim.org/scripts/script.php?script_id=1234 Vim already maintains a list of numbered registers containing the last 9 deletes. These previous deletes can be referenced using [register]p, so 1p will paste the last delete, 2p the 2nd last delete. For more information see |quote_number|. Vim does not provide any mechanism to reference previous yanked text. In Emacs this feature is called the kill ring. The yankring plugin allows the user to configure the number of yanked and deleted text. A split window can be used to choose which element(s) from the yankring you wish to paste. Alternately after text has been pasted (using p), it can be replaced with a previous value from the yankring with a single key stroke. A tutorial is included to take you through the various features of the plugin. After you have installed the plugin just run: :h yankring.txt :h yankring-tutorial ... Pressing F11 (default key) will bring up the list of all recent yanks and deletes. From there you can choose which one you need to paste. HTH, Dave
Re: delete buffer questions
When I delete rows using dd the deleted text is put in the default buffer, using dd again will put it in 1 and so on. But if I use another kind of deletion like dw, I couldnt fetch it from the buffers 1-9, only from the first unnamed buffer. For future reference, these are registers rather than buffers (a different concept, and using precise terminology can help folks on the list in their replies) From :help quote_number Numbered register 1 contains the text deleted by the most recent delete or change command, unless the command specified another register or the text is less than one line (the small delete register is used then). The small-delete register is - holds deletions when they're smaller than a line (unless it was covered by the fairly lengthy list of exceptions covered in the quote_number help) Why is this so and which kind of delete operations are supported in the delete buffers? I'm not sure why some things are arbitrarily chosen as small deletes, but any motion can be used with a delete. If you want to ensure that the deleted contents go into the trickle-down list of registers, you can prefix your deletion with an explicit register: 1dw This will force a trickle-down of the current history of deletions for any such deletion. Odd things happen if you specify the middle of your history, such as 4dw as it ends up in register #5 instead of #4 because of the nature of the trickle-down (or rather it gets put in #4, the trickle-down occurs and it also gets put in #1 so the formerly#4 is now in #5). Just a few musings on the peculiarties of them. I don't usually use them unless I have previously used :reg to figure out which one I want...my memory isn't quite that good :) HTH, -tim
Re: delete buffer questions
* alebo [2007.04.09 15:00]: But if I use another kind of deletion like dw, I couldnt fetch it from the buffers 1-9, only from the first unnamed buffer. Why is this so and which kind of delete operations are supported in the delete buffers? If you delete less than one line, the data is put in the small-delete register: - :h quote- It is number 3 in the list of register types found at: :h registers You can see its current content by doing: :di - -- JR