Open lobosan opened 1 year ago
Any suggestions how to get current active GitHub user? Are you using gh
tool?
When using oh-my-zsh I use the avit theme, and display my git name by adding $(git config user.name)
to the _user_host function
You can have a look at the whole theme here https://github.com/lobosan/zsh-theme/blob/main/avit.zsh-theme#LL16C1-L27C2
So, it would be great if you could add it to the spaceship configuration. In my case I'm installing it through fig, so it would be nice to see it under the git section
You are confusing git with github. It's not the same. Git is a VCS. GitHub is a hosting (website) for Git repos.
Yes, it's possible to display the result of git config user.name
, though it's probably not the info you need to know when typing every other command. You probably need that once in a while, don't you?
Yes, I meant github user. This info is important to me when I'm in a folder that is a github repo, not on every command.
Again, git config user.name
doesn't show your GitHub user. It shows you Git user.
you right sorry for the confusion, but is it possible to show my git user when working on a project with git?
Sure, you can do it yourselft. Here's a guide how to create a custom section: https://spaceship-prompt.sh/advanced/creating-section/#Typical-section-breakdown
You can create your custom git_user
section. Istead of foobar --version
you can run git config user.name
.
thanks @denysdovhan
The problem
I work with several github accounts and to me it is useful to display my github user in my prompt
Describe the solution you'd like
Show the github user before the current directory like this:
where lobosan is my github username
Describe alternatives you've considered
No response
Documentation and adoption
No response