2

刚刚安装了环绕.vim 插件,一些命令没有按预期工作。我以这个问题为例

This is a lo*ng line and I want to highlight two words

ays2aw"应该将以上内容更改为

This is a "long line" and I want to highlight two words

但对我来说它改变了它

This is a g and I want to highlight two words

其他时候完全没有影响!我认为这与被拉出的寄存器中的内容有关。

当我打字时ys,在右下角我可以看到它很快变为g@

最后,我很确定没有其他插件会通过发出verbose map yss命令进行干扰:

 n  yss           <Plug>Yssurround
    Last set from ~/.vim/plugin/surround.vim                                                                                                                     
 n  ys            <Plug>Ysurround
    Last set from ~/.vim/plugin/surround.vim

有谁知道这里出了什么问题?

4

1 回答 1

1

我想通了,为了更容易在 vim 和其他所有内容之间复制/粘贴,我的.vimrc文件中有以下规则:

set clipboard=unnamedplus

这使得surround.vim行为不正确。相反,我所做的是将以下行添加到我的.vimrc文件中,以允许我打开/关闭此所需的行为

nnoremap <leader>hf :set clipboard=unnamedplus<CR>
nnoremap <leader>fh :set clipboard-=unnamedplus<CR>

现在surround.vim正常工作

于 2012-10-03T20:52:44.537 回答