# .bashrc is for configuring the interactive Bash usage, like Bash aliases, setting favorite editor, setting Bash prompt, etc.
+# Set favorites
+export SHELL='bash'
+export EDITOR='vim'
+export VISUAL='vim'
+export PAGER='less -eFRX'
+export MANPAGER="less -eFRX"
+
# If not running interactively, don't do anything
[[ -z "$PS1" ]] && return
if [[ -z "$MSYS2_PS1" ]]; then
PS1='${debian_chroot:+($debian_chroot)}' # debian
else
- PS1='\[\033]0;$PWD\007\]' # terminal title = PWD
+ PS1='\[\033]0;$PWD\007\]' # terminal title in msys2
cd ~
GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
fi
fi
-
PS1="$PS1"'\[\033[01;32m\]' # change color
PS1="$PS1"'\u@\h' # user@host
PS1="$PS1"'\[\033[00m\]' # change color
# Whenever displaying the prompt, write the previous line to disk
export PROMPT_COMMAND="history -a;"
-# Set favorites
-export SHELL='bash'
-export EDITOR='vim'
-export VISUAL='vim'
-export PAGER='less -eFRX'
-export MANPAGER="less -eFRX"
-export BROWSER='lynx -vikeys -use_mouse'
-
# Larger bash history
export HISTFILESIZE=10000;
export HISTSIZE=5000;
export HISTCONTROL=ignoreboth:erasedups
export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help";
+# colored GCC warnings and errors
+export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+
+# Highlight section titles in manual pages
+export LESS_TERMCAP_md="${yellow}";
+
# Load aliases, functions, etc
for file in ${HOME}/.config/bash/*; do
-alias open='xdg-open &>/dev/null'
alias sl=ls
alias la='ls -A'
alias ll='ls -l'
fi
alias ls="ls $colorflag $lsflags"
+
+# grep
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
-alias h='history'
-
-if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi
# Shortcuts
+alias less='less -erFRX' # raw control characters, don't clear the screen after quitting
+alias info='info --vi-keys'
+alias open='xdg-open &>/dev/null'
+alias h='history'
alias dit='git --git-dir=$HOME/.dit --work-tree=$HOME'
alias ag='ag --path-to-ignore=$HOME/.ignore --skip-vcs-ignores'
alias rg='rg --path-separator="//"'
-
-# Easier navigation: .., ..., ...., ....., ~ and -
-alias ..="cd .."
-alias ...="cd ../.."
-alias ....="cd ../../.."
-alias .....="cd ../../../.."
-alias ~="cd ~" # `cd` is probably faster to type though
-alias -- -="cd -"
-alias cd=cd_func
-alias -- --="cd --"
-alias -- -0="cd -0"
-alias -- -1="cd -1"
-alias -- -2="cd -2"
-alias -- -3="cd -3"
-alias -- -4="cd -4"
-alias -- -5="cd -5"
-alias -- -6="cd -6"
-alias -- -7="cd -7"
-alias -- -8="cd -8"
-alias -- -9="cd -9"
-
# Secure settings
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias md='mkdir -p'
alias rd='rmdir'
-alias mkdate='mkdir "$(date +'%Y%m%d')"'
-alias fstab='sudo vim /etc/fstab'
+
if [ ! -x "$(which tree 2>/dev/null)" ]
then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
fi
-alias info='info --vi-keys'
-#alias less='less -rX' # raw control characters, don't clear the screen after quitting
# Enable aliases to be sudo'ed
alias sudo='sudo '
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
+# make date folders
+alias mkdate='mkdir "$(date +'%Y%m%d')"'
# Add tab completion for many Bash commands
[ -f /etc/bash_completion ] && . /etc/bash_completion
-# Enable tab completion for `g` by marking it as an alias for `git`
+# Enable tab completion for `dit` by marking it as an alias for `git`
if type _git &> /dev/null; then
- complete -o default -o nospace -F _git g;
+ complete -o default -o nospace -F _git dit;
fi;
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
-XDG_DESKTOP_DIR="$HOME"
+XDG_DESKTOP_DIR="$HOME/cloud"
XDG_DOWNLOAD_DIR="$HOME/Download"
XDG_TEMPLATES_DIR="$HOME/cloud/Templates"
XDG_PUBLICSHARE_DIR="$HOME/cloud/PublicShare"
PATH="$HOME/bin:$PATH"
fi
-# colored GCC warnings and errors
-export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-
-# Highlight section titles in manual pages
-export LESS_TERMCAP_md="${yellow}";
-
-# Always enable colored `grep` output
-#export GREP_OPTIONS="--color=auto";
-
-# Set up syntax highlighting for 'less' (requires source-highlight package)
-# See http://www.gnu.org/software/src-highlite/source-highlight.html
-# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
-export LESS=-eFRX
-
-
# Prefer US language with SI units (Danish)
export LANG="en_DK.UTF-8"
. ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR
fi
-#export XDG_CONFIG_HOME = $HOME/.config/
-#export XDG_DATA_HOME = $HOME/.local/share/
-#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/
+#export XDG_CONFIG_HOME=$HOME/.config/
+#export XDG_DATA_HOME=$HOME/.local/share/
+#export XDG_DATA_DIRS=/usr/local/share/:/usr/share/
export QT_STYLE_OVERRIDE=adwaita-dark
export USERNAME=$LOGNAME
export HOSTNAME=`hostname`
-echo Welcome $USERNAME. You are on Server: $HOSTNAME !!!
+echo Welcome $USERNAME @ $HOSTNAME !
################################# DEBIAN LOCAL SETTINGS ##### TO BE MOVED ####
#export JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
-################################# WINDOWS LOCAL SETTINGS ##### TO BE MOVED ####
-export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3
-export GRADLE_USER_HOME=$HOME/.cache/gradle
-#export GTEST_DIR='c:/googletest-release-1.7.0'
-#export GTEST_DIR='c:/googletest-release-1.8.0'
-#export CPPUNITDIR='c:/cppunit-1.12.1'
-#export CPPUNITDIR='c:/cppunit-1.13.2'
-export CPPUNITDIR_2013='c:/programs/cppunit_2013'
-export RTEGENERATEVSCODE=1
-