VIM Plugins to Know About Part 2: repeat.vim
I continue to translate articles by Peteris Krumins. Original article.
Here is the first part and its original .
Repeat.vim fixes a significant drawback of the surround.vim plugin that I wrote about last week (I am lazy, ashamed - approx. Per.). The problem of surround.vim lies in the "." (point). If you used the environment and would like to repeat it with the "." Command, you would not succeed. This plugin fixes the problem.
Essentially, wherever you install surround.vim, you will need repeat.vim as well.
But there is a nuance. The plugin does not allow repeating the "ys" command. Fortunately, the ys commands can be replaced with the cs commands. For example, if you wanted to execute ysw several times (enclose the word in quotation marks), type csw and use. to repeat. The only way to repeat commands using visual mode is to record a macro.
Here is an example using repeat.vim. Imagine that you typed a sentence and want to quote all the words:
type csw " :
Now press W.
W moved the cursor to the next word and the dot repeated the environment command.
Repeat this 4 times and you will have the whole line in quotes:
1. Download repeat.vim to the directory ~ / .vim / plugin (Unix / Linux), or ~ \ vimfiles \ plugin (Windows).
2. Restart Vim or connect repeat.vim with the command ": so ~ / .vim / plugin / repeat.vim" on Unix or ": so ~ / vimfiles / plugin / repeat.vim" on Windows.
Inherit surround.vim and repeat.vim. Next time I will write about a much more significant plugin. :)
Here is the first part and its original .
Repeat.vim fixes a significant drawback of the surround.vim plugin that I wrote about last week (I am lazy, ashamed - approx. Per.). The problem of surround.vim lies in the "." (point). If you used the environment and would like to repeat it with the "." Command, you would not succeed. This plugin fixes the problem.
Essentially, wherever you install surround.vim, you will need repeat.vim as well.
But there is a nuance. The plugin does not allow repeating the "ys" command. Fortunately, the ys commands can be replaced with the cs commands. For example, if you wanted to execute ysw several times (enclose the word in quotation marks), type csw and use. to repeat. The only way to repeat commands using visual mode is to record a macro.
Here is an example using repeat.vim. Imagine that you typed a sentence and want to quote all the words:
|foo bar baz quux muux woox
(| указывает позицию курсора)
type csw " :
|"foo" bar baz quux muux woox
Now press W.
"foo" |"bar" baz quux muux woox
W moved the cursor to the next word and the dot repeated the environment command.
Repeat this 4 times and you will have the whole line in quotes:
"foo" "bar" "baz" "quux" "muux" "woox"
How to install repeat.vim?
1. Download repeat.vim to the directory ~ / .vim / plugin (Unix / Linux), or ~ \ vimfiles \ plugin (Windows).
2. Restart Vim or connect repeat.vim with the command ": so ~ / .vim / plugin / repeat.vim" on Unix or ": so ~ / vimfiles / plugin / repeat.vim" on Windows.
Enjoy it!
Inherit surround.vim and repeat.vim. Next time I will write about a much more significant plugin. :)