_frontend-search.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. 'compassdoc: 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. 'npmjs: Search in NPMJS website'
  35. )
  36. _arguments -C \
  37. '1: :->first_arg' \
  38. '2: :->second_arg' && ret=0
  39. case $state in
  40. first_arg)
  41. _describe -t frontend_points "Warp points" frontend_points && ret=0
  42. _describe -t commands "Commands" commands && ret=0
  43. ;;
  44. second_arg)
  45. case $words[2] in
  46. jquery)
  47. _describe -t points "Warp points" frontend_points && ret=0
  48. ;;
  49. mdn)
  50. _describe -t points "Warp points" frontend_points && ret=0
  51. ;;
  52. compassdoc)
  53. _describe -t points "Warp points" frontend_points && ret=0
  54. ;;
  55. html5please)
  56. _describe -t points "Warp points" frontend_points && ret=0
  57. ;;
  58. caniuse)
  59. _describe -t points "Warp points" frontend_points && ret=0
  60. ;;
  61. aurajs)
  62. _describe -t points "Warp points" frontend_points && ret=0
  63. ;;
  64. dartlang)
  65. _describe -t points "Warp points" frontend_points && ret=0
  66. ;;
  67. lodash)
  68. _describe -t points "Warp points" frontend_points && ret=0
  69. ;;
  70. qunit)
  71. _describe -t points "Warp points" frontend_points && ret=0
  72. ;;
  73. fontello)
  74. _describe -t points "Warp points" frontend_points && ret=0
  75. ;;
  76. bootsnipp)
  77. _describe -t points "Warp points" frontend_points && ret=0
  78. ;;
  79. cssflow)
  80. _describe -t points "Warp points" frontend_points && ret=0
  81. ;;
  82. codepen)
  83. _describe -t points "Warp points" frontend_points && ret=0
  84. ;;
  85. unheap)
  86. _describe -t points "Warp points" frontend_points && ret=0
  87. ;;
  88. bem)
  89. _describe -t points "Warp points" frontend_points && ret=0
  90. ;;
  91. smacss)
  92. _describe -t points "Warp points" frontend_points && ret=0
  93. ;;
  94. angularjs)
  95. _describe -t points "Warp points" frontend_points && ret=0
  96. ;;
  97. reactjs)
  98. _describe -t points "Warp points" frontend_points && ret=0
  99. ;;
  100. emberjs)
  101. _describe -t points "Warp points" frontend_points && ret=0
  102. ;;
  103. stackoverflow)
  104. _describe -t points "Warp points" frontend_points && ret=0
  105. ;;
  106. npmjs)
  107. _describe -t points "Warp points" frontend_points && ret=0
  108. ;;
  109. esac
  110. ;;
  111. esac
  112. return $ret
  113. }
  114. _frontend "$@"
  115. # Local Variables:
  116. # mode: Shell-Script
  117. # sh-indentation: 2
  118. # indent-tabs-mode: nil
  119. # sh-basic-offset: 2
  120. # End:
  121. # vim: ft=zsh sw=2 ts=2 et