diff --git a/home/config/nvim/nifoc/statusline.fnl b/home/config/nvim/nifoc/statusline.fnl index b0fe6a1..bb045f2 100644 --- a/home/config/nvim/nifoc/statusline.fnl +++ b/home/config/nvim/nifoc/statusline.fnl @@ -8,7 +8,8 @@ colors (. (require :nifoc.theme) :colors) formatting (require :nifoc.formatting) nifoc-treesitter (require :nifoc.treesitter) - navic (require :nvim-navic)] + navic (require :nvim-navic) + neogit (require :neogit)] (fn buffer-variable-exists? [key] (not= (. vim :b key) nil)) @@ -162,6 +163,8 @@ (set self.check-length (length self.git-head)))) 1 mod.space-if-count-or-length 2 {:provider #(.. "  " $1.git-head " ") + :on_click {:name :heirline_git_branch + :callback #(neogit.open {:kind :split})} :hl {:fg colors.black :bg colors.orange :bold true}} 3 mod.space 4 {:provider #(.. " " $1.git-added " ") diff --git a/home/config/nvim/nifoc/theme.fnl b/home/config/nvim/nifoc/theme.fnl index b7f9e99..38249b5 100644 --- a/home/config/nvim/nifoc/theme.fnl +++ b/home/config/nvim/nifoc/theme.fnl @@ -80,6 +80,32 @@ (highlight :CmpItemKindFile {:fg mod.colors.black :bg mod.colors.white}) (highlight :CmpItemKindFolder {:fg mod.colors.black :bg mod.colors.white}) (highlight :CmpItemKindTabNine - {:fg mod.colors.black :bg mod.colors.bright_magenta})) + {:fg mod.colors.black :bg mod.colors.bright_magenta}) + ;; neogit + (highlight :NeogitBranch {:fg mod.colors.green :bold true}) + (highlight :NeogitBranchHead + {:fg mod.colors.green :bold true :underline true}) + (highlight :NeogitRemote {:fg mod.colors.yellow :bold true}) + (highlight :NeogitSectionHeader {:fg mod.colors.purple :bold true}) + (let [neogit-groups-added [:NeogitChangeAdded :NeogitChangeNewFile] + neogit-groups-updated [:NeogitChangeModified + :NeogitChangeRenamed + :NeogitChangeUpdated + :NeogitChangeCopied + :NeogitChangeBothModified] + neogit-groups-deleted [:NeogitChangeDeleted]] + (each [_ group (pairs neogit-groups-added)] + (highlight group {:fg mod.colors.green :italic true})) + (each [_ group (pairs neogit-groups-updated)] + (highlight group {:fg mod.colors.yellow :italic true})) + (each [_ group (pairs neogit-groups-deleted)] + (highlight group {:fg mod.colors.red :italic true}))) + (highlight :NeogitDiffAdd {:fg mod.colors.comment :bg mod.colors.green}) + (highlight :NeogitDiffAddHighlight + {:fg mod.colors.black :bg mod.colors.bright_green}) + (highlight :NeogitDiffDelete {:fg mod.colors.comment :bg mod.colors.red}) + (highlight :NeogitDiffDeleteHighlight + {:fg mod.colors.black :bg mod.colors.bright_red}) + (highlight :NeogitCursorLine {:fg mod.colors.fg :bg mod.colors.visual})) mod) diff --git a/home/config/nvim/plugins/heirline.fnl b/home/config/nvim/plugins/heirline.fnl index b3146e9..d5a4fc7 100644 --- a/home/config/nvim/plugins/heirline.fnl +++ b/home/config/nvim/plugins/heirline.fnl @@ -24,6 +24,10 @@ {:condition (fn [] (conditions.buffer_matches {:filetype [:TelescopePrompt]})) 1 (ns.custom-mode :Telescope :black :green)}) + (local neogit-statusline + {:condition (fn [] + (conditions.buffer_matches {:filetype [:NeogitStatus]})) + 1 (ns.custom-mode :Neogit :black :purple)}) (local shell-statusline {:condition #(not= vim.b.nifoc_shell_mode nil) 1 ns.vi-mode @@ -34,8 +38,9 @@ (local statusline {:hl ns.default-hl :fallthrough false 1 telescope-statusline - 2 shell-statusline - 3 default-statusline}) + 2 neogit-statusline + 3 shell-statusline + 4 default-statusline}) (local winbar nil) (local tabline [nt.os-indicator (utils.make_buflist nt.buffer-block nt.truncate-left @@ -46,4 +51,3 @@ (set vim.opt.laststatus 3) (set vim.opt.showtabline 2) (heirline.setup {: statusline : winbar : tabline : statuscolumn})) -