플러그인의 소스 코드를 본 후, 나는 다음과 같은 제안 할 수 있습니다 :
inoremap <Plug>Dummy1 <Plug>AddVimFootnote
nnoremap <Plug>Dummy1 <Plug>AddVimFootnote
inoremap <Plug>Dummy2 <Plug>ReturnFromFootnote
nnoremap <Plug>Dummy2 <Plug>ReturnFromFootnote
function s:FootnoteMaps()
if &filetype!=#'tex'
inoremap <buffer> \f <Plug>AddVimFootnote
nnoremap <buffer> \f <Plug>AddVimFootnote
inoremap <buffer> \r <Plug>ReturnFromFootnote
nnoremap <buffer> \r <Plug>ReturnFromFootnote
else
inoremap <buffer> #f <Plug>AddVimFootnote
nnoremap <buffer> #f <Plug>AddVimFootnote
inoremap <buffer> #r <Plug>ReturnFromFootnote
nnoremap <buffer> #r <Plug>ReturnFromFootnote
endif
endfunction
autocmd Filetype * call s:FootnoteMaps()
먼저 트리거하지되지만 <Plug>AddVimFootnote
및 <Plug>ReturnFromFootnote
에 자신의 매핑 설정에서 플러그인을 방지 할 수 더미 매핑을 만듭니다. 둘째 (function + autocommand)는 tex가 아닌 파일 유형에 대해 오래된 매핑을 설정합니다. 플러그인을로드하기 전에 filetype 이벤트가 트리거되었다고 확신하면 첫 번째 섹션은 필요하지 않습니다.
일반적인 해결책 인 척하지 않습니다. 일반적인 해결책은«플러그인의 소스 코드를 검사하고 조금 생각하면됩니다».
출처
2010-12-07 18:34:01
ZyX