You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

  1. #compdef fast-theme
  2. #
  3. # Copyright (c) 2018 Sebastian Gniazdowski
  4. #
  5. # Completion for theme-switching function, fast-theme,
  6. # part of zdharma/fast-syntax-highlighting.
  7. #
  8. integer ret=1
  9. local -a arguments
  10. arguments=(
  11. {-h,--help}'[display help text]'
  12. {-l,--list}'[list available themes]'
  13. {-r,--reset}'[unset any theme (revert to default highlighting)]'
  14. {-R,--ov-reset}'[unset overlay, use styles only from main-theme (requires restart)]'
  15. {-q,--quiet}'[no default messages]'
  16. {-s,--show}'[get and display the theme currently being set]'
  17. {-v,--verbose}'[more messages during operation]'
  18. {-t,--test}'[test theme after setting it (show example code)]'
  19. {-p,--palette}'[just print all 256 colors and exit (useful when creating a theme)]'
  20. {-w,--workdir}'[cd into $FAST_WORK_DIR (if not set, then into the plugin directory)]'
  21. )
  22. typeset -a themes
  23. themes=( "$FAST_WORK_DIR"/themes/*.ini(:t:r) )
  24. if [[ -d ${XDG_CONFIG_HOME:-$HOME/.config}/fsh ]] {
  25. typeset -a themes2
  26. themes2=( "${XDG_CONFIG_HOME:-$HOME/.config}"/fsh/*.ini(:t:r) )
  27. themes+=( XDG:${^themes2[@]} )
  28. }
  29. _wanted themes expl "Themes" \
  30. compadd "$@" -a - themes && ret=0
  31. _arguments -s $arguments && ret=0
  32. return $ret