How to get feline to display TERMINAL when in toggleterm #30
Replies: 4 comments
-
It sounds like toggleterm might be using a different filetype than neovim's native terminal type which would return TERM. My first thought would be to create a custom provider (see the section on custom providers: https://github.com/freddiehaddad/feline.nvim/blob/main/USAGE.md). In the provider function, you write some lua that checks the filetype and if its the toggleterm window, return TERMINAL or simply add it to the force_inactive section to disable it on that window. The status line is disabled in neovim's terminal by default |
Beta Was this translation helpful? Give feedback.
-
Thanks @freddiehaddad. Creating a custom provider makes sense. I'm wondering though, if I create a custom provider to check the filetype and place it in an active component, I'll still have the same issue since the status line is disabled for terminals, right? In other words, my custom provider would never get called. Is there a way to enable the status line/feline for terminals? |
Beta Was this translation helpful? Give feedback.
-
You should be able to define an inactive one and that provider will be invoked for that case. If that's not true, we can figure out another option. |
Beta Was this translation helpful? Give feedback.
-
Hi @ryanmsnyder. I don't know if you want a solution for this or you have solve it. If you still want to know how you can achieve this, this is what I do:
components.inactive[1][1] = {
provider = function() return " " .. string.upper(vim.bo.ft) .. " " end,
hl = {
fg = C.overlay2, -- Put your foreground color here. (This is from catppuccin colortheme)
bg = C.mantle, -- Put your background color here.
},
}
force_inactive = {
buftypes = {
'terminal',
},
}, And with neo-tree this: force_inactive = {
filetypes = {
'^neo%-tree$',
},
}, |
Beta Was this translation helpful? Give feedback.
-
I use toggleterm as my terminal and want feline to display "TERMINAL" when my cursor is in toggleterm's window. However, when my cursor is in toggleterm, my inactive component is called, which just displays the buffer file type:
What's the easiest way to get feline to display "TERMINAL" as the vi_mode when toggleterm is active?
I suppose in my inactive component, I could check if the filetype is toggleterm and if it is, display "TERMINAL" but then I would need to copy all of my active components to my inactive table to fill out the rest of the status bar. I also noticed my components work as intended when my cursor is in neo-tree. Why is the active table called when my cursor is in neo-tree but my inactive table is called when my cursor is in toggleterm (I don't have anything specific to neo-tree configured within feline)?
I've set my status line to be global.
When toggleterm is the active window:
When neo-tree is the active window:
Beta Was this translation helpful? Give feedback.
All reactions