status.lua: Display hash and branch of file

Return current commit hash and branch of repository where file in buffer
is located instead of current directory.
This commit is contained in:
niten94
2025-03-02 09:40:27 +08:00
parent d992c606c5
commit 85e2b3bd86
2 changed files with 15 additions and 13 deletions

View File

@@ -8,8 +8,10 @@ those options (`> help options`) for more information.
This plugin provides functions that can be used in the status line format:
* `status.branch`: returns the name of the current git branch.
* `status.hash`: returns the hash of the current git commit.
* `status.branch`: returns the name of the current git branch in the repository
where the file is located.
* `status.hash`: returns the hash of the current git commit in the repository
where the file is located.
* `status.paste`: returns "" if the paste option is disabled and "PASTE"
if it is enabled.
* `status.lines`: returns the number of lines in the buffer.