Replies: 2 comments 4 replies
-
The variable |
Beta Was this translation helpful? Give feedback.
0 replies
-
Okay, thanks. I'm wondering how I could include that in my local g = vim.g
local neogitstat = print(require'neogit'.get_repo().head.branch)
-- custom lightline
g.lightline = {
active = {
left = { { "mode", "paste" }, { "readonly", "filename", "modified" }, { "lineinfo" }, { "percent" } },
right = {
{ "gitbranch" },
{ "fileformat" },
{ "fileencoding" },
{ "filetype" },
}
},
colorscheme = "onedark",
component_function = {
fileformat = "MyFileformat",
filetype = "MyFiletype",
gitbranch = neogitstat,
-- gitbranch = "fugitive#head",
},
}
vim.cmd([[
function! MyFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
endfunction
function! MyFileformat()
return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
endfunction
]])
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The heading of the question…
How do I get the name of my current branch in my status line?
Beta Was this translation helpful? Give feedback.
All reactions