-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Vim strings (vim.bo.ft), netrw state, color on start, custom buffer-specific configs and Windows tililng problem #58
Comments
Heyyo @AXVIII3, Something like: -- ...
right = {
"right_sep", "- ", function() return vim.bo.ft:upper() end, "- ", "left_sep", " ",
"right_sep", "-line_column", "left_sep", " ",
}
-- ... |
@tamton-aquib |
the In this case, we could do something like: --- Since "StalineFill" is the highlight for filling bg
function() return { "StalineFill", vim.bo.filetype:upper() } end |
@tamton-aquib Also one last question I'd like to bother you with.. sometimes the plugin reverts to the base nvim status line when using Netrw... while sometimes it doesnt.. See video... Also I noticed that you had seperate configs for nvimtree, dashboard and packer... so is it possible to create different configs for different buffertypes? |
That might not be me 😅 . This plugin was made maybe 4 years ago.
That is strange. I dont use netrw much since i'm still on nvim-tree, but I'll check.
Buffer specific lines can be configured via For example: require("staline").setup({
special_table = {
-- Where "netrw" key is the filetype.
netrw = { 'NetRW', ' ' },
},
} |
Oops... Sorry.. I used to use Lualine which was tremendously slow... So I have been researching many status lines today... so I mixed up some... this is a very good plugin nonetheless... love the customizability it provides
So these special tables are similar to the sections table but for specific file types? |
Hmm nope, its just a table with 2 values. The text and the icon for the specific filetype key. |
Yeah I figured that one out pretty soon..... And absolutely not... this is an amazing plugins... better than anything I (or most) could write Also one final thing.. I swear I'll stop bothering you after this |
Heyyo @AXVIII3, I think that behaviour is because of me not taking into account the I'll check it this/next week. |
@tamton-aquib
I see... I actually like the concept of laststatus = 3.... I'm switching to that
Sure sure.. no worries... take your time 👍🏻 Cheers :) |
So hey @AXVIII3, Im closing this issue for now. Feel free to re-open if there are any more issues 👍🏻 |
@tamton-aquib |
Ah yes sorry, |
I have pushed a fix, can you check? @AXVIII3 (No hurry btw) |
It works great with NetRw now! No need to be sorry... I'm the one who dragged you into fixing a niche issue 😅 |
Also I was contemplating even mentioning this issue as its very minor. But the status line doesnt appear immediately after vim is opened... it appears after a file is opened.... it also seems to appear on some buffer functions such as while changing folders or opening NetRw but the colors dont work in those cases... I am mentioning just the sake of it existing... not an issue per se |
Thanks a ton though!! :) |
@tamton-aquib M.get_statusline = function(status)
if conf.special_table[vim.bo.ft] ~= nil then
local special = conf.special_table[vim.bo.ft]
return "%#Staline#%=" .. special[2] .. special[1] .. "%="
end
M.sections = {}
local mode = vim.api.nvim_get_mode()['mode']
local fgColor = status and conf.mode_colors[mode] or t.inactive_color
local bgColor = status and t.bg or t.inactive_bgcolor
local modeIcon = conf.mode_icons[mode] or " "
local f_name = t.full_path and '%F' or '%t'
-- TODO: original color of icon
local f_icon = util.get_file_icon(vim.fn.expand('%:t'), vim.fn.expand('%:e'))
local edited = vim.bo.mod and t.mod_symbol or ""
-- TODO: need to support b, or mb?
local size = ("%.1f"):format(vim.fn.getfsize(vim.api.nvim_buf_get_name(0))/1024)
call_highlights(fgColor, bgColor)
.
.
.
.
.
end The if statement in the first few lines blocks the execution of the M.get_statusline = function(status)
local mode = vim.api.nvim_get_mode()['mode']
local fgColor = status and conf.mode_colors[mode] or t.inactive_color
local bgColor = status and t.bg or t.inactive_bgcolor
call_highlights(fgColor, bgColor)
if conf.special_table[vim.bo.ft] ~= nil then
local special = conf.special_table[vim.bo.ft]
return "%#Staline#%=" .. special[2] .. special[1] .. "%="
end
M.sections = {}
local modeIcon = conf.mode_icons[mode] or " "
local f_name = t.full_path and '%F' or '%t'
-- TODO: original color of icon
local f_icon = util.get_file_icon(vim.fn.expand('%:t'), vim.fn.expand('%:e'))
local edited = vim.bo.mod and t.mod_symbol or ""
-- TODO: need to support b, or mb?
local size = ("%.1f"):format(vim.fn.getfsize(vim.api.nvim_buf_get_name(0))/1024)
call_highlights(fgColor, bgColor)
end |
Reopened just to gain your attention 😉 WIll close soon |
Hi @AXVIII3, Could you open a new issue for this? 😅 |
Sure! |
There is this string vim.bo.filetype


I want a section with this string.. So I edited the premade pebble config... however it just shows an empty string (right side)

Full config
The text was updated successfully, but these errors were encountered: