diff options
-rw-r--r-- | nvim/.config/nvim/lua/lualine/themes/gruvbox.lua | 39 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua | 5 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/lualine.lua | 96 |
3 files changed, 87 insertions, 53 deletions
diff --git a/nvim/.config/nvim/lua/lualine/themes/gruvbox.lua b/nvim/.config/nvim/lua/lualine/themes/gruvbox.lua new file mode 100644 index 0000000..c83da2d --- /dev/null +++ b/nvim/.config/nvim/lua/lualine/themes/gruvbox.lua @@ -0,0 +1,39 @@ +local status_ok, colors = pcall(require, "gruvbox.palette") +if not status_ok then + return require("lualine.themes.gruvbox_dark") +end + +local theme = { + normal = { + a = { fg = colors.dark0, bg = colors.light4, gui = "bold" }, + b = "StatusLine", + c = "StatusLineNC", + }, + insert = { + a = { fg = colors.dark0, bg = colors.bright_blue, gui = "bold" }, + b = "StatusLine", + c = "StatusLineNC", + }, + visual = { + a = { fg = colors.dark0, bg = colors.bright_orange, gui = "bold" }, + b = "StatusLine", + c = "StatusLineNC", + }, + replace = { + a = { fg = colors.dark0, bg = colors.bright_red, gui = "bold" }, + b = "StatusLine", + c = "StatusLineNC", + }, + command = { + a = { fg = colors.dark0, bg = colors.bright_green, gui = "bold" }, + b = "StatusLine", + c = "StatusLineNC", + }, + inactive = { + a = { fg = colors.light4, bg = colors.dark1, gui = "bold" }, + b = "StatusLineNC", + c = "StatusLineNC", + }, +} + +return theme diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua b/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua index e8d3ce1..4637b82 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua @@ -7,6 +7,7 @@ M.setup = function() return end + local colors = require("gruvbox.palette") gruvbox.setup({ overrides = { GruvboxRedSign = { bg = "" }, @@ -26,6 +27,10 @@ M.setup = function() DiffAdd = { reverse = false }, DiffChange = { reverse = false }, DiffText = { reverse = false }, + StatusLine = { fg = colors.light1, bg = colors.dark2, reverse = false }, + StatusLineNC = { fg = colors.light4, bg = colors.dark1, reverse = false }, + WinBar = { link = "StatusLineNC" }, + WinBarNC = { fg = colors.light4, bg = "" }, }, transparent_mode = true, }) diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/lualine.lua b/nvim/.config/nvim/lua/tobyvin/plugins/lualine.lua index 70e0eb7..69d763f 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/lualine.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/lualine.lua @@ -15,77 +15,58 @@ M.setup = function() return end - local diff = { - "diff", - source = function() - local gitsigns = vim.b.gitsigns_status_dict - if gitsigns then - return { - added = gitsigns.added, - modified = gitsigns.changed, - removed = gitsigns.removed, - } - end - end, - padding = { left = 0, right = 1 }, - } - - local diagnostics = { - "diagnostics", - sources = { utils.diagnostic.count }, - symbols = { - error = utils.diagnostic.signs.error.text, - warn = utils.diagnostic.signs.warn.text, - info = utils.diagnostic.signs.info.text, - hint = utils.diagnostic.signs.hint.text, - }, - update_in_insert = true, - - padding = { left = 0, right = 1 }, - } - local workspace = { - { "b:gitsigns_head", icon = "" }, - diff, - diagnostics, + "branch", + { + "diff", + source = function() + local gitsigns = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitsigns.added, + modified = gitsigns.changed, + removed = gitsigns.removed, + } + end + end, + padding = { left = 0, right = 1 }, + }, } local buffer = { { - "filetype", - colored = false, - icon_only = true, - padding = { left = 1, right = 0 }, + "filename", + color = "WinBar", }, - "filename", - vim.tbl_extend("force", diagnostics, { source = { utils.diagnostic.buf_count }, colored = false }), { - require("nvim-navic").get_location, - color = { bg = "" }, - }, - { - "string.format(' ')", - color = { bg = "" }, + "diagnostics", + source = { utils.diagnostic.buf_count }, + symbols = { + error = utils.diagnostic.signs.error.text, + warn = utils.diagnostic.signs.warn.text, + info = utils.diagnostic.signs.info.text, + hint = utils.diagnostic.signs.hint.text, + }, + update_in_insert = true, + color = "WinBar", + padding = { left = 0, right = 1 }, }, } + local filetypes = vim.fn.getcompletion("", "filetype") - local disabled = vim.tbl_filter(function(ft) + local neogit = vim.tbl_filter(function(ft) return string.match(ft, "^Neogit.*") ~= nil end, filetypes) - table.insert(disabled, "gitcommit") lualine.setup({ options = { - refresh = { - statusline = 200, - }, component_separators = "", section_separators = "", disabled_filetypes = { "netrw", "alpha", "", - winbar = disabled, + winbar = vim.tbl_extend("keep", neogit, { "gitcommit" }), }, }, @@ -114,7 +95,16 @@ M.setup = function() }, winbar = { - lualine_c = buffer, + lualine_b = buffer, + lualine_c = { + { + -- Hack to prevent lualine_b from taking over the lualine_c when navic has no results + function() + return require("nvim-navic").get_location():gsub("^$", " ") + end, + color = "WinBarNC", + }, + }, }, tabline = { @@ -123,11 +113,11 @@ M.setup = function() }, extensions = { - "quickfix", - "man", "fzf", + "man", "nvim-dap-ui", "symbols-outline", + "quickfix", "toggleterm", { sections = { |