1
0
Fork 0
dotfiles/home/config/nvim/plugins/heirline.fnl

46 lines
1.8 KiB
Text
Raw Normal View History

2022-05-25 18:19:11 +00:00
(let [heirline (require :heirline)
utils (require :heirline.utils)
conditions (require :heirline.conditions)
2022-05-25 20:34:02 +00:00
ns (require :nifoc.statusline)]
2022-05-25 18:19:11 +00:00
(local default-statusline [;; Left
ns.vi-mode
2022-06-05 20:51:14 +00:00
(ns.insert-left-unless-empty ns.git " ")
(ns.insert-left-unless-empty ns.diagnostics " ")
(ns.insert-left-unless-empty ns.current-function
" ")
2022-05-25 18:19:11 +00:00
;; Right
2022-05-25 20:34:02 +00:00
ns.push-right
2022-05-25 18:19:11 +00:00
ns.filetype-block
ns.space
ns.buffer-options
ns.space
ns.scrollbar
ns.space
2022-05-25 20:34:02 +00:00
ns.position])
2022-05-25 18:19:11 +00:00
(local telescope-statusline
{:condition (fn []
(conditions.buffer_matches {:filetype [:TelescopePrompt]}))
2022-05-25 20:34:02 +00:00
1 (ns.custom-mode :Telescope :black :green)})
2022-05-31 13:46:32 +00:00
(local neogit-statusline
{:condition (fn []
(conditions.buffer_matches {:filetype [:NeogitStatus]}))
1 (ns.custom-mode :Neogit :black :purple)})
2022-05-25 20:34:02 +00:00
(local shell-statusline
{:condition (fn []
(not= vim.b.nifoc_shell_mode nil))
1 ns.vi-mode
2 ns.push-right
3 ns.scrollbar
4 ns.space
5 (ns.shell-mode :black :purple)})
2022-05-25 18:19:11 +00:00
(local statuslines {:hl ns.default-hl
:init utils.pick_child_on_condition
1 telescope-statusline
2022-05-31 13:46:32 +00:00
2 neogit-statusline
3 shell-statusline
4 default-statusline})
2022-05-25 18:19:11 +00:00
;; Load Statusline
(set vim.opt.laststatus 3)
(heirline.setup statuslines))