Skip to content

Instantly share code, notes, and snippets.

@supermomonga
Created February 4, 2013 17:09
Show Gist options
  • Save supermomonga/4708054 to your computer and use it in GitHub Desktop.
Save supermomonga/4708054 to your computer and use it in GitHub Desktop.
" 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