diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-22 13:39:15 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-22 13:47:29 +1200 |
commit | 219c6dbb97f2d26368620dd1a79c687b694f58cf (patch) | |
tree | ce1d63f69078825700404d6c0f4b5aa58bb1f7ea /vim/plugin | |
parent | Flesh out fortune.vim a little more (diff) | |
download | dotfiles-219c6dbb97f2d26368620dd1a79c687b694f58cf.tar.gz dotfiles-219c6dbb97f2d26368620dd1a79c687b694f58cf.zip |
Don't throw on startup if no fortune executables
Diffstat (limited to 'vim/plugin')
-rw-r--r-- | vim/plugin/fortune.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vim/plugin/fortune.vim b/vim/plugin/fortune.vim index 6681312a..e800bfee 100644 --- a/vim/plugin/fortune.vim +++ b/vim/plugin/fortune.vim @@ -1,8 +1,14 @@ command! -bar Fortune \ call fortune#() +function! s:FortuneVimEnter() abort + if !argc() && line2byte('$') == -1 + try | Fortune | catch | endtry + endif +endfunction + augroup fortune autocmd! autocmd VimEnter * - \ if !argc() && line2byte('$') == -1 | Fortune | endif + \ call s:FortuneVimEnter() augroup END |