aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
diff options
context:
space:
mode:
authorBlista Kanjo2023-08-02 22:22:54 -0400
committerBlista Kanjo2023-08-02 22:22:54 -0400
commit7e72e9ac87fc1c052726202f84a1e16466e06ad4 (patch)
treeeb35478ad142aa154d80d85aa583500c5eab65b8 /.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
parent08e564a8e1d4c13ad4c046ca4bfc9ca7f72373bd (diff)
feat: `zsh` fast-syntax-highlighting plugin
Diffstat (limited to '.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch')
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch22
1 files changed, 22 insertions, 0 deletions
diff --git a/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
new file mode 100644
index 0000000..9687db3
--- /dev/null
+++ b/.config/shell/zsh-fast-syntax-highlighting/:chroma/-autorandr.ch
@@ -0,0 +1,22 @@
+# vim:ft=zsh:et:sw=4
+(( next_word = 2 | 8192 ))
+[[ "$__arg_type" = 3 ]] && return 2
+
+local __first_call="$1" __wrd="$2" __start_pos="$3" __end_pos="$4"
+
+if (( __first_call )) || [[ "$__wrd" = -* ]]; then
+ return 1
+else
+ if (( in_redirection > 0 || this_word & 128 )) || [[ $__wrd == "<<<" ]]; then
+ return 1
+ fi
+ if [[ -d "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr/$__wrd" ]] then
+ (( __start=__start_pos-${#PREBUFFER}, __end=__end_pos-${#PREBUFFER}, __start >= 0 )) \
+ && reply+=("$__start $__end ${FAST_HIGHLIGHT_STYLES[${FAST_THEME_NAME}correct-subtle]}")
+ fi
+fi
+
+(( this_word = next_word ))
+_start_pos=$_end_pos
+
+return 0