aboutsummaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2019-08-22 16:33:38 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2019-08-22 16:33:38 +0200
commit04f4a7df197ce327f36b666869a1ca2f09934e58 (patch)
tree8e40727ad893e50cecc641a46d5a26be22e33f50 /bashrc
parent5f718fe5ee476e381d2cae204405023eb935c9f5 (diff)
downloaddotfiles-04f4a7df197ce327f36b666869a1ca2f09934e58.tar.gz
dotfiles-04f4a7df197ce327f36b666869a1ca2f09934e58.zip
Tidying up
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc31
1 files changed, 11 insertions, 20 deletions
diff --git a/bashrc b/bashrc
index 0a03e7d..cd3ee78 100644
--- a/bashrc
+++ b/bashrc
@@ -31,8 +31,8 @@ alias cd..='cd ..'
# Sources the given file if it really exists.
source_maybe() {
- if [ -f $1 ]; then
- source $1
+ if [ -f "$1" ]; then
+ source "$1"
fi
}
@@ -59,27 +59,18 @@ export LESS="FSRX"
export PAGER=less
# git thingies.
-source_maybe $HOME/.gitcompletion.sh
+source_maybe "$HOME/.gitcompletion.sh"
alias gti=git
-# hg thingies.
-source_maybe $HOME/.hgcompletion.sh
-__hg_branch() {
- if [ -d .hg ]; then
- local b=`cat .hg/branch`
- echo -e "\033[0;32m@\033[1;32m$b\033[0m"
- fi
-}
-
# Setting up PS1.
-PS1='\u:\w$(__hg_branch)$(__git_ps1 "\[\033[0;32m\]@%s\[\033[0m\]\]") $ '
+PS1='\u:\w$(__git_ps1 "\[\033[0;32m\]@%s\[\033[0m\]\]") $ '
##
# Programming languages and environments.
# Rake completion
-if [ -f $HOME/.rake_completion ]; then
- complete -C $HOME/.rake_completion -o default rake
+if [ -f "$HOME/.rake_completion" ]; then
+ complete -C "$HOME/.rake_completion" -o default rake
fi
# Alias bundle exec
@@ -99,15 +90,15 @@ export PATH=$GOROOT/bin:$PATH:$GOPATH/bin
# Misc.
# The g utility. See: https://github.com/mssola/g
-source_maybe $HOME/.g.sh
-source_maybe $HOME/.gcompletion.sh
+source_maybe "$HOME/.g.sh"
+source_maybe "$HOME/.gcompletion.sh"
# Complete the `docker` command if possible.
-source_maybe $HOME/.dockercompletion.sh
+source_maybe "$HOME/.dockercompletion.sh"
# Add the `bin` dir to the path if possible. See:
# https://github.com/mssola/dotfiles.
-if [ -d $HOME/bin ]; then
+if [ -d "$HOME/bin" ]; then
export PATH=$HOME/bin:$PATH
fi
@@ -120,7 +111,7 @@ alias ag='ag --nocolor --path-to-ignore ~/.agignore'
alias random_string="cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1"
# Cargo environment.
-source_maybe $HOME/.cargo/env
+source_maybe "$HOME/.cargo/env"
# SUSE
export SALT_DIR="$HOME/Projects/kubic-project/salt"