From 83f4deecfea0fcb052b23215efa32f1a8f7f8b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Mon, 24 Mar 2025 16:39:20 +0800 Subject: [PATCH] feat: new `symlink_target` to style the target of symbolic links (#2522) --- yazi-config/preset/theme-dark.toml | 3 +++ yazi-config/preset/theme-light.toml | 3 +++ yazi-config/src/theme/theme.rs | 3 +++ yazi-plugin/preset/components/entity.lua | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/yazi-config/preset/theme-dark.toml b/yazi-config/preset/theme-dark.toml index 01efac6c..997c3de1 100644 --- a/yazi-config/preset/theme-dark.toml +++ b/yazi-config/preset/theme-dark.toml @@ -29,6 +29,9 @@ preview_hovered = { underline = true } find_keyword = { fg = "yellow", bold = true, italic = true, underline = true } find_position = { fg = "magenta", bg = "reset", bold = true, italic = true } +# Symlink +symlink_target = { italic = true } + # Marker marker_copied = { fg = "lightgreen", bg = "lightgreen" } marker_cut = { fg = "lightred", bg = "lightred" } diff --git a/yazi-config/preset/theme-light.toml b/yazi-config/preset/theme-light.toml index dc34a636..4e2bf4a2 100644 --- a/yazi-config/preset/theme-light.toml +++ b/yazi-config/preset/theme-light.toml @@ -29,6 +29,9 @@ preview_hovered = { underline = true } find_keyword = { fg = "yellow", bold = true, italic = true, underline = true } find_position = { fg = "magenta", bg = "reset", bold = true, italic = true } +# Symlink +symlink_target = { italic = true } + # Marker marker_copied = { fg = "lightgreen", bg = "lightgreen" } marker_cut = { fg = "lightred", bg = "lightred" } diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 940bd5cb..1f66539a 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -44,6 +44,9 @@ pub struct Mgr { find_keyword: Style, find_position: Style, + // Symlink + symlink_target: Style, + // Marker marker_copied: Style, marker_cut: Style, diff --git a/yazi-plugin/preset/components/entity.lua b/yazi-plugin/preset/components/entity.lua index 1fff8d52..5f59f8f5 100644 --- a/yazi-plugin/preset/components/entity.lua +++ b/yazi-plugin/preset/components/entity.lua @@ -73,7 +73,7 @@ function Entity:symlink() end local to = self._file.link_to - return to and ui.Span(string.format(" -> %s", to)):italic() or "" + return to and ui.Span(string.format(" -> %s", to)):style(th.mgr.symlink_target) or "" end function Entity:redraw()