diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | Completion/Unix/Command/_npm | 20 | ||||
-rw-r--r-- | Doc/Zsh/contrib.yo | 6 | ||||
-rw-r--r-- | Functions/Zle/.distfiles | 1 | ||||
-rw-r--r-- | Functions/Zle/expand-absolute-path | 19 |
5 files changed, 40 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog index e36b1b770..201f27399 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-02-28 Peter Stephenson <p.stephenson@samsung.com> + + * users/18531 plus doc etc.: Doc/Zsh/contrib.yo, + Functions/Zle/.distfiles, Functions/Zle/expand-absolute-path: + new expand-absolute-path ZLE widget. + 2014-02-26 Peter Stephenson <p.w.stephenson@ntlworld.com> * Jun T: Completion/Base/Core/_description, @@ -19,6 +25,9 @@ 2014-02-24 Peter Stephenson <p.stephenson@samsung.com> + * Hong Xu: 32492: Completion/Unix/Command/_npm: fix outdated + completion. + * Sebastien Alaiwan: 32462: Completion/Unix/Command/_bzr: improve completion with directory path. diff --git a/Completion/Unix/Command/_npm b/Completion/Unix/Command/_npm index 24b536188..f5493a321 100644 --- a/Completion/Unix/Command/_npm +++ b/Completion/Unix/Command/_npm @@ -1,19 +1,9 @@ #compdef npm -# Node Package Manager 0.3.15 completion, letting npm do all the completion work +# Node Package Manager completion, letting npm do all the completion work -_npm() { - compadd -- $(_npm_complete $words) -} +if type npm > /dev/null; then + eval "$(npm completion)" -# We want to show all errors of any substance, but never the "npm (not )ok" one. -# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) -_npm_complete() { - local ask_npm - ask_npm=(npm completion --color false --loglevel error -- $@) - { _call_program npm $ask_npm 2>&1 >&3 \ - | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ - } 3>&1 -} - -_npm "$@" + _npm_completion "$@" +fi diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index bb294e5a5..11d596df8 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1873,6 +1873,12 @@ Edit the command line using your visual editor, as in tt(ksh). example(bindkey -M vicmd v edit-command-line) ) +tindex(expand-absolute-path) +item(tt(expand-absolute-path))( +Expand the file name under the cursor to an absolute path, resolving +symbolic links. Where possible, the initial path segment is turned +into a named directory or reference to a user's home directory. +) tindex(history-beginning-search-backward-end) tindex(history-beginning-search-forward-end) item(tt(history-search-end))( diff --git a/Functions/Zle/.distfiles b/Functions/Zle/.distfiles index 256044fa5..5b301b62b 100644 --- a/Functions/Zle/.distfiles +++ b/Functions/Zle/.distfiles @@ -10,6 +10,7 @@ delete-whole-word-match down-case-word-match down-line-or-beginning-search edit-command-line +expand-absolute-path forward-word-match history-beginning-search-menu history-pattern-search diff --git a/Functions/Zle/expand-absolute-path b/Functions/Zle/expand-absolute-path new file mode 100644 index 000000000..b85757600 --- /dev/null +++ b/Functions/Zle/expand-absolute-path @@ -0,0 +1,19 @@ +# expand-absolute-path +# This is a ZLE widget to expand the absolute path to a file, +# using directory naming to shorten the path where possible. + +emulate -L zsh +setopt extendedglob cbases + +autoload -Uz modify-current-argument + +if (( ! ${+functions[glob-expand-absolute-path]} )); then + glob-expand-absolute-path() { + local -a files + files=(${~1}(N:A)) + (( ${#files} )) || return + REPLY=${(D)files[1]} + } +fi + +modify-current-argument glob-expand-absolute-path |