Mercurial > vim
diff runtime/doc/autocmd.txt @ 8738:e770986c855a v7.4.1658
commit https://github.com/vim/vim/commit/1473551a4457d4920b235eeeb9f279e196ee7225
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 26 21:00:08 2016 +0100
patch 7.4.1658
Problem: A plugin does not know when VimEnter autocommands were already
triggered.
Solution: Add the v:vim_did_enter variable.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 26 Mar 2016 21:15:05 +0100 |
parents | aea5ebf352c4 |
children | b1a19a2f73f0 |
line wrap: on
line diff
--- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -918,7 +918,15 @@ VimEnter After doing all the startup s loading .vimrc files, executing the "-c cmd" arguments, creating all windows and loading the buffers in them. - *VimLeave* + Just before this event is triggered the + |v:vim_did_enter| variable is set, so that you + can do: > + if v:vim_did_enter + call s:init() + else + au VimEnter * call s:init() + endif +< *VimLeave* VimLeave Before exiting Vim, just after writing the .viminfo file. Executed only once, like VimLeavePre.