vim-registers

remove newlines from a register in vim?

a 夏天 提交于 2019-12-22 09:05:41
问题 I have a long list of different names of universities. I'm trying to build a synonym table by collating lines with certain unique keywords; that is, in the file, I'll identify that Harvard is the keyword here: Harvard Business School| Harvard College| Harvard School of Divinity| and paste them into another file as Harvard Business School|Harvard College|Harvard School of Divinity| I have been doing this by searching for the word under the cursor, yanking lines with that word into register,

How to clear vim registers effectively?

扶醉桌前 提交于 2019-12-03 04:04:22
问题 Registers in vim are a great feature to store text snippets and even to run commands on the text stored within them. However, I'm a tidy person and tend to clean things up when I'm done. I know that if I wanted to clear register a , I can use q a q . I can also execute the following command: :let @a = '' However, these solutions seem like a mere workaround to the problem. When I execute :registers , the list still displays register a (with an empty value), while registers that have otherwise

How to clear vim registers effectively?

冷暖自知 提交于 2019-12-02 17:23:36
Registers in vim are a great feature to store text snippets and even to run commands on the text stored within them. However, I'm a tidy person and tend to clean things up when I'm done. I know that if I wanted to clear register a , I can use q a q . I can also execute the following command: :let @a = '' However, these solutions seem like a mere workaround to the problem. When I execute :registers , the list still displays register a (with an empty value), while registers that have otherwise never been used are not displayed. Is there a way to clear a register with the side-effect of removing

VIM to delete a range of lines into a register

橙三吉。 提交于 2019-11-29 13:06:10
I am trying to delete a range of lines into a register a . Is this the easiest way to achieve this? :5,10d a The definition of "easiest" depends on what do you have, and what do you want to do if you have a start line number and end number, e.g. :2349,5344d a is the easiest way. You don't have to consider the questions like "where is my cursor?" "how many lines would be removed?" ... If you are about to remove a small amount of lines, particularly they are on same screen. (You could use relative-linenumber.) for example: "a5dd but you have to move your cursor to the first line you want to

VIM to delete a range of lines into a register

六月ゝ 毕业季﹏ 提交于 2019-11-28 06:55:15
问题 I am trying to delete a range of lines into a register a . Is this the easiest way to achieve this? :5,10d a 回答1: The definition of "easiest" depends on what do you have, and what do you want to do if you have a start line number and end number, e.g. :2349,5344d a is the easiest way. You don't have to consider the questions like "where is my cursor?" "how many lines would be removed?" ... If you are about to remove a small amount of lines, particularly they are on same screen. (You could use

In Vim is there a way to delete without putting text in the register?

谁都会走 提交于 2019-11-26 05:59:36
问题 Using Vim I often want to replace a block of code with a block that I just yanked. But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I\'ve got in the habit of yanking, then inserting, then deleting what I didn\'t want, but with large blocks of code this gets messy trying to keep the inserted block and the block to delete separate. So what is the slickest and quickest way to replace text in Vim? is