[question] How about using variable $CODESTATS_API_KEY as a fallback of g:codestats_api_key
I use both code-stats-vim and code-stats-zsh. They use g:codestats_api_key
and $CODESTATS_API_KEY
to configure API key. How about using variable $CODESTATS_API_KEY as a fallback of g:codestats_api_key? like this
diff --git a/plugin/codestats.vim b/plugin/codestats.vim
index 10e200b..5845f58 100644
--- a/plugin/codestats.vim
+++ b/plugin/codestats.vim
@@ -39,7 +39,7 @@ if !exists("g:codestats_api_url")
endif
if !exists("g:codestats_api_key")
- let g:codestats_api_key = ''
+ let g:codestats_api_key = $CODESTATS_API_KEY
endif
If user don't have $CODESTATS_API_KEY, it will be an empty string. How about letting all plugins of codestats use an environment variable as a fallback?
It is just an advice. Thanks!