freddiehaddad / feline.nvim Goto Github PK
View Code? Open in Web Editor NEWA minimal, stylish and customizable statusline, statuscolumn, and winbar for Neovim
License: GNU General Public License v3.0
A minimal, stylish and customizable statusline, statuscolumn, and winbar for Neovim
License: GNU General Public License v3.0
Would like to be able to configure statuscolumn with feline.nvim, just like heirline.nvim can.
Same sort of API as statusline and winbar, but for statuscolumn
doing it manually, or spending dozens of hours switching to heirline, which I'm hesitant to do because it doesn't help with highlights as much as feline does
I started some work on it in my fork here but can't get it to work, but I think I'm probably just missing some feline.nvim context. I don't think it should be too much work to support it. https://github.com/mrjones2014/feline.nvim
Is it possible? I want to specify parameters for single components, for example changing the icon of the vi_mode component.
This is my config:
return {
"freddiehaddad/feline.nvim",
config = function(_, _opts)
require("feline").setup()
local lighthaus_theme = {
fg = "#DCD7BA",
bg = "#1F1F28",
black = "#16161D",
skyblue = "#16161D",
cyan = "#6A9589",
green = "#76946A",
-- oceanblue = "#658594",
oceanblue = "#1F1F28",
magenta = "#D27E99",
orange = "#FFA066",
red = "#E82424",
violet = "#957FB8",
white = "#DCD7BA",
yellow = "#FF9E3B",
}
require("feline").use_theme(lighthaus_theme)
-- require("feline").winbar.setup()
end,
}
Hi @freddiehaddad! The commit 1dcf6bf0b7fcaf2a2cddec377266eb2e6a41492e broke my custom git component that looks like this:
{
provider = 'git_branch',
icon = {
str = ' ', -- Custom git icon
hl = { fg = '#f34f29' },
},
}
The default icon is now used instead of the custom one, and the custom highlight is no longer applied.
Is this expected behaviour?
Originally posted by @mawkler in #49 (comment)
This PR seems to remove feline.add_theme()
. It doesn't mention why, and add_theme()
is still in the helpdocs which makes me belive that it was removed by mistake by @famiu.
v0.9.0
Arch
When I use lazy.nvim
to install your plugin with the config
{
'freddiehaddad/feline.nvim',
lazy = false,
}
It actually installs the wrong version:
"feline.nvim": { "branch": "master", "commit": "c6eea890c4f81725f4c51eba48d9733a248513a2" },
( from lazy-lock.json
)
This might be a lazy problem, but maybe you have some git setting pointing to master
as the default branch?
Add branch = 'main'
and now it works.
See description
Install latest version
require("lazy").setup({
{
"freddiehaddad/feline.nvim",
config = function()
-- your configuration
end,
}
})
latest
latest
I added the lua import using LazyVim and the setup() inside init.lua and it doesn't work.
Note: I'm using lazyvim.
Well.... I expect it to work with the default configs?
require("lazy").setup({
{
"freddiehaddad/feline.nvim",
config = function()
-- your configuration
end,
}
})
na
na
@mrcjkb github action is failing with:
Error: Failed installing dependency: https://luarocks.org/gitsigns.nvim-scm-1.rockspec - Build error: Failed installing lua/gitsigns/diff_ffi.lua in /home/runner/work/_temp/tmp.n5kdcAxHNW/lib/luarocks/rocks-5.1/gitsigns.nvim/scm-1/lua/gitsigns/diff_ffi.lua: lua/gitsigns/diff_ffi.lua: No such file or directory
https://github.com/freddiehaddad/feline.nvim/actions/runs/8754394451/job/24026039795#step:4:485
Looking into the problem, but maybe you can shed some light. I do see gitsigns registered with LuaRocks, so I don't think the issue is there.
Run the GHA workflow.
Successful push to LuaRocks repository.
na
0.9.5
macOS 14.2
Setting a custom provider highlight name using a function does create a highlight name using it's other properties (e.g. fg
/ bg
) instead of using the predefined name.
The example in USAGE.md doesn't work either. The Name of the hl should be something like StatusComponentVim...
(according to https://github.com/freddiehaddad/feline.nvim/blob/main/lua/feline/providers/vi_mode.lua#L56) but rather creates StatusComponent_60A040_1F1F23_bold
TLDR: After some digging around i found function parse_hl
https://github.com/freddiehaddad/feline.nvim/blob/main/lua/feline/generator.lua#L120, which just ignores the predefined hl.name
. My naive approach was to just return the hl.name
or generate a new name if none was passed and that seems to work
local p_vi_mode = require("feline.providers.vi_mode")
local vi_mode_component = {
provider = function()
return string.format(" %s ", p_vi_mode.get_vim_mode())
end,
hl = function()
return {
name = "FelineStatusbarViMode" .. p_vi_mode.get_mode_highlight_name(),
fg = "#ffffff",
bg = "#ff0000"
}
end
}
:filter /^FelineStatusbarViMode/ highlight
which should be empty:filter /^StatusComponent_/ highlight
which should output the auto-generated hl: StatusComponent_ffffff_ff0000_NONE xxx guifg=#ffffff guibg=#ff0000
I would expect that Feline does create a hl for me but uses the predefined name FelineStatusbarViMode
instead of the fallback StatusComponent_...
require("lazy").setup(
{
{
"freddiehaddad/feline.nvim",
config = function()
local f = require("feline")
local p_vi_mode = require("feline.providers.vi_mode")
local c = {
mode = {
provider = function()
return string.format(" %s ", p_vi_mode.get_vim_mode())
end,
hl = function()
return {
name = "FelineStatusbarViMode" .. p_vi_mode.get_mode_highlight_name(),
fg = "#ffffff",
bg = "#ff0000"
}
end
}
}
local components = {
active = {
{
c.mode
}
},
inactive = {}
}
f.setup({components = components})
end
}
}
)
0.9.5
6.7.4-zen1-1-zen
Everything else works fine but the Git Branch provider doesn't.
I have the other sections setup in my config but this is everything where git_branch is used.
I definitely have lewis6991/gitsigns.nvim
added as a dependency.
visible git_branch
{
'freddiehaddad/feline.nvim',
config = function()
local c = {
git_branch = {
provider = "git_branch",
}
}
local left = {
c.git_branch,
}
local components = {
active = {
left
}
inactive = {
right
}
require('feline').setup({
components = components,
})
end
}
NVIM v0.9.4 Build type: Release LuaJIT 2.1.1696795921
MacOs 13.4.1
I've encountered a peculiar bug that's a bit challenging to articulate. Essentially, an error message appears at the top of the screen. While this error doesn't impede the functionality of Neovim, its presence can be somewhat bothersome. Reproducing the error is possible in various scenarios, but it consistently involves the usage of feline
.
Initially, I suspected catppuccin
was the root cause and opened an issue there: link to the issue. However, upon further investigation, I discovered that the error also manifests with a minimal config containing feline
, treesitter
.
The error itself is truncated so basically no information is shown:
nvim --clean -u repro.lua
:qa<cr>
nvim --clean -u repro.lua newfile.lua
:lkdjflkdjf<cr>
-- > Error is shown
No error
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- termguicolors must be enabled for feline
vim.opt.termguicolors = true
-- This is needed for reproduction of the error
vim.opt.foldmethod = 'expr'
-- install plugins
local plugins = {
{
'freddiehaddad/feline.nvim',
config = function()
require('feline').setup()
end,
},
{
'nvim-treesitter/nvim-treesitter',
config = function()
require('nvim-treesitter.configs').setup {
highlight = { enable = true },
ensure_installed = { 'lua' },
}
end,
}
}
require 'lazy'.setup(plugins, {
root = root .. '/plugins',
})
I have some code in my config that I feel could be integrated into feline for others to easily use
Currently, the theme in the setup is for both statusline and winbar, but I really like having a separate background color for winbar. I am proposing adding a theme
to the winbar setup, and then falling back to the global theme if not specified
I like to disable winbar on some buffers like a terminal buffer, startify buffer, etc... I feel like having an option to only list the buffer filetypes, and having feline disabling it for those buffers would be awesome!
I just wanted to open an issue first to hear if you would be open to these changes. I would be happy to implement these changes myself in that case🙌
Having it as it is in my config
No response
0.10.0-dev-1617+g143a17833-Homebrew
MacOS 13.3.1
this sign has been removed from nerd-fonts
{ provider = "git_diff_changed" }
in your config
expected the symbol to be there but instead it looks like this
require("lazy").setup({
{
"freddiehaddad/feline.nvim",
config = function()
require("feline").setup({ components = { provider = "git_diff_changed" } })
end,
}
})
NVIM v0.10.0-dev-2937+g8e5c48b08-dirt
Gentoo
:Rocks sync
tries to git clone
feline, feline rockspec has ssh+git url, so git tries to read ssh key but it has a passphrase and luarocks or rocks.nvim can't handle that, failing install.
This was first reported to rocks.nvim, got moved to nvim-neorocks and closed there with suggestion to create an issue to feline repo with suggested fix of "change the source URL to HTTPS". Here I am ._.
:Rocks install feline.nvim
, also have a passphrase on your ssh key.
Installs feline.nvim
require("lazy").setup({
{
"freddiehaddad/feline.nvim",
config = function()
-- your configuration
end,
}
})
NVIM v0.11.0-dev-164+g3a1515bfee
Arch Linux
Deprecation of vim.lsp.get_active_clients()
. The fix is just one line, swapping the get_active_clients
function for get_clients
and leaving the parameters unchanged, it seems.
vim.lsp.get_active_clients() is deprecated. Run ":checkhealth vim.deprecated" for more information
Which leads to the following:
~
- WARNING vim.lsp.get_active_clients() is deprecated. Feature will be removed in Nvim 0.12
- ADVICE:
- use vim.lsp.get_clients() instead.
- stack traceback:
/home/<user_name>/.local/share/nvim/lazy/catppuccin/lua/catppuccin/groups/integrations/feline.lua:415
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:301
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:447
[C]:-1
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:498
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:615
- stack traceback:
/home/<user_name>/.local/share/nvim/lazy/catppuccin/lua/catppuccin/groups/integrations/feline.lua:415
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:301
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:447
[C]:-1
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:498
/home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:615
[C]:-1
/usr/share/nvim/runtime/lua/vim/health.lua:353
nvim>:1
No response
0.8.3
Arch
I sometimes get a weird symbol for the git branch. It stays for the whole session unchanged.
I have changed my config multiple times now. Whenever I change it, the symbol is fine until the next restart(?) of the PC? I never had any problems with other missing symbols before?
Funny enough this works fine with my dotfiles (managed with YADM, which is probably supplied by gitsigns. On all the other cloned Git repos it doesn't work...
Here is a picture:
...?
Show actual branch symbol
require("lazy").setup({
{
'freddiehaddad/feline.nvim',
lazy = false,
dependencies = { 'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons', 'rebelot/kanagawa.nvim', 'lewis6991/gitsigns.nvim' },
config = function ()
local colors = function ()
local theme = require('kanagawa.colors').setup({ theme = 'wave' }).theme
return {
bg = theme.ui.bg,
bg_dim = theme.ui.bg_dim,
fg = theme.ui.fg,
fg_dim = theme.ui.fg_dim,
fg_reverse = theme.ui.fg_reverse,
special = theme.ui.special,
diag_warn = theme.diag.warning,
diag_error = theme.diag.error,
diag_hint = theme.diag.hint,
diag_info = theme.diag.info,
git_del = theme.vcs.removed,
git_add = theme.vcs.added,
git_change = theme.vcs.changed,
}
end
local c = {
fileinfo = {
provider = {
name = "file_info",
opts = {
type = "relative-short",
},
},
hl = {
style = "bold",
},
right_sep = "block",
},
gitBranch = {
provider = 'git_branch',
left_sep = "block",
right_sep = "block",
hl = {
fg = "special",
},
},
gitDiffAdded = {
provider = "git_diff_added",
hl = {
fg = "git_add",
},
left_sep = "block",
right_sep = "block",
},
gitDiffRemoved = {
provider = "git_diff_removed",
hl = {
fg = "git_del",
},
left_sep = "block",
right_sep = "block",
},
gitDiffChanged = {
provider = "git_diff_changed",
hl = {
fg = "git_change",
},
left_sep = "block",
right_sep = "right_filled",
},
separator = {
provider = "",
},
diagnostic_errors = {
provider = "diagnostic_errors",
hl = {
fg = "diag_error"
},
},
diagnostic_warnings = {
provider = "diagnostic_warnings",
hl = {
fg = "diag_warn",
},
},
diagnostic_hints = {
provider = "diagnostic_hints",
hl = {
fg = "diag_hint",
},
},
diagnostic_info = {
provider = "diagnostic_info",
hl = {
fg = "diag_info",
},
},
lsp_client_names = {
provider = "lsp_client_names",
hl = {
style = "bold",
fg = "special"
},
left_sep = "left_filled",
right_sep = "block",
},
file_type = {
provider = {
name = "file_type",
opts = {
filetype_icon = false,
case = "uppercase",
},
},
hl = {
style = "bold",
fg = "fg",
},
left_sep = "block",
right_sep = "block",
},
position = {
provider = "position",
hl = {
fg = "fg",
style = "bold",
},
left_sep = "block",
right_sep = "block",
},
line_percentage = {
provider = "line_percentage",
hl = {
style = "bold",
},
left_sep = "block",
right_sep = "block",
},
scroll_bar = {
provider = {
name = "scroll_bar",
opts = {
reverse = true
}
},
hl = {
bg = "fg",
fg = 'bg',
style = "bold",
},
},
}
local left = {
c.fileinfo,
c.gitBranch,
c.gitDiffAdded,
c.gitDiffRemoved,
c.gitDiffChanged,
c.separator,
}
local right = {
c.lsp_client_names,
c.diagnostic_errors,
c.diagnostic_warnings,
c.diagnostic_info,
c.diagnostic_hints,
c.file_type,
c.position,
c.line_percentage,
c.scroll_bar,
}
local components = {
active = {
left,
right,
},
inactive = {
left,
right,
},
}
require('feline').setup({
components = components,
theme = colors()
})
end
}
})
NVIM v0.9.2
MacOs 13.4.1
Most default providers return an icon. It is possible to overwrite the icon by adding
icon = {
str = 'new_icon',
hl = {
fg = '#ff0000',
bg = '#00ff00',
}
}
to the component. However, it is not possible to ONLY change the highlight and keep the default icon of the provider
nvim -u repro.lua
--> icon is not shown
Delete the following part
icon = {
hl = {
fg = '#ff0000',
bg = '#00ff00',
}
}
--> icon is shown
I would like the ability to customize the icon highlighting of providers without losing the associated icon string.
local comp = {
provider = {
name = 'file_type',
opts = {
filetype_icon = true
}
},
-- As soon as you add this, the icon is not shown anymore
icon = {
hl = {
fg = '#ff0000',
bg = '#00ff00',
}
}
}
require('lazy').setup({
{
'freddiehaddad/feline.nvim',
config = function()
require('feline').setup {
components = {
active = { { comp } }
}
}
end,
}
})
> Hi @freddiehaddad! The commit [1dcf6bf](https://github.com/freddiehaddad/feline.nvim/commit/1dcf6bf0b7fcaf2a2cddec377266eb2e6a41492e) broke my custom git component that looks like this:
{ provider = 'git_branch', icon = { str = ' ', -- Custom git icon hl = { fg = '#f34f29' }, }, }The default icon is now used instead of the custom one, and the custom highlight is no longer applied.
Is this expected behaviour?
Hm.. That's strange. I tested your case explicitly w/o issue. Mind sharing your config so I can test it? At first glance, I don't see why it's failing.
EDIT:
The default component.icon
table is merged with yours and should keep your settings instead of the default. I might need to look at the remaining providers as there could be a case I missed.
To answer your question, it should have been a non-breaking change. I will address it.
Originally posted by @freddiehaddad in #49 (comment)
Hi @freddiehaddad! The commit 1dcf6bf0b7fcaf2a2cddec377266eb2e6a41492e broke my custom git component that looks like this:
{
provider = 'git_branch',
icon = {
str = ' ', -- Custom git icon
hl = { fg = '#f34f29' },
},
}
The default icon is now used instead of the custom one, and the custom highlight is no longer applied.
Is this expected behaviour?
Originally posted by @mawkler in #49 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.