Make ls aliases optional

This commit is contained in:
Jean Blanchard
2015-03-06 09:38:15 +00:00
parent 5ea1e69405
commit 349896b0cf
3 changed files with 66 additions and 61 deletions

View File

@@ -114,3 +114,5 @@ git_commit_all_with_ci_skip_keys="\C-xv" # CTRL+x, v (Appends [ci skip] to c
shell_command_wrapping_enabled="true"
# Here you can tweak the list of wrapped commands.
scmb_wrapped_shell_commands="vim emacs gedit cat rm cp mv ln cd"
# Add numbered shortcuts to output of ls -l, just like 'git status'
shell_ls_aliases_enabled="true"

View File

@@ -108,8 +108,9 @@ fi
# Function wrapper around 'll'
# Adds numbered shortcuts to output of ls -l, just like 'git status'
unalias ll > /dev/null 2>&1; unset -f ll > /dev/null 2>&1
function ls_with_file_shortcuts {
if [ "$shell_ls_aliases_enabled" = "true" ]; then
unalias ll > /dev/null 2>&1; unset -f ll > /dev/null 2>&1
function ls_with_file_shortcuts {
local ll_output
if [ "$_ls_bsd" != "BSD" ]; then
ll_output="$(\ls -lhv --group-directories-first --color "$@")"
@@ -185,8 +186,9 @@ EOF
# Turn off shwordsplit unless it was on previously
if [[ $shell == "zsh" ]] && [ -z "$SHWORDSPLIT_ON" ]; then unsetopt shwordsplit; fi
}
}
# Setup aliases
alias ll="exec_scmb_expand_args ls_with_file_shortcuts"
alias la="ll -A"
# Setup aliases
alias ll="exec_scmb_expand_args ls_with_file_shortcuts"
alias la="ll -A"
fi

View File

@@ -26,6 +26,7 @@ source "$scmbDir/lib/scm_breeze.sh"
oneTimeSetUp() {
export shell_command_wrapping_enabled="true"
export scmb_wrapped_shell_commands="not_found cat rm cp mv ln cd sed"
export shell_ls_aliases_enabled="true"
alias rvm="test" # Ensure tests run if RVM isn't loaded but $HOME/.rvm is present