我编辑了我的.vim/after/ftplugin/html.vim
包括
inoremap . >
inoremap > .
问题是,现在当我切换到我的css
文件时,重映射仍然存在。当我加载css
文件时,我可以(可能)自动取消所有重映射,但这也会否定我的.vimrc
文件中的任何重映射(我认为)。有没有办法让重映射只适用于html
文件?
您正在寻找缓冲区本地地图:
inoremap <buffer> . >
看看这里:http://learnvimscriptthehardway.stevelosh.com/chapters/11.html
或者在你的vim中输入:h map-local