_frontend-search.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #compdef frontend
  2. zstyle ':completion:*:descriptions' format '%B%d%b'
  3. zstyle ':completion::complete:frontend:*:commands' group-name commands
  4. zstyle ':completion::complete:frontend:*:frontend_points' group-name frontend_points
  5. zstyle ':completion::complete:frontend::' list-grouped
  6. zmodload zsh/mapfile
  7. function _frontend() {
  8. local CONFIG=$HOME/.frontend-search
  9. local ret=1
  10. local -a commands
  11. local -a frontend_points
  12. frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
  13. commands=(
  14. 'jquery: Search in jQuery website'
  15. 'mdn: Search in MDN website'
  16. 'compass: Search in COMPASS website'
  17. 'html5please: Search in HTML5 Please website'
  18. 'caniuse: Search in Can I Use website'
  19. 'aurajs: Search in AuraJs website'
  20. 'dartlang: Search in Dart website'
  21. 'lodash: Search in Lo-Dash website'
  22. 'qunit: Search in Qunit website'
  23. 'fontello: Search in fontello website'
  24. 'bootsnipp: Search in bootsnipp website'
  25. 'cssflow: Search in cssflow website'
  26. 'codepen: Search in codepen website'
  27. 'unheap: Search in unheap website'
  28. 'bem: Search in BEM website'
  29. 'smacss: Search in SMACSS website'
  30. 'angularjs: Search in Angular website'
  31. 'reactjs: Search in React website'
  32. 'emberjs: Search in Ember website'
  33. 'stackoverflow: Search in StackOverflow website'
  34. )
  35. _arguments -C \
  36. '1: :->first_arg' \
  37. '2: :->second_arg' && ret=0
  38. case $state in
  39. first_arg)
  40. _describe -t frontend_points "Warp points" frontend_points && ret=0
  41. _describe -t commands "Commands" commands && ret=0
  42. ;;
  43. second_arg)
  44. case $words[2] in
  45. jquery)
  46. _describe -t points "Warp points" frontend_points && ret=0
  47. ;;
  48. mdn)
  49. _describe -t points "Warp points" frontend_points && ret=0
  50. ;;
  51. compass)
  52. _describe -t points "Warp points" frontend_points && ret=0
  53. ;;
  54. html5please)
  55. _describe -t points "Warp points" frontend_points && ret=0
  56. ;;
  57. caniuse)
  58. _describe -t points "Warp points" frontend_points && ret=0
  59. ;;
  60. aurajs)
  61. _describe -t points "Warp points" frontend_points && ret=0
  62. ;;
  63. dartlang)
  64. _describe -t points "Warp points" frontend_points && ret=0
  65. ;;
  66. lodash)
  67. _describe -t points "Warp points" frontend_points && ret=0
  68. ;;
  69. qunit)
  70. _describe -t points "Warp points" frontend_points && ret=0
  71. ;;
  72. fontello)
  73. _describe -t points "Warp points" frontend_points && ret=0
  74. ;;
  75. bootsnipp)
  76. _describe -t points "Warp points" frontend_points && ret=0
  77. ;;
  78. cssflow)
  79. _describe -t points "Warp points" frontend_points && ret=0
  80. ;;
  81. codepen)
  82. _describe -t points "Warp points" frontend_points && ret=0
  83. ;;
  84. unheap)
  85. _describe -t points "Warp points" frontend_points && ret=0
  86. ;;
  87. bem)
  88. _describe -t points "Warp points" frontend_points && ret=0
  89. ;;
  90. smacss)
  91. _describe -t points "Warp points" frontend_points && ret=0
  92. ;;
  93. angularjs)
  94. _describe -t points "Warp points" frontend_points && ret=0
  95. ;;
  96. reactjs)
  97. _describe -t points "Warp points" frontend_points && ret=0
  98. ;;
  99. emberjs)
  100. _describe -t points "Warp points" frontend_points && ret=0
  101. ;;
  102. stackoverflow)
  103. _describe -t points "Warp points" frontend_points && ret=0
  104. ;;
  105. esac
  106. ;;
  107. esac
  108. return $ret
  109. }
  110. _frontend "$@"
  111. # Local Variables:
  112. # mode: Shell-Script
  113. # sh-indentation: 2
  114. # indent-tabs-mode: nil
  115. # sh-basic-offset: 2
  116. # End:
  117. # vim: ft=zsh sw=2 ts=2 et