Is there a component to display current git repo name? #29
-
Didn't find this in current components |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
All of the git providers work through the gitsigns plugin and the information is queried through the following table: I do not see a repo name key in that table. You could check in gitsigns if another table holds that information and then display it by making a custom provider in feline. |
Beta Was this translation helpful? Give feedback.
-
Doing some quick google searching, it doesn't appear that a "repo name" is a concept in Git. The repo name is just the name of the directory where the files are stored.
|
Beta Was this translation helpful? Give feedback.
-
@freddiehaddad I've tried this one:
but it all freezes the second I opening neovim |
Beta Was this translation helpful? Give feedback.
This should get you going.. It will run the command to get the URL and trim the newline.
You'll want to extract the part you want using a regular expression or substring search and use indices.
You're also going to want to add some error handling in case you're in a directory that's not a git repository.
Lastly, this is kind of an expensive function to run on each statusline update. So you might want to incorporate some logic…