diff --git a/doc/localvimrc.txt b/doc/localvimrc.txt index ac83a9e..55418cb 100644 --- a/doc/localvimrc.txt +++ b/doc/localvimrc.txt @@ -49,7 +49,24 @@ a local vimrc in the root directory of a project modify the behavior of NOTE: This is only possible if you disable sandbox mode. -Other variables provide a way to prevent multiple execution of commands. +Other variables provide a way to prevent multiple execution of commands. They +can be used to implement guards: + + " do stuff you want to do on every buffer enter event + + " guard to end loading if it has been loaded for the currently edited file + if g:localvimrc_sourced_once_for_file + finish + endif + + " do stuff you want to do only once for a edited file + + " guard to end loading if it has been loaded for the running vim instance + if g:localvimrc_sourced_once + finish + endif + + " do stuff you want to do only once for a running vim instance ------------------------------------------------------------------------------ *g:localvimrc_file*