_frontend-search.sh 4.0 KB

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