From a60499f933c52f55dbb9c9f2f7d99cb82c3538de Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 4 Aug 2017 12:54:19 -0500 Subject: [PATCH] [general] Miscellaneous cleanup and formatting --- init.zsh | 2 +- modules/completion/init.zsh | 6 +++--- modules/git/functions/_git-hub-browse | 4 ++-- modules/git/functions/git-hub-browse | 2 +- modules/node/init.zsh | 2 +- modules/osx/functions/mand | 2 +- modules/osx/functions/pfd | 2 +- modules/osx/functions/tab | 8 ++++---- modules/perl/init.zsh | 3 +-- modules/prompt/functions/prompt_sorin_setup | 4 ++-- modules/terminal/init.zsh | 2 +- 11 files changed, 18 insertions(+), 19 deletions(-) diff --git a/init.zsh b/init.zsh index be56566..0c90299 100644 --- a/init.zsh +++ b/init.zsh @@ -30,7 +30,7 @@ function zprezto-update { printf "to manually pull and possibly merge in changes\n" } cd -q -- "${ZPREZTODIR}" || return 7 - local orig_branch="$(git symbolic-ref HEAD 2>/dev/null | cut -d '/' -f 3)" + local orig_branch="$(git symbolic-ref HEAD 2> /dev/null | cut -d '/' -f 3)" if [[ "$orig_branch" == "master" ]]; then git fetch || return "$?" local UPSTREAM=$(git rev-parse '@{u}') diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 8c509a6..e2cc2d4 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -107,9 +107,9 @@ zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-va zstyle -a ':prezto:module:completion:*:hosts' etc-host-ignores '_etc_host_ignores' zstyle -e ':completion:*:hosts' hosts 'reply=( - ${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } - ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%(\#${_etc_host_ignores:+|${(j:|:)~_etc_host_ignores}})*} - ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} + ${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2> /dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } + ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2> /dev/null))"}%%(\#${_etc_host_ignores:+|${(j:|:)~_etc_host_ignores}})*} + ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2> /dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} )' # Don't complete uninteresting users... diff --git a/modules/git/functions/_git-hub-browse b/modules/git/functions/_git-hub-browse index 54d223f..9e6d6f0 100644 --- a/modules/git/functions/_git-hub-browse +++ b/modules/git/functions/_git-hub-browse @@ -29,7 +29,7 @@ case "$state" in remote="$words[(($CURRENT - 1))]" branches_or_tags=($( - git ls-remote --heads --tags "$remote" 2>/dev/null | cut -f2 + git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2 )) branches=(HEAD ${${(M)branches_or_tags[@]##refs/heads/?##}##refs/heads/}) @@ -39,7 +39,7 @@ case "$state" in _describe -t tag 'tags' tags && ret=0 ;; (file) - files=(${(0)"$(_call_program files git ls-files -z --exclude-standard 2>/dev/null)"}) + files=(${(0)"$(_call_program files git ls-files -z --exclude-standard 2> /dev/null)"}) _wanted file expl 'file' _multi_parts - / files && ret=0 ;; esac diff --git a/modules/git/functions/git-hub-browse b/modules/git/functions/git-hub-browse index 4e7c314..a365a5a 100644 --- a/modules/git/functions/git-hub-browse +++ b/modules/git/functions/git-hub-browse @@ -39,7 +39,7 @@ if (( $references[(i)$reference] == $#references + 1 )); then fi if [[ "$reference" == 'HEAD' ]]; then - reference="$(git rev-parse HEAD 2>/dev/null)" + reference="$(git rev-parse HEAD 2> /dev/null)" fi file="$3" diff --git a/modules/node/init.zsh b/modules/node/init.zsh index c225b2f..127dea7 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -11,7 +11,7 @@ if [[ -s "$HOME/.nvm/nvm.sh" ]]; then source "$HOME/.nvm/nvm.sh" # Load package manager installed NVM into the shell session. -elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2>/dev/null)" ]]; then +elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2> /dev/null)" ]]; then source "$(brew --prefix nvm)/nvm.sh" # Load manually installed nodenv into the shell session. diff --git a/modules/osx/functions/mand b/modules/osx/functions/mand index b8e958e..2902c76 100644 --- a/modules/osx/functions/mand +++ b/modules/osx/functions/mand @@ -8,7 +8,7 @@ function mand { if (( $# > 0 )); then zstyle -s ':prezto:module:osx:man' dash-keyword 'dashkw' || dashkw='manpages' - open "dash://$dashkw:$1" 2>/dev/null + open "dash://$dashkw:$1" 2> /dev/null if (( $? != 0 )); then print "$0: Dash is not installed" >&2 break diff --git a/modules/osx/functions/pfd b/modules/osx/functions/pfd index 4153769..264b40b 100644 --- a/modules/osx/functions/pfd +++ b/modules/osx/functions/pfd @@ -7,7 +7,7 @@ # function pfd { -osascript 2>/dev/null < /dev/null < 0 )) && command="${command}; $*" the_app=$( - osascript 2>/dev/null < /dev/null </dev/null < /dev/null </dev/null < /dev/null </dev/null < /dev/null </dev/null + editor-info 2> /dev/null prompt_preview_theme 'sorin' } diff --git a/modules/terminal/init.zsh b/modules/terminal/init.zsh index c7b22b7..2a5b9be 100644 --- a/modules/terminal/init.zsh +++ b/modules/terminal/init.zsh @@ -49,7 +49,7 @@ function _terminal-set-titles-with-command { local -A jobtexts_from_parent_shell jobtexts_from_parent_shell=(${(kv)jobtexts}) - jobs "$job_name" 2>/dev/null > >( + jobs "$job_name" 2> /dev/null > >( read index discarded # The index is already surrounded by brackets: [1]. _terminal-set-titles-with-command "${(e):-\$jobtexts_from_parent_shell$index}"