简体   繁体   中英

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:

:imap jj <Esc>

Is there a way to change the runtime defaults so that Esc is already mapped to jj?

I found the default.vim file, but you cannot edit it on a mac (with standard mac software). 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.

Run vimtutor on the (system) command line and spend a few minutes learning how to use this editor. Then dig into the facilities provided by :help in Vim. Eg run :help vimrc in Vim.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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