1
0
Fork 0
mirror of https://github.com/zdharma-continuum/fast-syntax-highlighting.git synced 2025-02-25 01:29:29 +01:00
fast-syntax-highlighting/_fast-theme
2019-11-03 06:23:55 +01:00

33 lines
1,020 B
Text

#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