aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/zsh-fast-syntax-highlighting/_fast-theme
diff options
context:
space:
mode:
Diffstat (limited to '.config/shell/zsh-fast-syntax-highlighting/_fast-theme')
-rw-r--r--.config/shell/zsh-fast-syntax-highlighting/_fast-theme33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/shell/zsh-fast-syntax-highlighting/_fast-theme b/.config/shell/zsh-fast-syntax-highlighting/_fast-theme
new file mode 100644
index 0000000..4c88062
--- /dev/null
+++ b/.config/shell/zsh-fast-syntax-highlighting/_fast-theme
@@ -0,0 +1,33 @@
+#compdef fast-theme
+
+#
+# Copyright (c) 2018 Sebastian Gniazdowski
+#
+# Completion for theme-switching function, fast-theme,
+# part of zdharma/fast-syntax-highlighting.
+#
+
+integer ret=1
+local -a arguments
+
+arguments=(
+ {-h,--help}'[display help text]'
+ {-l,--list}'[list available themes]'
+ {-r,--reset}'[unset any theme (revert to default highlighting)]'
+ {-R,--ov-reset}'[unset overlay, use styles only from main-theme (requires restart)]'
+ {-q,--quiet}'[no default messages]'
+ {-s,--show}'[get and display the theme currently being set]'
+ {-v,--verbose}'[more messages during operation]'
+ {-t,--test}'[test theme after setting it (show example code)]'
+ {-p,--palette}'[just print all 256 colors and exit (useful when creating a theme)]'
+ {-w,--workdir}'[cd into $FAST_WORK_DIR (if not set, then into the plugin directory)]'
+)
+
+typeset -a themes
+themes=( "$FAST_WORK_DIR"/themes/*.ini(:t:r) )
+
+_wanted themes expl "Themes" \
+ compadd "$@" -a - themes && ret=0
+_arguments -s $arguments && ret=0
+
+return $ret