Archived
0
0
Fork 0

dont use lualine to set winbar to fix stupid theming issue

This commit is contained in:
Daryl Ronningen 2022-09-05 19:28:15 -07:00
parent 7d8c680f17
commit 4bde813ee5
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
3 changed files with 14 additions and 23 deletions

View file

@ -4,7 +4,7 @@ vim.opt.cmdheight = 2
vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.completeopt = { "menu", "menuone", "noselect" }
vim.opt.conceallevel = 0 vim.opt.conceallevel = 0
vim.opt.fileencoding = "utf-8" vim.opt.fileencoding = "utf-8"
vim.o.background = "dark" vim.opt.background = "dark"
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.opt.ignorecase = true vim.opt.ignorecase = true
vim.opt.mouse = "a" vim.opt.mouse = "a"
@ -42,6 +42,8 @@ vim.opt.foldlevel = 99
vim.opt.foldlevelstart = -1 vim.opt.foldlevelstart = -1
vim.opt.foldenable = true vim.opt.foldenable = true
vim.opt.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] vim.opt.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.opt.winbar = "%{%v:lua.require'plugins.configs.winbar'.get_winbar()%}"
vim.cmd("set whichwrap+=<,>,[,],h,l") vim.cmd("set whichwrap+=<,>,[,],h,l")
vim.cmd("set iskeyword+=-") vim.cmd("set iskeyword+=-")
vim.cmd("set formatoptions-=cro") vim.cmd("set formatoptions-=cro")

View file

@ -1,5 +1,4 @@
local lualine = require("lualine") local lualine = require("lualine")
local winbar = require("plugins.configs.winbar")
lualine.setup({ lualine.setup({
options = { options = {
@ -8,9 +7,6 @@ lualine.setup({
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "neo-tree" }, disabled_filetypes = { "alpha", "neo-tree" },
always_divide_middle = true, always_divide_middle = true,
refresh = {
winbar = 50,
},
theme = "catppuccin", theme = "catppuccin",
}, },
sections = { sections = {
@ -37,20 +33,4 @@ lualine.setup({
lualine_y = {}, lualine_y = {},
lualine_z = { "tabs" }, lualine_z = { "tabs" },
}, },
winbar = { }
lualine_a = {},
lualine_b = { winbar.get_fileicon() .. winbar.get_filename() },
lualine_c = { winbar.get_location },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
})

View file

@ -3,6 +3,11 @@ local M = {}
local navic = require("nvim-navic") local navic = require("nvim-navic")
local gps = require("nvim-gps") local gps = require("nvim-gps")
gps.setup()
navic.setup({
highlight = true,
})
local function is_empty(s) local function is_empty(s)
return s == nil or s == "" return s == nil or s == ""
end end
@ -20,7 +25,7 @@ function M.get_location()
elseif not is_empty(gps_location) then elseif not is_empty(gps_location) then
return "%#WinBarContext#" .. " " .. ">" .. " " .. gps_location .. "%*" return "%#WinBarContext#" .. " " .. ">" .. " " .. gps_location .. "%*"
else else
return "" return "%#WinBarContext#" .. "%*"
end end
end end
@ -44,4 +49,8 @@ function M.get_fileicon()
return "%#WinBarContext#" .. "%#" .. hl_winbar_file_icon .. "#" .. file_icon .. " " .. "%*" return "%#WinBarContext#" .. "%#" .. hl_winbar_file_icon .. "#" .. file_icon .. " " .. "%*"
end end
function M.get_winbar()
return "%#WinBarContext#" .. M.get_fileicon() .. M.get_filename() .. M.get_location() .. "%*"
end
return M return M