summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-01-12 22:55:44 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-01-12 22:55:44 +0100
commite8d2c35ca15353f6a1de9b8b8e392ec29d17b830 (patch)
treeba6e9638001d3e1ca7d1016242956d329d9d1b36 /lua/config
parentc3318d3fa3d92aa09880cdff29724e78d5eeb097 (diff)
Add lualine
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/init.lua1
-rw-r--r--lua/config/lualine.lua66
2 files changed, 67 insertions, 0 deletions
diff --git a/lua/config/init.lua b/lua/config/init.lua
index 31a1aa9..3b14706 100644
--- a/lua/config/init.lua
+++ b/lua/config/init.lua
@@ -10,3 +10,4 @@ require("config.comment")
require("config.gitsigns")
require("config.nvim-tree")
require("config.bufferline")
+require("config.lualine")
diff --git a/lua/config/lualine.lua b/lua/config/lualine.lua
new file mode 100644
index 0000000..53f82ec
--- /dev/null
+++ b/lua/config/lualine.lua
@@ -0,0 +1,66 @@
+-- Statusbar
+
+local status_ok, lualine = pcall(require, "lualine")
+if not status_ok then
+ return
+end
+
+local hide_in_width = function()
+ return vim.fn.winwidth(0) > 80
+end
+
+local diagnostics = {
+ "diagnostics",
+ sources = { "nvim_diagnostic" },
+ sections = { "error", "warn" },
+ symbols = { error = " ", warn = " " },
+ colored = false,
+ update_in_insert = false,
+ always_visible = true,
+}
+
+local diff = {
+ "diff",
+ colored = false,
+ symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
+ cond = hide_in_width,
+}
+
+local branch = {
+ "b:gitsigns_head",
+ icon = " ",
+ cond = hide_in_width,
+}
+
+local location = { "location", cond = hide_in_width }
+
+local filetype = { "filetype", cond = hide_in_width, color = {} }
+
+lualine.setup({
+ options = {
+ icons_enabled = true,
+ theme = "auto",
+ component_separators = { left = "", right = "" },
+ section_separators = { left = "", right = "" },
+ disabled_filetypes = { "dashboard", "NvimTree", "Outline" },
+ always_divide_middle = true,
+ },
+ sections = {
+ lualine_a = { "mode" },
+ lualine_b = { branch, "filename" },
+ lualine_c = { diff },
+ lualine_x = { diagnostics, filetype },
+ lualine_y = {},
+ lualine_z = { "location", "progress", "encoding" },
+ },
+ inactive_sections = {
+ lualine_a = { "mode" },
+ lualine_b = { "filename" },
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = { "location", "progress", "encoding" },
+ },
+ tabline = {},
+ extensions = {},
+})