summaryrefslogtreecommitdiff
path: root/lib/misc.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/misc.zsh')
-rw-r--r--lib/misc.zsh39
1 files changed, 26 insertions, 13 deletions
diff --git a/lib/misc.zsh b/lib/misc.zsh
index 0b7cb2696..61571afc9 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -1,22 +1,35 @@
-## smart urls
-autoload -U url-quote-magic
-zle -N self-insert url-quote-magic
+autoload -Uz is-at-least
+
+# *-magic is known buggy in some versions; disable if so
+if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
+ for d in $fpath; do
+ if [[ -e "$d/url-quote-magic" ]]; then
+ if is-at-least 5.1; then
+ autoload -Uz bracketed-paste-magic
+ zle -N bracketed-paste bracketed-paste-magic
+ fi
+ autoload -Uz url-quote-magic
+ zle -N self-insert url-quote-magic
+ break
+ fi
+ done
+fi
## jobs
setopt long_list_jobs
-## pager
-export PAGER="less"
-export LESS="-R"
+env_default 'PAGER' 'less'
+env_default 'LESS' '-R'
## super user alias
-alias _='sudo'
-alias please='sudo'
+alias _='sudo '
## more intelligent acking for ubuntu users
-alias afind='ack-grep -il'
-
-# only define LC_CTYPE if undefined
-if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
- export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
+if which ack-grep &> /dev/null; then
+ alias afind='ack-grep -il'
+else
+ alias afind='ack -il'
fi
+
+# recognize comments
+setopt interactivecomments