1
0
Fork 0

nvim: style neogit

This commit is contained in:
Daniel Kempkens 2023-12-29 20:19:42 +01:00
parent c3b4ada768
commit daa3fc51a1
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
3 changed files with 38 additions and 5 deletions

View file

@ -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 " ")

View file

@ -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)

View file

@ -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}))