Commit c12c31621beb43d044e486bc18b2249aad27b51f
1 parent
a911fd5846
Exists in
master
and in
2 other branches
environment.sh
Showing 3 changed files with 24 additions and 6 deletions Inline Diff
dotfiles/environment.sh
| File was created | 1 | #@IgnoreInspection AddShebang | |
| 2 | |||
| 3 | # git: | ||
| 4 | export GIT_AUTHOR_NAME="mj" | ||
| 5 | export GIT_AUTHOR_EMAIL="mj@str8.biz" | ||
| 6 | export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME | ||
| 7 | export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL | ||
| 8 |
templates/bashrc.sh
| 1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
| 2 | # If not running interactively, don't do anything | 2 | # If not running interactively, don't do anything |
| 3 | case $- in | 3 | case $- in |
| 4 | *i*) ;; | 4 | *i*) ;; |
| 5 | *) return;; | 5 | *) return;; |
| 6 | esac | 6 | esac |
| 7 | 7 | ||
| 8 | ######################## | 8 | ######################## |
| 9 | # ******************** # | 9 | # ******************** # |
| 10 | # * * # | 10 | # * * # |
| 11 | # * COMPLETION * # | 11 | # * COMPLETION * # |
| 12 | # * * # | 12 | # * * # |
| 13 | # ******************** # | 13 | # ******************** # |
| 14 | ######################## | 14 | ######################## |
| 15 | 15 | ||
| 16 | # enable bash completion in interactive shells | 16 | # enable bash completion in interactive shells |
| 17 | if [ -f /etc/bash_completion ]; then | 17 | if [ -f /etc/bash_completion ]; then |
| 18 | . /etc/bash_completion | 18 | . /etc/bash_completion |
| 19 | fi | 19 | fi |
| 20 | 20 | ||
| 21 | # if the command-not-found package is installed, use it | 21 | # if the command-not-found package is installed, use it |
| 22 | if [ -x /usr/lib/command-not-found ]; then | 22 | if [ -x /usr/lib/command-not-found ]; then |
| 23 | function command_not_found_handle { | 23 | function command_not_found_handle { |
| 24 | # check because c-n-f could've been removed in the meantime | 24 | # check because c-n-f could've been removed in the meantime |
| 25 | if [ -x /usr/lib/command-not-found ]; then | 25 | if [ -x /usr/lib/command-not-found ]; then |
| 26 | /usr/bin/python /usr/lib/command-not-found -- $1 | 26 | /usr/bin/python /usr/lib/command-not-found -- $1 |
| 27 | return $? | 27 | return $? |
| 28 | else | 28 | else |
| 29 | return 127 | 29 | return 127 |
| 30 | fi | 30 | fi |
| 31 | } | 31 | } |
| 32 | fi | 32 | fi |
| 33 | 33 | ||
| 34 | ######################## | 34 | ######################## |
| 35 | # ******************** # | 35 | # ******************** # |
| 36 | # * * # | 36 | # * * # |
| 37 | # * HISTORY * # | 37 | # * HISTORY * # |
| 38 | # * * # | 38 | # * * # |
| 39 | # ******************** # | 39 | # ******************** # |
| 40 | ######################## | 40 | ######################## |
| 41 | 41 | ||
| 42 | # Eternal bash history. | 42 | # Eternal bash history. |
| 43 | # --------------------- | 43 | # --------------------- |
| 44 | export HISTFILESIZE= | 44 | export HISTFILESIZE= |
| 45 | export HISTSIZE= | 45 | export HISTSIZE= |
| 46 | export HISTTIMEFORMAT="[%F %T] " | 46 | export HISTTIMEFORMAT="[%F %T] " |
| 47 | # Change the file location | 47 | # Change the file location |
| 48 | export HISTFILE=~/.config/new_bash_history | 48 | export HISTFILE=~/.config/new_bash_history |
| 49 | # Force prompt to write history after every command | 49 | # Force prompt to write history after every command |
| 50 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" | 50 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" |
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | # check the window size after each command | 53 | # check the window size after each command |
| 54 | shopt -s checkwinsize~/.bash_aliases | 54 | shopt -s checkwinsize~/.bash_aliases |
| 55 | 55 | ||
| 56 | # If set, the pattern "**" used in a pathname expansion context will | 56 | # If set, the pattern "**" used in a pathname expansion context will |
| 57 | # match all files and zero or more directories and subdirectories. | 57 | # match all files and zero or more directories and subdirectories. |
| 58 | #shopt -s globstar | 58 | #shopt -s globstar |
| 59 | 59 | ||
| 60 | # set variable identifying the chroot you work in (used in the prompt below) | 60 | # set variable identifying the chroot you work in (used in the prompt below) |
| 61 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | 61 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then |
| 62 | debian_chroot=$(cat /etc/debian_chroot) | 62 | debian_chroot=$(cat /etc/debian_chroot) |
| 63 | fi | 63 | fi |
| 64 | 64 | ||
| 65 | # set a fancy prompt | 65 | # set a fancy prompt |
| 66 | case "$TERM" in | 66 | case "$TERM" in |
| 67 | xterm-color) color_prompt=yes;; | 67 | xterm-color) color_prompt=yes;; |
| 68 | esac | 68 | esac |
| 69 | 69 | ||
| 70 | # colored prompt | 70 | # colored prompt |
| 71 | force_color_prompt=yes | 71 | force_color_prompt=yes |
| 72 | 72 | ||
| 73 | if [ -n "$force_color_prompt" ]; then | 73 | if [ -n "$force_color_prompt" ]; then |
| 74 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | 74 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then |
| 75 | # We have color support; assume it's compliant with Ecma-48 | 75 | # We have color support; assume it's compliant with Ecma-48 |
| 76 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | 76 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such |
| 77 | # a case would tend to support setf rather than setaf.) | 77 | # a case would tend to support setf rather than setaf.) |
| 78 | color_prompt=yes | 78 | color_prompt=yes |
| 79 | else | 79 | else |
| 80 | color_prompt= | 80 | color_prompt= |
| 81 | fi | 81 | fi |
| 82 | fi | 82 | fi |
| 83 | 83 | ||
| 84 | if [ "$color_prompt" = yes ]; then | 84 | if [ "$color_prompt" = yes ]; then |
| 85 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | 85 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
| 86 | else | 86 | else |
| 87 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | 87 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
| 88 | fi | 88 | fi |
| 89 | #unset color_prompt force_color_prompt | 89 | #unset color_prompt force_color_prompt |
| 90 | 90 | ||
| 91 | # enable color support of ls and also add handy aliases | 91 | # enable color support of ls and also add handy aliases |
| 92 | if [ -x /usr/bin/dircolors ]; then | 92 | if [ -x /usr/bin/dircolors ]; then |
| 93 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | 93 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" |
| 94 | alias ls='ls --color=auto' | 94 | alias ls='ls --color=auto' |
| 95 | alias dir='dir --color=auto' | 95 | alias dir='dir --color=auto' |
| 96 | alias vdir='vdir --color=auto' | 96 | alias vdir='vdir --color=auto' |
| 97 | 97 | ||
| 98 | alias grep='grep --color=auto' | 98 | alias grep='grep --color=auto' |
| 99 | alias fgrep='fgrep --color=auto' | 99 | alias fgrep='fgrep --color=auto' |
| 100 | alias egrep='egrep --color=auto' | 100 | alias egrep='egrep --color=auto' |
| 101 | fi | 101 | fi |
| 102 | 102 | ||
| 103 | # Environment | ||
| 104 | if [ -f $ZCFG/dotfiles/environment.sh ]; then | ||
| 105 | . $ZCFG/dotfiles/environment.sh | ||
| 106 | fi | ||
| 103 | 107 | ||
| 104 | # Alias definitions | ||
| 105 | 108 | ||
| 106 | if [ -f ~/.config/zsh-config/templates/bash_aliases ]; then | 109 | # Alias definitions |
| 107 | . ~/.config/zsh-config/templates/bash_aliases | 110 | if [ -f $ZCFG/templates/bash_aliases ]; then |
| 111 | . $ZCFG/templates/bash_aliases | ||
| 108 | fi | 112 | fi |
templates/zshrc.sh
| 1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
| 2 | # ENVIRONMENT: | 2 | # ENVIRONMENT: |
| 3 | export GJ_DEVENV=local_aptproxy | 3 | export GJ_ENV=local_aptproxy |
| 4 | 4 | ||
| 5 | export ZCFG=~/.config/zsh-config | 5 | export ZCFG=~/.config/zsh-config |
| 6 | # Path to your oh-my-zsh installation. | 6 | # Path to your oh-my-zsh installation. |
| 7 | export ZSH=$ZCFG/packages/oh-my-zsh | 7 | export ZSH=$ZCFG/packages/oh-my-zsh |
| 8 | 8 | ||
| 9 | export LANG=en_US.UTF-8 | 9 | export LANG=en_US.UTF-8 |
| 10 | 10 | ||
| 11 | # Compilation flags | 11 | # Compilation flags |
| 12 | export ARCHFLAGS="-arch x86_64" | 12 | export ARCHFLAGS="-arch x86_64" |
| 13 | 13 | ||
| 14 | # Themes are in (...)/oh-my-zsh/themes/ or "random" | 14 | # Themes are in (...)/oh-my-zsh/themes/ or "random" |
| 15 | ZSH_THEME="muse" | 15 | ZSH_THEME="muse" |
| 16 | 16 | ||
| 17 | CASE_SENSITIVE="true" | 17 | CASE_SENSITIVE="true" |
| 18 | DISABLE_AUTO_UPDATE="true" | 18 | DISABLE_AUTO_UPDATE="true" |
| 19 | #DISABLE_AUTO_TITLE="true" | 19 | #DISABLE_AUTO_TITLE="true" |
| 20 | ENABLE_CORRECTION="false" | 20 | ENABLE_CORRECTION="false" |
| 21 | COMPLETION_WAITING_DOTS="true" | 21 | COMPLETION_WAITING_DOTS="true" |
| 22 | DISABLE_UNTRACKED_FILES_DIRTY="true" | 22 | DISABLE_UNTRACKED_FILES_DIRTY="true" |
| 23 | HIST_STAMPS="dd.mm.yyyy" | 23 | HIST_STAMPS="dd.mm.yyyy" |
| 24 | ZSH_CUSTOM=ZCFG/custom | 24 | ZSH_CUSTOM=ZCFG/custom |
| 25 | 25 | ||
| 26 | plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload | 26 | plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload |
| 27 | #pip python virtualenv virtualenvwrapper | 27 | #pip python virtualenv virtualenvwrapper |
| 28 | #meteor node npm | 28 | #meteor node npm |
| 29 | ) | 29 | ) |
| 30 | 30 | ||
| 31 | # User configuration | 31 | # User configuration |
| 32 | export PATH=$HOME/bin:/usr/local/bin:$PATH | 32 | export PATH=$HOME/bin:/usr/local/bin:$PATH |
| 33 | # export MANPATH="/usr/local/man:$MANPATH" | 33 | # export MANPATH="/usr/local/man:$MANPATH" |
| 34 | 34 | ||
| 35 | # Environment | ||
| 36 | if [ -f $ZCFG/dotfiles/environment.sh ]; then | ||
| 37 | . $ZCFG/dotfiles/environment.sh | ||
| 38 | fi | ||
| 39 | |||
| 35 | export HISTFILESIZE= | 40 | export HISTFILESIZE= |
| 36 | export HISTSIZE= | 41 | export HISTSIZE= |
| 37 | export HISTFILE=~/.history | 42 | export HISTFILE=~/.history |
| 38 | 43 | ||
| 39 | source $ZSH/oh-my-zsh.sh | 44 | source $ZSH/oh-my-zsh.sh |
| 40 | 45 | ||
| 41 | if [ -f ~/.config/zsh-config/templates/bash_aliases.sh ]; then | 46 | |
| 42 | . ~/.config/zsh-config/templates/bash_aliases.sh | 47 | # Aliases |
| 48 | if [ -f $ZCFG/templates/bash_aliases.sh ]; then | ||
| 49 | . $ZCFG/templates/bash_aliases.sh | ||
| 43 | fi | 50 | fi |
| 44 | 51 |