GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — dotfiles/.npm-autocomplete at master · andrei-cacio/dotfiles Expand file tree/ Copy path.npm-autocompleteMore file actions 27 lines (22 loc) · 879 Bytes / Copy path.npm-autocompleteFile metadata and controls27 lines (22 loc) · 879 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #!/usr/bin/env bash #adding this to force silly gist highlighting. REMOVE THIS # BASH standalone npm install autocomplete. Add this to ~/.bashrc file. _npm_install_completion () { local words cword if type _get_comp_words_by_ref &>/dev/null; then _get_comp_words_by_ref -n = -n @ -w words -i cword else cword="$COMP_CWORD" words=("${COMP_WORDS[@]}") fi local si="$IFS" # if your npm command includes `install` or `i ` if [[ ${words[@]} =~ 'install' ]] || [[ ${words[@]} =~ 'i ' ]]; then local cur=${COMP_WORDS[COMP_CWORD]} # supply autocomplete words from `~/.npm`, with $cur being value of current expansion like 'expre' COMPREPLY=( $( compgen -W "$(ls ~/.npm )" -- $cur ) ) fi IFS="$si" } # bind the above function to `npm` autocompletion complete -o default -F _npm_install_completion npm ## END BASH npm install autocomplete |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |