From d47a7221924b4fa0b1859913d505f50a6c276da1 Mon Sep 17 00:00:00 2001 From: Marco De Bortoli Date: Tue, 1 Nov 2016 15:49:50 +1100 Subject: [PATCH 1/3] PHP suffix alias should be removed PHP can be executed as CLI script but due to the automated attempt to add browser support to that extension such ability is prevented in certain circumstances. --- plugins/common-aliases/common-aliases.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 128db6e5f..0908c8a38 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -54,7 +54,7 @@ alias mv='mv -i' # depends on the SUFFIX :) if is-at-least 4.2.0; then # open browser on urls - _browser_fts=(htm html de org net com at cx nl se dk dk php) + _browser_fts=(htm html de org net com at cx nl se dk dk) for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex) From fc4e0cd7ba47bc87fe707f2bac8edb3461cfdd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 2 Nov 2016 11:02:58 +0100 Subject: [PATCH 2/3] common-aliases: check if $BROWSER is defined on browser aliases --- plugins/common-aliases/common-aliases.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 0908c8a38..e888ff076 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -54,8 +54,10 @@ alias mv='mv -i' # depends on the SUFFIX :) if is-at-least 4.2.0; then # open browser on urls - _browser_fts=(htm html de org net com at cx nl se dk dk) - for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done + if [[ -n "$BROWSER" ]]; then + _browser_fts=(htm html de org net com at cx nl se dk dk) + for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done + fi _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex) for ft in $_editor_fts ; do alias -s $ft=$EDITOR ; done From cb26c2f6145ab36a2bb3b3d5392959cf741f2608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 2 Nov 2016 11:03:47 +0100 Subject: [PATCH 3/3] common-aliases: minor style fixes --- plugins/common-aliases/common-aliases.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index e888ff076..d47b20e40 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -56,17 +56,17 @@ if is-at-least 4.2.0; then # open browser on urls if [[ -n "$BROWSER" ]]; then _browser_fts=(htm html de org net com at cx nl se dk dk) - for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done + for ft in $_browser_fts; do alias -s $ft=$BROWSER; done fi _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex) - for ft in $_editor_fts ; do alias -s $ft=$EDITOR ; done + for ft in $_editor_fts; do alias -s $ft=$EDITOR; done _image_fts=(jpg jpeg png gif mng tiff tif xpm) - for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done + for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done _media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm) - for ft in $_media_fts ; do alias -s $ft=mplayer ; done + for ft in $_media_fts; do alias -s $ft=mplayer; done #read documents alias -s pdf=acroread