Created
February 4, 2013 17:09
-
-
Save supermomonga/4708054 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim core | |
autocmd MyAutoCmd VimEnter * ShaberuSay 'ビムにようこそ' | |
autocmd MyAutoCmd VimLeave * ShaberuSay 'さようなら' | |
" VimShell | |
autocmd FileType vimshell | |
\ call vimshell#hook#add('chpwd' , 'my_vimshell_chpwd' , 'g:my_vimshell_chpwd') | |
\| call vimshell#hook#add('emptycmd', 'my_vimshell_emptycmd', 'g:my_vimshell_emptycmd') | |
\| call vimshell#hook#add('notfound', 'my_vimshell_notfound', 'g:my_vimshell_notfound') | |
function! g:my_vimshell_chpwd(args, context) | |
ShaberuSay 'よっこいしょ' | |
endfunction | |
function! g:my_vimshell_emptycmd(cmdline, context) | |
:ShaberuSay 'コマンドを入力してください' | |
return a:cmdline | |
endfunction | |
function! g:my_vimshell_notfound(cmdline, context) | |
:ShaberuSay 'コマンドが見つかりません' | |
return a:cmdline | |
endfunction | |
" .vimrc保存時に自動的にsource | |
autocmd MyAutoCmd BufWritePost .vimrc nested source $MYVIMRC | ShaberuSay 'ビムアールシーを読み込みました' | |
" 開発用ディレクトリ内.vimファイルに関して、ファイル保存時に自動でsourceする | |
execute 'autocmd MyAutoCmd BufWritePost,FileWritePost' s:local_bundle_dir . '*.vim' 'source <afile> | echo "sourced : " . bufname("%") | ShaberuSay "ソースしました"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment