From 90cd3d025c9cbb29cca372a75aa4210d85347b9d Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 7 Jun 2017 10:37:15 +0200 Subject: bash: updated bashrc to its current status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- bashrc | 104 +++++++++++++++++++++++++++-------------------------------------- 1 file changed, 43 insertions(+), 61 deletions(-) diff --git a/bashrc b/bashrc index bd7754e..89fe9f6 100644 --- a/bashrc +++ b/bashrc @@ -1,8 +1,13 @@ +## +# Locale. -# Set LC_ALL always to UTF-8 +# Set LC_ALL always to UTF-8. export LC_ALL=en_US.UTF-8 -# beautifying ls command +## +# Basics. + +# Beautifying ls command. alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' @@ -11,11 +16,29 @@ alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --colo alias ..='cd ..' alias cd..='cd ..' -# Set vim as the default editor +## +# Utility functions. + +# Sources the given file if it really exists. +source_maybe() { + if [ -f $1 ]; then + source $1 + fi +} + +## +# Editors & terminals. + +# Set vim as the default editor. export EDITOR=vim export VISUAL=vim alias vi=vim +# Shortcut for GNU Emacs. +em() { + emacsclient -c -a "" -t "$1" +} + # Alias xdg-open to just xo alias xo=xdg-open @@ -26,13 +49,6 @@ TERM=xterm-256color export LESS="FSRX" export PAGER=less -# Sources the given file if it really exists. -source_maybe() { - if [ -f $1 ]; then - source $1 - fi -} - # git thingies. source_maybe $HOME/.gitcompletion.sh alias gti=git @@ -49,32 +65,14 @@ __hg_branch() { # Setting up PS1. PS1='\u:\w$(__hg_branch)$(__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 fi -# KDE Paths -export KDEDIR=$HOME/.kde -export KDEDIRS=$KDEDIR -export KF5_SRC=$HOME/Projects/kde/kf5 - -# Export the standard paths to include KDE -export PATH=/usr/local/heroku/bin:$PATH:$KDEDIR/bin -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$KDEDIR/lib -export XDG_DATA_DIRS=$XDG_DATA_DIRS:$KDEDIR/share - -# Export the CMake paths so it searches for KDE in the right places -export CMAKE_PREFIX_PATH=$KDEDIR:$CMAKE_PREFIX_PATH -export CMAKE_LIBRARY_PATH=$KDEDIR/lib:$CMAKE_LIBRARY_PATH -export CMAKE_INCLUDE_PATH=$KDEDIR/include:$CMAKE_INCLUDE_PATH - -# Function to whip the KDevelop cache -alias wduchain='rm -rf $HOME/.cache/kdevduchain/*' - -# Let's change to KF5 mode. -alias frameworks='source $KF5_SRC/kf5.sh; eval `dbus-launch`; kdeinit5; echo' - # Alias bundle exec alias be='bundle exec' @@ -83,41 +81,18 @@ export CC=/usr/bin/gcc export CXX=/usr/bin/g++ # Go things -export GOROOT_BOOTSTRAP=/opt/go1.4 +export GOROOT_BOOTSTRAP=/opt/go export GOROOT=$HOME/Projects/go export GOPATH=$HOME/Projects/golang export PATH=$GOROOT/bin:$PATH:$GOPATH/bin -# The Review utility. See: https://github.com/mssola/review -export PATH=/opt/review:$PATH -source_maybe $HOME/.review_completion.sh +## +# Misc. # The g utility. See: https://github.com/mssola/g source_maybe $HOME/.g.sh source_maybe $HOME/.gcompletion.sh -# The td utility. See: https://github.com/mssola/td -td() { - # If we are editing, pick the default layout. Otherwise, just execute the - # given arguments. - if [ -z "$1" ]; then - args="--file /root/.td/auto.txt" - else - args="$@" - fi - - docker run -it \ - -v $HOME/.td:/root/.td \ - -v $HOME/.vimrc:/root/.vimrc:ro \ - -v $HOME/.vim:/root/.vim:ro \ - -e TERM=xterm-256color \ - -e EDITOR=vim \ - --rm \ - --detach-keys "ctrl-a,a" \ - mssola/td:latest "$args" -} -source_maybe $HOME/.tdcompletion.sh - # Complete the `docker` command if possible. source_maybe $HOME/.dockercompletion.sh @@ -127,10 +102,17 @@ if [ -d $HOME/bin ]; then export PATH=$HOME/bin:$PATH fi -# Finally get RVM straight. -[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" -export PATH="$PATH:$HOME/.rvm/bin" - # Some other misc. alias. alias iosc="osc -A https://api.suse.de" alias ag='ag --nocolor --path-to-agignore ~/.agignore' + +# Cargo environment. +source_maybe $HOME/.cargo/env + +# SUSE +export SALT_DIR="~/Projects/kubic-project/salt" +export SALT_PATH="~/Projects/kubic-project/salt" + +# Finally RVM requires it to be the last thing on the PATH for whatever reason. +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" +export PATH="$PATH:$HOME/.rvm/bin" -- cgit v1.2.3