diff options
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/cd.bash | 3 | ||||
-rw-r--r-- | bash/bashrc.d/grep.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/ls.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/prompt.bash | 2 | ||||
-rw-r--r-- | bash/bashrc.d/tmux.bash | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 79e610d8..35900b7f 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -1,6 +1,6 @@ # If given two arguments to cd, replace the first with the second in $PWD, # emulating a Zsh function that I often find useful; preserves options too -function cd { +__cd() { while getopts lPe opt do local opts="$opts -$opt" @@ -12,4 +12,5 @@ function cd { builtin cd $opts "$@" fi } +alias cd='__cd' diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash index e5a568e1..ea75bd8e 100644 --- a/bash/bashrc.d/grep.bash +++ b/bash/bashrc.d/grep.bash @@ -1,5 +1,5 @@ # Function returns calculated options for grep -function __grepopts { +__grepopts() { local grepopts='-I' local grephelp=$(grep --help) echo $grephelp | grep -- --color &>/dev/null \ diff --git a/bash/bashrc.d/ls.bash b/bash/bashrc.d/ls.bash index 03150fea..5dd65b48 100644 --- a/bash/bashrc.d/ls.bash +++ b/bash/bashrc.d/ls.bash @@ -1,5 +1,5 @@ # Function returns calculated options for ls -function __lsopts { +__lsopts() { local lsopts= local lshelp=$(ls --help) echo $lshelp | grep -- --color &>/dev/null \ diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 26f9f87a..69f9bf7a 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -1,5 +1,5 @@ # Frontend to controlling prompt -function prompt { +prompt() { local ret=$? local colors=$(tput colors 2>/dev/null) local color reset branch state url root diff --git a/bash/bashrc.d/tmux.bash b/bash/bashrc.d/tmux.bash index 8d5382e9..ee47e7fc 100644 --- a/bash/bashrc.d/tmux.bash +++ b/bash/bashrc.d/tmux.bash @@ -1,5 +1,5 @@ # Attach to existing tmux session rather than create a new one if possible -function tmux { +tmux() { if [[ -n "$@" ]]; then command tmux "$@" else |