简体   繁体   English

在vim(mac)中将“转义键”全局映射到“ jj”

[英]Globally Map “Escape Key” to “jj” in vim (mac)

I have been using vim for awhile but I have not been able to figure out how to map the escape globally - every time I open a file, I have to map the escape key to jj like this: 我已经使用vim一段时间了,但是我无法弄清楚如何在全局范围内映射转义-每次打开文件时,都必须像这样将转义键映射到jj:

:imap jj <Esc>

Is there a way to change the runtime defaults so that Esc is already mapped to jj? 有没有办法更改运行时默认值,以便Esc已映射到jj?

I found the default.vim file, but you cannot edit it on a mac (with standard mac software). 我找到了default.vim文件,但是您不能在Mac(使用标准Mac软件)上对其进行编辑。 Should I download something to edit this file? 我应该下载一些内容来编辑此文件吗? Is there another easier way? 还有另一种更简单的方法吗?

Any help is much appreciated! 任何帮助深表感谢!

The place for your local changes is called .vimrc and you typically create one in your home directory with the commands you want to execute on startup. 进行本地更改的位置称为.vimrc ,通常会使用要在启动时执行的命令在主目录中创建一个。

Run vimtutor on the (system) command line and spend a few minutes learning how to use this editor. 在(系统)命令行上运行vimtutor ,花几分钟学习如何使用此编辑器。 Then dig into the facilities provided by :help in Vim. 然后深入研究Vim中:help提供的功能。 Eg run :help vimrc in Vim. 例如在Vim中运行:help vimrc

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

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