无法识别的 Vim 键盘映射

发布于 2024-08-24 20:15:39 字数 668 浏览 9 评论 0原文

我试图摆脱 vim 中讨厌的键盘映射,即

\c

映射仅针对乳胶文件加载,因此它应该与乳胶套件相关。这很烦人,因为如果没有这个键盘映射破坏一切,它就无法输入 \cite 。我可以通过输入“手动”取消映射:

:unmap! \c

但是当我将其放入我的 ~/.vimrc 文件中时,这不起作用,因为它说没有这样的键盘映射。 我认为这是因为键盘映射是在 .vimrc 之后加载的,尽管我不确定。

我尝试在 bash 中查找以查找系统上所有以“vim”开头的文件 filename,然后 grep keywords $filename 查找所有对相关关键字的引用。

我搜索的关键字是“Traditional”,因为这就是映射的名称(这就是我在 vim 正常模式下键入 :map! 找到的)。它找到一些包含“Traditional”的条目,但没有任何与 \c 相对应的条目,除了文件中:

~/.gnome2/gvim-sA9LOO-session.vim

但据我所知,vim 在启动时不使用该文件。

有人知道有什么解决办法吗?

I'm trying to get rid of a pesky keymapping in vim, namely

\c

The mapping is only loaded for latex files, so it should be related to the latex-suite. It's annoying, because it can't type \cite without this keymap ruining everything. I can unmap it "manually" by typing:

:unmap! \c

But this doesn't work when I put that into my ~/.vimrc file because it says there's no such keymap.
I think this is because the keymap is loaded after .vimrc, although I'm not sure.

I've tried locate in bash to locate all files on my system that start have "vim" in their
filename, and subsequently grep keyword $filename to find all references to keyword that should be relevant.

The keyword I search for is "Traditional" because that's what the mapping is called (that's what I find by typing :map! in vim normal mode). It finds some entries that contain "Traditional" but nothing that corresponds to \c, except in the file:

~/.gnome2/gvim-sA9LOO-session.vim

But this file is not used by vim when starting up, as far as I know.

Anyone know any fix?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

找回味觉 2024-08-31 20:15:39

尝试 :verbose map \c。这将告诉您地图是在哪个文件中定义的。

Try :verbose map \c. That will tell you what file the map was defined in.

宫墨修音 2024-08-31 20:15:39

兰迪·莫里斯:

:verbose map \c

谢谢。这正是我可以使用的命令。不幸的是我无法通过谷歌找到它。

无论如何,使用它会产生以下结果:

v  \c            <Plug>VisualTraditionalj
    Last set from ~/.vim/plugin/EnhancedCommentify.vim
n  \c            <Plug>Traditionalj
    Last set from ~/.vim/plugin/EnhancedCommentify.vim  

这也是我通过我的长定位和 grep $keyword 方法找到的一些条目。

但是当我在文件(EnhancedCommentify.vim)中搜索这些映射时,即搜索“Traditionalj”或“\c”时,我没有得到任何命中。我也无法识别与文件中的映射相对应的任何其他内容。

Randy Morris:

:verbose map \c

Thanks. This is exactly a command that I could have used. Unfortunately I wasn't able to find it via google.

Anyways using it yields the following:

v  \c            <Plug>VisualTraditionalj
    Last set from ~/.vim/plugin/EnhancedCommentify.vim
n  \c            <Plug>Traditionalj
    Last set from ~/.vim/plugin/EnhancedCommentify.vim  

Which is also some of the entries I found by my long method of locate and grep $keyword.

But when I search the file (EnhancedCommentify.vim)for those mappings, i.e. search for "Traditionalj" or "\c" I don't get any hits. Nor can I identify anything else that should correspond to those mapping in the file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文