summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/directories.zsh10
-rw-r--r--lib/misc.zsh6
-rw-r--r--lib/prompt_info_functions.zsh19
-rw-r--r--lib/theme-and-appearance.zsh2
4 files changed, 28 insertions, 9 deletions
diff --git a/lib/directories.zsh b/lib/directories.zsh
index 14064b86f..cf87bd7e4 100644
--- a/lib/directories.zsh
+++ b/lib/directories.zsh
@@ -21,7 +21,15 @@ alias 9='cd -9'
alias md='mkdir -p'
alias rd=rmdir
-alias d='dirs -v | head -10'
+
+function d () {
+ if [[ -n $1 ]]; then
+ dirs "$@"
+ else
+ dirs -v | head -10
+ fi
+}
+compdef _dirs d
# List directory contents
alias lsa='ls -lah'
diff --git a/lib/misc.zsh b/lib/misc.zsh
index b30822b50..40ffa479d 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -1,7 +1,7 @@
-## Load smart urls if available
-# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
autoload -Uz is-at-least
-if [[ $ZSH_VERSION != 5.1.1 ]]; then
+
+# *-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
diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
index 1d5c23e41..5069c4b21 100644
--- a/lib/prompt_info_functions.zsh
+++ b/lib/prompt_info_functions.zsh
@@ -10,9 +10,15 @@
# Dummy implementations that return false to prevent command_not_found
# errors with themes, that implement these functions
# Real implementations will be used when the respective plugins are loaded
-function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
- rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
- virtualenv_prompt_info jenv_prompt_info {
+function chruby_prompt_info \
+ rbenv_prompt_info \
+ hg_prompt_info \
+ pyenv_prompt_info \
+ svn_prompt_info \
+ vi_mode_prompt_info \
+ virtualenv_prompt_info \
+ jenv_prompt_info \
+{
return 1
}
@@ -22,10 +28,13 @@ function rvm_prompt_info() {
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
- [[ "${rvm_prompt}x" == "x" ]] && return 1
- echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
+ [[ -z "${rvm_prompt}" ]] && return 1
+ echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt}${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
}
+ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
+
+
# use this to enable users to see their ruby version, no matter which
# version management system they use
function ruby_prompt_info() {
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 6b6528273..5016d86ca 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -50,3 +50,5 @@ ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of th
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
+ZSH_THEME_RUBY_PROMPT_PREFIX="("
+ZSH_THEME_RUBY_PROMPT_SUFFIX=")"