如何在Vim中的特定列的所有行中插入特定字符?

sai*_*aif 14 vim

 Dates
=======

 Name                                   | Date
-------------------------------------------------
* Battle of the Plains of Abraham       | September 13, 1759
* Proclamation Act                      | October   07, 1763
* Stamp Act                             | March     22, 1765
* Guy Carleton becomes Governor         | April     07, 1766
* Boston Tea Party                      | December  16, 1773
* Quebec Act                            |
* Declaration of Independance           | <====== # How do I insert this bar character
* Treaty of Paris                                 # along the whole column?
* Constitutional Act                
* French Revolution                 
* War of 1812
Run Code Online (Sandbox Code Playgroud)

我希望能够插入该条字符,而无需手动插入它.虽然这在语法上不正确,但这应该是降价.

cni*_*tar 20

我只是一个初学者,但这就是我的所作所为:

  • C-v进入Visual Block(C-q在Windows上使用)
  • 选择列(动作键hjkl)
  • I
  • 输入文字
  • Esc

  • 对于这个任务,我可能会使用`r |`而不是`I | <esc>`.它*用下一个键入的字符替换光标下的每个字符.我还建议将[`virtualedit`](http://vimdoc.sourceforge.net/htmldoc/options.html#'virtualedit')设置为`block `(`:set ve = block`),它允许您进行柱状选择,以便在行尾字符后延伸. (8认同)