Import default username from 'git config github.user' #64
Conversation
FYI,
|
You need to create call themis#option('runtimepath', expand('~/.vim/bundle/vimproc.vim'))
call themis#option('runtimepath', expand('~/.vim/bundle/vital.vim')) Or apply |
@@ -110,6 +110,10 @@ function! s:get_default_username(apiname) abort | |||
let username = get(g:gista#client#default_username, a:apiname, default) | |||
endif | |||
if empty(username) | |||
let username = system('git config github.user') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define s:R = s:V.import('Process')
at the top of this file and use s:R.system()
instead.
Additionally, please add a switch variable (say, g:gista#client#use_git_config_github_user
) at the bottom of this file (the default value should be 0
) and use it to check if gista should call git config github.user
.
It is required because
- Calling
system
would slow the response - Some users may want to use vim-gista as an anonymous mode in default. This part is called when a new client is created, mean that it will be called by any
:Gista XXX
command so without switch option. That's why users require to call:Gista logout
everytime after vim started if they want to use vim-gista as an anonymous mode in default.
And please add documentation about the variable around
https://github.com/lambdalisue/vim-gista/blob/master/doc/vim-gista.txt#L124
https://github.com/lambdalisue/vim-gista/blob/master/doc/vim-gista.txt#L256
https://github.com/lambdalisue/vim-gista/blob/master/doc/vim-gista.txt#L471
Thanks for implementation. I pointed two things so please fix these ;-) |
Okay. |
I changed my mind. The default value of the option should be 1 while majority of people prefer to login I guess. |
Okay :) |
* Use s:Process.system() instead of system() * Add a switch variable g:gista#client#use_git_config_github_user
Fixed. |
LGTM. Could you add document? |
Added. |
Import default username from 'git config github.user'
Thanks a lot ;~) I'll add other documents later. |
My pleasure! |
Import default GitHub username from
git config github.user
if it is present.This PR can get rid of duplicate configuration in .vimrc and .gitconfig .