Skip to content

Commit 828a94b

Browse files
authored
feat: add highlight groups (#235)
1 parent 704dfe3 commit 828a94b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

doc/neo-tree.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ NeoTreeIndentMarker The style of indentation markers (guides). By default,
695695
NeoTreeExpander Used for collapsed/expanded icons.
696696
NeoTreeNormal |hl-Normal| override in Neo-tree window.
697697
NeoTreeNormalNC |hi-NormalNC| override in Neo-tree window.
698+
NeoTreeStatusLine |hl-StatusLine| override in Neo-tree window.
699+
NeoTreeStatusLineNC |hl-StatusLineNC| override in Neo-tree window.
700+
NeoTreeVertSplit |hl-VertSplit| override in Neo-tree window.
698701
NeoTreeRootName The name of the root node.
699702
NeoTreeSymbolicLinkTarget Symbolic link target.
700703
NeoTreeTitleBar Used for the title bar of pop-ups, when the border-style

lua/neo-tree/setup/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local log = require("neo-tree.log")
66
local file_nesting = require("neo-tree.sources.common.file-nesting")
77
local highlights = require("neo-tree.ui.highlights")
88
local manager = require("neo-tree.sources.manager")
9-
local netrw = require("neo-tree.setup.netrw")
9+
local netrw = require("neo-tree.setup.netrw")
1010

1111
-- If you add a new source, you need to add it to the sources table.
1212
-- Each source should have a defaults module that contains the default values
@@ -69,7 +69,7 @@ M.buffer_enter_event = function()
6969
vim.cmd([[
7070
setlocal cursorline
7171
setlocal nowrap
72-
setlocal winhighlight=Normal:NeoTreeNormal,NormalNC:NeoTreeNormalNC,CursorLine:NeoTreeCursorLine,FloatBorder:NeoTreeFloatBorder
72+
setlocal winhighlight=Normal:NeoTreeNormal,NormalNC:NeoTreeNormalNC,CursorLine:NeoTreeCursorLine,FloatBorder:NeoTreeFloatBorder,StatusLine:NeoTreeStatusLine,StatusLineNC:NeoTreeStatusLineNC,VertSplit:NeoTreeVertSplit
7373
setlocal nolist nospell nonumber norelativenumber
7474
]])
7575
events.fire_event(events.NEO_TREE_BUFFER_ENTER)
@@ -94,7 +94,6 @@ M.buffer_enter_event = function()
9494
end
9595
last_buffer_enter_filetype = vim.bo.filetype
9696

97-
9897
-- there is nothing more we want to do with floating windows
9998
if utils.is_floating() then
10099
return

lua/neo-tree/ui/highlights.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ M.INDENT_MARKER = "NeoTreeIndentMarker"
2929
M.MODIFIED = "NeoTreeModified"
3030
M.NORMAL = "NeoTreeNormal"
3131
M.NORMALNC = "NeoTreeNormalNC"
32+
M.STATUS_LINE = "NeoTreeStatusLine"
33+
M.STATUS_LINE_NC = "NeoTreeStatusLineNC"
34+
M.VERTSPLIT = "NeoTreeVertSplit"
3235
M.ROOT_NAME = "NeoTreeRootName"
3336
M.SYMBOLIC_LINK_TARGET = "NeoTreeSymbolicLinkTarget"
3437
M.TITLE_BAR = "NeoTreeTitleBar"
@@ -184,6 +187,11 @@ M.setup = function()
184187
local normal_hl = create_highlight_group(M.NORMAL, { "Normal" })
185188
local normalnc_hl = create_highlight_group(M.NORMALNC, { "NormalNC", M.NORMAL })
186189

190+
create_highlight_group(M.STATUS_LINE, { "StatusLine" })
191+
create_highlight_group(M.STATUS_LINE_NC, { "StatusLineNC" })
192+
193+
create_highlight_group(M.VERTSPLIT, { "VertSplit" })
194+
187195
local float_border_hl = create_highlight_group(
188196
M.FLOAT_BORDER,
189197
{ "FloatBorder" },

0 commit comments

Comments
 (0)