feat(nvim-tree): show git branch
This commit is contained in:
@@ -75,7 +75,10 @@ end
|
|||||||
---@type LazyPluginSpec
|
---@type LazyPluginSpec
|
||||||
return {
|
return {
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = {
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
@@ -168,7 +171,14 @@ return {
|
|||||||
},
|
},
|
||||||
renderer = {
|
renderer = {
|
||||||
full_name = true,
|
full_name = true,
|
||||||
root_folder_label = ":~",
|
root_folder_label = function(path)
|
||||||
|
local label = vim.fn.fnamemodify(path, ":~")
|
||||||
|
local git_head = vim.fn.FugitiveHead()
|
||||||
|
if git_head ~= "" then
|
||||||
|
label = label .. (" (%s)"):format(git_head)
|
||||||
|
end
|
||||||
|
return label
|
||||||
|
end,
|
||||||
special_files = {},
|
special_files = {},
|
||||||
decorators = {
|
decorators = {
|
||||||
"Git",
|
"Git",
|
||||||
|
|||||||
Reference in New Issue
Block a user