about summary refs log tree commit diff
path: root/fnl/nvrc/ui/statusline.fnl
blob: c50bc811fa0ef7b06e7c5d3bb2dc95b35d86d34f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(import-macros {: setl!} :nvrc.macro.set)
(import-macros {: ag!
                : au!} :nvrc.macro.event)

(local {: diagnostics} (require :nvrc.ui.modules.diagnostics))

(global statusline {})
(set statusline.enable (fn []
                         (table.concat ["%#StatusLineAccent#"
                                        "▊ "
                                        "%#StatusLine#"
                                        "%#StatusLineAccentBold#"
                                        "%f%m%r "
                                        "%#StatusLine#"
                                        "%l:%c | "
                                        (diagnostics)
                                        "%="
                                        "%#StatusLineAccentBold#"
                                        "%y *%n "])))

(ag! ui-statusline
  (au! [WinEnter BufEnter] * #(setl! statusline "%!v:lua.statusline.enable()"))
  (au! [WinLeave BufLeave] * #(setl! statusline " ")))