简体   繁体   English

在启动时未加载一些vimrc命令

[英]some vimrc commands not loaded at startup

Some time ago the line in my vimrc (d:/programs/vim/_vimrc) stopped working (not the only one): 前一段时间,我的vimrc(d:/ programs / vim / _vimrc)中的行停止工作(不是唯一的):

nnoremap <unique> ç :execute ':let @/ = "\\<' . expand('<cword>') . '\\>"'<CR>:set hlsearch<CR>

(This line overwrite the functionality of * but without jumping to the next observation, just highlight the word under the cursor. I mapped it to ç because this char is in my keyboard near * and vim does not uses it, but you could map any other key) (此行覆盖了*的功能,但没有跳到下一个观察,只需突出显示光标下的单词即可。我将其映射到ç,因为此字符位于键盘上的*附近,而vim不使用它,但是您可以映射任何字符其他键)

The problem is that for some time it stopped working if placed in _vimrc, but works if placed in $VIM/vimfiles/plugins/myPlugins.vim 问题是,如果放置在_vimrc中,它会在一段时间内停止工作,但是如果放置在$ VIM / vimfiles / plugins / myPlugins.vim中,则它会工作

Have you experienced this issue? 您遇到过这个问题吗? It could be because of installing a new plugin? 可能是因为安装了新插件? I am mostly intrigued for this behavior. 我对此行为很感兴趣。 I have tried with :scriptnames and other copies of _vimrc, .vimrc, .vim/vimrc, etc., but can not find the source of the misbehavior. 我尝试使用:scriptnames和_vimrc,.vimrc,.vim / vimrc等的其他副本,但找不到错误行为的根源。

From :h <unique> : 来自:h <unique>

If the first argument to one of these commands is "" and it is used to define a new mapping or abbreviation, the command will fail if the mapping or abbreviation already exists. 如果这些命令之一的第一个参数是“”,并且用于定义新的映射或缩写,则如果该映射或缩写已经存在,则该命令将失败。

Use :verbose nmap ç to see where it is defined. 使用:verbose nmap ç来查看它的定义位置。

Or simply drop <unique> which doesn't seem useful at all. 或者只是删除<unique> ,这似乎根本没有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM