You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using vimdiff I wanted to display the revision of the current buffer on the statusline, however gitsigns_head only shows nil when no inside a branch. It would be nice to instead display a (shortened) commit hash.
Neovim version
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1693350652 system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /nix/store/0mrn8874pisnpizlkkvcchkly3dkrhif-neovim-unwrapped-0.9.5/share/nvim "
Operating system and version
NixOS unstable
Expected behavior
Show (shortened) commit hash when in buffer at revision without pointing branch.
Actual behavior
Shows nil instead
Minimal config
forname, urlinpairs{
gitsigns='https://github.com/lewis6991/gitsigns.nvim',
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} dolocalinstall_path=vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
ifvim.fn.isdirectory(install_path) ==0thenvim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
endvim.opt.runtimepath:append(install_path)
endrequire('gitsigns').setup{
debug_mode=true, -- You must add this to enable debug messages-- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}
-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
Steps to reproduce
nvim --clean -u minimal.lua inside git repo
make a change to a file
:Gitsigns diffthis
:lua print(vim.b.gitsigns_head)
Gitsigns debug messages
No response
The text was updated successfully, but these errors were encountered:
Description
When using vimdiff I wanted to display the revision of the current buffer on the statusline, however
gitsigns_head
only showsnil
when no inside a branch. It would be nice to instead display a (shortened) commit hash.Neovim version
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1693350652 system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /nix/store/0mrn8874pisnpizlkkvcchkly3dkrhif-neovim-unwrapped-0.9.5/share/nvim "
Operating system and version
NixOS unstable
Expected behavior
Show (shortened) commit hash when in buffer at revision without pointing branch.
Actual behavior
Shows nil instead
Minimal config
Steps to reproduce
nvim --clean -u minimal.lua
inside git repo:Gitsigns diffthis
:lua print(vim.b.gitsigns_head)
Gitsigns debug messages
No response
The text was updated successfully, but these errors were encountered: