ユーザカスタムのマッピングを受け入れる。
作者: 小見 拓
—
最終変更
2012年01月08日 12時14分
ユーザカスタムのマッピングを受け入れる。
- 公開するプラグインファイル側
" ユーザのマッピングが設定されていなければ、デフォルトのマッピングを設定
" hasmaptoを使うと、マッピングが設定されているかわかる。
if !hasmapto('<Plug>IncrementCommandLineNumber', 'c')
cmap <c-a> <Plug>IncrementCommandLineNumber
endif
" 機能を呼び出す
cnoremap <Plug>IncrementCommandLineNumber <c-b>"<cr>:call g:IncrementCommandLineNumbering(1)<cr>:<c-r>=g:IncrementedCommandLine()<cr>
- ユーザの設定ファイル側
" 独自のマッピングを設定する場合は、ユーザー設定ファイル側で " 例えば、このように書かせる cmap <S-Up> <Plug>IncrementCommandLineNumber

前: Vimballアーカイブでスクリプトを配布する
