summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/aliases.zsh11
-rw-r--r--lib/prompt_info_functions.zsh33
-rw-r--r--lib/rbenv.zsh2
-rw-r--r--lib/rvm.zsh8
4 files changed, 41 insertions, 13 deletions
diff --git a/lib/aliases.zsh b/lib/aliases.zsh
index b279bf855..2094f60a0 100644
--- a/lib/aliases.zsh
+++ b/lib/aliases.zsh
@@ -6,6 +6,11 @@ alias po='popd'
alias ...='cd ../..'
alias -- -='cd -'
+# Prevent headaches
+alias cp='cp -v'
+alias rm='rm -v'
+alias mv='mv -v'
+
# Super user
alias _='sudo'
alias please='sudo'
@@ -27,9 +32,9 @@ else
fi
# List direcory contents
alias lsa='ls -lah'
-alias l='ls -la'
-alias ll='ls -l'
-alias la='ls -lA'
+alias l='ls -lah'
+alias ll='ls -lh'
+alias la='ls -lAh'
alias sl=ls # often screw this up
alias afind='ack-grep -il'
diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
new file mode 100644
index 000000000..335c02a3d
--- /dev/null
+++ b/lib/prompt_info_functions.zsh
@@ -0,0 +1,33 @@
+# *_prompt_info functions for usage in your prompt
+#
+# Plugin creators, please add your *_prompt_info function to the list
+# of dummy implementations to help theme creators not receiving errors
+# without the need of implementing conditional clauses.
+#
+# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
+# git_prompt_info, bzr_prompt_info and nvm_prompt_info
+
+# 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 {
+ return 1
+}
+
+# oh-my-zsh supports an rvm prompt by default
+# get the name of the rvm ruby version
+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:=)}"
+}
+
+# use this to enable users to see their ruby version, no matter which
+# version management system they use
+function ruby_prompt_info() {
+ echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
+}
diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
deleted file mode 100644
index a8b6c323c..000000000
--- a/lib/rbenv.zsh
+++ /dev/null
@@ -1,2 +0,0 @@
-# using the rbenv plugin will override this with a real implementation
-function rbenv_prompt_info() {}
diff --git a/lib/rvm.zsh b/lib/rvm.zsh
deleted file mode 100644
index e8744e61e..000000000
--- a/lib/rvm.zsh
+++ /dev/null
@@ -1,8 +0,0 @@
-# get the name of the ruby version
-function rvm_prompt_info() {
- [ -f $HOME/.rvm/bin/rvm-prompt ] || return
- local rvm_prompt
- rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
- [[ "${rvm_prompt}x" == "x" ]] && return
- echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
-}