From 2001cea7d87e7ef72bee11039bfe6eeeb680dd46 Mon Sep 17 00:00:00 2001
From: Gustaf Rydholm <gustaf.rydholm@gmail.com>
Date: Mon, 4 Apr 2022 22:35:27 +0200
Subject: feat(lualine): add fnl config

---
 fnl/config/lualine.fnl | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 fnl/config/lualine.fnl

diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl
new file mode 100644
index 0000000..908b6d2
--- /dev/null
+++ b/fnl/config/lualine.fnl
@@ -0,0 +1,61 @@
+;; Statusbar.
+(module config.lualine
+  {autoload {util util}})
+
+(defn- hide-in-width []
+  (> (vim.fn.winwidth 0) 80))
+
+(def- diagnostics {
+  1 "diagnostics"
+  :sources [ "nvim_diagnostic" ]
+  :sections [ "error" "warn" ]
+  :symbols { :error " " :warn " " }
+  :colored false
+  :update_in_insert false
+  :always_visible true})
+
+(def- diff {
+  1 "diff"
+  :colored false
+  :symbols { :added " " :modified " " :removed " " }
+  :cond hide-in-width})
+
+(def- branch {
+  1 "b:gitsigns_head"
+  :icon " "
+  :cond hide-in-width})
+
+(def- filetype {
+      1 "filetype" 
+      :cond hide_in_width 
+      :color {}})
+
+(let [(ok? lualine) util.load-plugin :lualine]
+  (when ok?
+    (lualine.setup {
+      :options {
+        :icons_enabled true
+        :theme "auto"
+        :component_separators { :left "" :right "" }
+        :section_separators { :left "" :right "" }
+        :disabled_filetypes [ "alpha" "dashboard" "NvimTree" "Outline" ]
+        :always_divide_middle true
+      }
+      :sections {
+        :lualine_a [ "mode" ]
+        :lualine_b { 1 branch 2 "filename" }
+        :lualine_c { 1 diff }
+        :lualine_x { 1 diagnostics 2 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 {}})))
-- 
cgit v1.2.3-70-g09d2