From: Jannik ZANDER Date: Sun, 19 Jun 2016 20:47:07 +0000 (+0200) Subject: Move bash files X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=9cac7a7a81471eff1c3ac7ba8739daaa457b567b;p=dotfiles.git Move bash files --- diff --git a/.bashrc b/.bashrc index 7873146..0afaa65 100644 --- a/.bashrc +++ b/.bashrc @@ -4,7 +4,7 @@ [[ -z "$PS1" ]] && return # Load settings -for file in ${HOME}/.config/bash/rc/*; do +for file in ${HOME}/.config/bash/*; do [ -f "$file" ] && . "$file"; done; diff --git a/.config/bash/aliases b/.config/bash/aliases new file mode 100644 index 0000000..1713e04 --- /dev/null +++ b/.config/bash/aliases @@ -0,0 +1,107 @@ +alias sl=ls +alias la='ls -A' +alias ll='ls -Al' +alias l1='ls -1' +alias l.='ls -d .[a-z]*' + +lsflags="-hF" +# Detect which `ls` flavor is in use +if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` + eval $(dircolors -b $HOME/.dir_colors) + colorflag="--color=auto" + lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" +else # OS X `ls` + export CLICOLOR=1 + colorflag="-G" +fi + +alias ls="ls $colorflag $lsflags" +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' + +if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi + +# Shortcuts +alias g='git' +alias h='history' +alias j='jobs' +alias v='vim' +alias q='exit' +alias c='clear' +alias cls='clear' + +alias edit="$EDITOR" +alias pager="$PAGER" + +# 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')"' + +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 ' +alias _="sudo" + +# Get week number +alias week='date +%V' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +# Reload the shell (i.e. invoke as a login shell) +alias reload="exec $SHELL -l" + +# alias bashhere='chere -il -t mintty -s bash' +alias newterm='mintty /bin/env CHERE_INVOKING=1 /bin/bash -l &' +alias gtypist='gtypist -wi' +alias startxwin='run /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock -unixkill"' +alias sumatra='startSumatra.sh' +alias lynx='lynx -use_mouse -vikeys' +alias startvnc='vncserver -geometry 1870x980 -depth 24' +alias startvnc4='vnc4server -geometry 1870x980 -depth 24' +#alias python='/usr/local/bin/python3' +alias git_local='git --git-dir=.git_local' +alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' + +# alias for genibus +alias gf='gf.py' +alias com1='GENIsnus_1_lin_pr_tgm.exe COM1 9600 log 5' +alias com2='GENIsnus_1_lin_pr_tgm.exe COM2 9600 log 5' +alias com3='GENIsnus_1_lin_pr_tgm.exe COM3 9600 log 5' +alias com4='GENIsnus_1_lin_pr_tgm.exe COM4 9600 log 5' +alias com5='GENIsnus_1_lin_pr_tgm.exe COM5 9600 log 5' +alias com6='GENIsnus_1_lin_pr_tgm.exe COM6 9600 log 5' +alias com7='GENIsnus_1_lin_pr_tgm.exe COM7 9600 log 5' +alias com8='GENIsnus_1_lin_pr_tgm.exe COM8 9600 log 5' diff --git a/.config/bash/bashrc_local b/.config/bash/bashrc_local new file mode 100644 index 0000000..2f5faba --- /dev/null +++ b/.config/bash/bashrc_local @@ -0,0 +1,12 @@ +alias gvim="C:/programs/Vim/vim74/gvim.exe" + +if [ -d "${HOME}/.fzf" ] ; then + PATH="${HOME}/.fzf:${PATH}" +fi + + +export GOPATH="$HOME/gopath" +#export GOROOT=/mingw64 +export GOROOT=/mingw64/lib/go +eval "$(ssh-agent -s)" +ssh-add.exe ~/.ssh/github diff --git a/.config/bash/completion b/.config/bash/completion new file mode 100644 index 0000000..b1460ac --- /dev/null +++ b/.config/bash/completion @@ -0,0 +1,15 @@ +# Add tab completion for many Bash commands + +[ -f /etc/bash_completion ] && . /etc/bash_completion + +[ -f "${HOME}/.cache/bash/git-completion.bash" ] && . "${HOME}/.cache/bash/git-completion.bash" + +# Enable tab completion for `g` by marking it as an alias for `git` +if type _git &> /dev/null; then + complete -o default -o nospace -F _git g; +fi; + +# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards +if [ -e "$HOME/.ssh/config" ]; then + complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; +fi; diff --git a/.config/bash/functions b/.config/bash/functions new file mode 100644 index 0000000..cabbbc0 --- /dev/null +++ b/.config/bash/functions @@ -0,0 +1,80 @@ +# Create a new directory and enter it +function mkd() { + mkdir -p "$@" && cd "$@"; +} + +# `v` with no arguments opens the current directory in Vim, otherwise opens the +# given location +function v() { + if [ $# -eq 0 ]; then + vim .; + else + vim "$@"; + fi; +} + +# `o` with no arguments opens the current directory, otherwise opens the given +# location +function o() { + if [ $# -eq 0 ]; then + open .; + else + open "$@"; + fi; +} + +# This function defines a 'cd' replacement function capable of keeping, +# displaying and accessing history of visited directories, up to 10 entries. +# To use it, uncomment it, source this file and try 'cd --'. + +cd_func() +{ + local x2 the_new_dir adir index + local -i cnt + + if [[ $1 == "--" ]]; then + dirs -v + return 0 + fi + + the_new_dir=$1 + [[ -z $1 ]] && the_new_dir=$HOME + + if [[ ${the_new_dir:0:1} == '-' ]]; then + # + # Extract dir N from dirs + index=${the_new_dir:1} + [[ -z $index ]] && index=1 + adir=$(dirs +$index) + [[ -z $adir ]] && return 1 + the_new_dir=$adir + fi + + # + # '~' has to be substituted by ${HOME} + [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}" + + # + # Now change to the new dir and add to the top of the stack + pushd "${the_new_dir}" > /dev/null + [[ $? -ne 0 ]] && return 1 + the_new_dir=$(pwd) + + # + # Trim down everything beyond 11th entry + popd -n +11 2>/dev/null 1>/dev/null + + # + # Remove any other occurence of this dir, skipping the top of the stack + for ((cnt=1; cnt <= 10; cnt++)); do + x2=$(dirs +${cnt} 2>/dev/null) + [[ $? -ne 0 ]] && return 0 + [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}" + if [[ "${x2}" == "${the_new_dir}" ]]; then + popd -n +$cnt 2>/dev/null 1>/dev/null + cnt=cnt-1 + fi + done + + return 0 +} diff --git a/.config/bash/options b/.config/bash/options new file mode 100644 index 0000000..284a673 --- /dev/null +++ b/.config/bash/options @@ -0,0 +1,20 @@ +# Case-insensitive globbing (used in pathname expansion) +shopt -s nocaseglob; + +# Append to the Bash history file, rather than overwriting it +shopt -s histappend; + +# Autocorrect typos in path names when using `cd` +shopt -s cdspell; + +# Enable some Bash 4 features when possible: +# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` +# * Recursive globbing, e.g. `echo **/*.txt` +for option in autocd globstar; do + shopt -s "$option" 2> /dev/null; +done; + +# Don't use ^D to exit +set -o ignoreeof +set -o vi + diff --git a/.config/bash/prompt.bash b/.config/bash/prompt.bash new file mode 100644 index 0000000..38c2e0e --- /dev/null +++ b/.config/bash/prompt.bash @@ -0,0 +1,111 @@ +#!/bin/bash + +# bash_prompt + +# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) +# Color ref: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim +# More tips: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html + +if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then + export TERM='gnome-256color'; +elif infocmp xterm-256color >/dev/null 2>&1; then + export TERM='xterm-256color'; +fi; + +if [ -f "${HOME}/.cache/bash/git-prompt.sh" ]; then + . "${HOME}/.cache/bash/git-prompt.sh" + + # Enabling any of these options will slow down the prompt + export GIT_PS1_SHOWDIRTYSTATE='y' + export GIT_PS1_SHOWSTASHSTATE='y' + export GIT_PS1_SHOWUNTRACKEDFILES='y' + export GIT_PS1_DESCRIBE_STYLE='contains' + export GIT_PS1_SHOWUPSTREAM='auto' +fi + +# Solarized colors +# (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) +set_prompts() +{ + if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then + bold=$(tput bold) + reset=$(tput sgr0) + + black=$(tput setaf 0) + blue=$(tput setaf 33) + cyan=$(tput setaf 37) + green=$(tput setaf 64) + orange=$(tput setaf 166) + purple=$(tput setaf 125) + red=$(tput setaf 124) + violet=$(tput setaf 61) + white=$(tput setaf 15) + yellow=$(tput setaf 136) + else + bold="" + reset="\e[0m" + + black="\e[1;30m" + blue="\e[1;34m" + cyan="\e[1;36m" + green="\e[1;32m" + orange="\e[1;33m" + purple="\e[1;35m" + red="\e[1;31m" + violet="\e[1;35m" + white="\e[1;37m" + yellow="\e[1;33m" + fi + + # build the prompt + fg="$white" + + # logged in as root + if [[ "$USER" == "root" ]]; then + userStyle="$bold$red" + else + userStyle="$orange" + fi + + # connected via ssh + if [[ "$SSH_TTY" ]]; then + hostStyle="$bold$red" + else + hostStyle="$yellow" + fi + + # Set the terminal title to the current working directory. + PS1="\[\033]0;\w\007\]" + + if [[ "$TERM" == *color ]]; then + PS1+=$'\r' # carriage return + PS1+="\[$userStyle\]\u" # username + PS1+="\[$reset$fg\] at " + PS1+="\[$hostStyle\]\h" # host + PS1+="\[$reset$fg\] in " + PS1+="\[$green\]\w" # working directory + # PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details + PS1+="\$(__git_ps1 '\[${fg}\] on \[${cyan}\]%s')"; # on branch + PS1+=$'\n' # newline + PS1+="\[$reset$fg\]\$ \[$reset\]" # $ (and reset color) + + PS2="\[${yellow}\]→ " # `→` + PS2+="\[${reset}\]" # reset color + else # no colors + PS1+=$'\r' # carriage return + PS1+="\u at \h in \w on \$(__git_ps1 %s)" + PS1+=$'\n''\$ ' # newline and $ + + PS2="→ " + fi + + export PS1 PS2 +} + + +set_prompts +unset set_prompts + +# Whenever displaying the prompt, write the previous line to disk +export PROMPT_COMMAND="history -a"; + diff --git a/.config/bash/rc/aliases b/.config/bash/rc/aliases deleted file mode 100644 index 1713e04..0000000 --- a/.config/bash/rc/aliases +++ /dev/null @@ -1,107 +0,0 @@ -alias sl=ls -alias la='ls -A' -alias ll='ls -Al' -alias l1='ls -1' -alias l.='ls -d .[a-z]*' - -lsflags="-hF" -# Detect which `ls` flavor is in use -if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` - eval $(dircolors -b $HOME/.dir_colors) - colorflag="--color=auto" - lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" -else # OS X `ls` - export CLICOLOR=1 - colorflag="-G" -fi - -alias ls="ls $colorflag $lsflags" -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' - -if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi - -# Shortcuts -alias g='git' -alias h='history' -alias j='jobs' -alias v='vim' -alias q='exit' -alias c='clear' -alias cls='clear' - -alias edit="$EDITOR" -alias pager="$PAGER" - -# 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')"' - -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 ' -alias _="sudo" - -# Get week number -alias week='date +%V' - -# Stopwatch -alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - -# Reload the shell (i.e. invoke as a login shell) -alias reload="exec $SHELL -l" - -# alias bashhere='chere -il -t mintty -s bash' -alias newterm='mintty /bin/env CHERE_INVOKING=1 /bin/bash -l &' -alias gtypist='gtypist -wi' -alias startxwin='run /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock -unixkill"' -alias sumatra='startSumatra.sh' -alias lynx='lynx -use_mouse -vikeys' -alias startvnc='vncserver -geometry 1870x980 -depth 24' -alias startvnc4='vnc4server -geometry 1870x980 -depth 24' -#alias python='/usr/local/bin/python3' -alias git_local='git --git-dir=.git_local' -alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' - -# alias for genibus -alias gf='gf.py' -alias com1='GENIsnus_1_lin_pr_tgm.exe COM1 9600 log 5' -alias com2='GENIsnus_1_lin_pr_tgm.exe COM2 9600 log 5' -alias com3='GENIsnus_1_lin_pr_tgm.exe COM3 9600 log 5' -alias com4='GENIsnus_1_lin_pr_tgm.exe COM4 9600 log 5' -alias com5='GENIsnus_1_lin_pr_tgm.exe COM5 9600 log 5' -alias com6='GENIsnus_1_lin_pr_tgm.exe COM6 9600 log 5' -alias com7='GENIsnus_1_lin_pr_tgm.exe COM7 9600 log 5' -alias com8='GENIsnus_1_lin_pr_tgm.exe COM8 9600 log 5' diff --git a/.config/bash/rc/completion b/.config/bash/rc/completion deleted file mode 100644 index b1460ac..0000000 --- a/.config/bash/rc/completion +++ /dev/null @@ -1,15 +0,0 @@ -# Add tab completion for many Bash commands - -[ -f /etc/bash_completion ] && . /etc/bash_completion - -[ -f "${HOME}/.cache/bash/git-completion.bash" ] && . "${HOME}/.cache/bash/git-completion.bash" - -# Enable tab completion for `g` by marking it as an alias for `git` -if type _git &> /dev/null; then - complete -o default -o nospace -F _git g; -fi; - -# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -if [ -e "$HOME/.ssh/config" ]; then - complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; -fi; diff --git a/.config/bash/rc/functions b/.config/bash/rc/functions deleted file mode 100644 index cabbbc0..0000000 --- a/.config/bash/rc/functions +++ /dev/null @@ -1,80 +0,0 @@ -# Create a new directory and enter it -function mkd() { - mkdir -p "$@" && cd "$@"; -} - -# `v` with no arguments opens the current directory in Vim, otherwise opens the -# given location -function v() { - if [ $# -eq 0 ]; then - vim .; - else - vim "$@"; - fi; -} - -# `o` with no arguments opens the current directory, otherwise opens the given -# location -function o() { - if [ $# -eq 0 ]; then - open .; - else - open "$@"; - fi; -} - -# This function defines a 'cd' replacement function capable of keeping, -# displaying and accessing history of visited directories, up to 10 entries. -# To use it, uncomment it, source this file and try 'cd --'. - -cd_func() -{ - local x2 the_new_dir adir index - local -i cnt - - if [[ $1 == "--" ]]; then - dirs -v - return 0 - fi - - the_new_dir=$1 - [[ -z $1 ]] && the_new_dir=$HOME - - if [[ ${the_new_dir:0:1} == '-' ]]; then - # - # Extract dir N from dirs - index=${the_new_dir:1} - [[ -z $index ]] && index=1 - adir=$(dirs +$index) - [[ -z $adir ]] && return 1 - the_new_dir=$adir - fi - - # - # '~' has to be substituted by ${HOME} - [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}" - - # - # Now change to the new dir and add to the top of the stack - pushd "${the_new_dir}" > /dev/null - [[ $? -ne 0 ]] && return 1 - the_new_dir=$(pwd) - - # - # Trim down everything beyond 11th entry - popd -n +11 2>/dev/null 1>/dev/null - - # - # Remove any other occurence of this dir, skipping the top of the stack - for ((cnt=1; cnt <= 10; cnt++)); do - x2=$(dirs +${cnt} 2>/dev/null) - [[ $? -ne 0 ]] && return 0 - [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}" - if [[ "${x2}" == "${the_new_dir}" ]]; then - popd -n +$cnt 2>/dev/null 1>/dev/null - cnt=cnt-1 - fi - done - - return 0 -} diff --git a/.config/bash/rc/options b/.config/bash/rc/options deleted file mode 100644 index 284a673..0000000 --- a/.config/bash/rc/options +++ /dev/null @@ -1,20 +0,0 @@ -# Case-insensitive globbing (used in pathname expansion) -shopt -s nocaseglob; - -# Append to the Bash history file, rather than overwriting it -shopt -s histappend; - -# Autocorrect typos in path names when using `cd` -shopt -s cdspell; - -# Enable some Bash 4 features when possible: -# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` -# * Recursive globbing, e.g. `echo **/*.txt` -for option in autocd globstar; do - shopt -s "$option" 2> /dev/null; -done; - -# Don't use ^D to exit -set -o ignoreeof -set -o vi - diff --git a/.config/bash/rc/prompt.bash b/.config/bash/rc/prompt.bash deleted file mode 100644 index 38c2e0e..0000000 --- a/.config/bash/rc/prompt.bash +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -# bash_prompt - -# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) -# Color ref: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim -# More tips: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html - -if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then - export TERM='gnome-256color'; -elif infocmp xterm-256color >/dev/null 2>&1; then - export TERM='xterm-256color'; -fi; - -if [ -f "${HOME}/.cache/bash/git-prompt.sh" ]; then - . "${HOME}/.cache/bash/git-prompt.sh" - - # Enabling any of these options will slow down the prompt - export GIT_PS1_SHOWDIRTYSTATE='y' - export GIT_PS1_SHOWSTASHSTATE='y' - export GIT_PS1_SHOWUNTRACKEDFILES='y' - export GIT_PS1_DESCRIBE_STYLE='contains' - export GIT_PS1_SHOWUPSTREAM='auto' -fi - -# Solarized colors -# (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) -set_prompts() -{ - if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then - bold=$(tput bold) - reset=$(tput sgr0) - - black=$(tput setaf 0) - blue=$(tput setaf 33) - cyan=$(tput setaf 37) - green=$(tput setaf 64) - orange=$(tput setaf 166) - purple=$(tput setaf 125) - red=$(tput setaf 124) - violet=$(tput setaf 61) - white=$(tput setaf 15) - yellow=$(tput setaf 136) - else - bold="" - reset="\e[0m" - - black="\e[1;30m" - blue="\e[1;34m" - cyan="\e[1;36m" - green="\e[1;32m" - orange="\e[1;33m" - purple="\e[1;35m" - red="\e[1;31m" - violet="\e[1;35m" - white="\e[1;37m" - yellow="\e[1;33m" - fi - - # build the prompt - fg="$white" - - # logged in as root - if [[ "$USER" == "root" ]]; then - userStyle="$bold$red" - else - userStyle="$orange" - fi - - # connected via ssh - if [[ "$SSH_TTY" ]]; then - hostStyle="$bold$red" - else - hostStyle="$yellow" - fi - - # Set the terminal title to the current working directory. - PS1="\[\033]0;\w\007\]" - - if [[ "$TERM" == *color ]]; then - PS1+=$'\r' # carriage return - PS1+="\[$userStyle\]\u" # username - PS1+="\[$reset$fg\] at " - PS1+="\[$hostStyle\]\h" # host - PS1+="\[$reset$fg\] in " - PS1+="\[$green\]\w" # working directory - # PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details - PS1+="\$(__git_ps1 '\[${fg}\] on \[${cyan}\]%s')"; # on branch - PS1+=$'\n' # newline - PS1+="\[$reset$fg\]\$ \[$reset\]" # $ (and reset color) - - PS2="\[${yellow}\]→ " # `→` - PS2+="\[${reset}\]" # reset color - else # no colors - PS1+=$'\r' # carriage return - PS1+="\u at \h in \w on \$(__git_ps1 %s)" - PS1+=$'\n''\$ ' # newline and $ - - PS2="→ " - fi - - export PS1 PS2 -} - - -set_prompts -unset set_prompts - -# Whenever displaying the prompt, write the previous line to disk -export PROMPT_COMMAND="history -a"; - diff --git a/.config/bash/rc/solarized b/.config/bash/rc/solarized deleted file mode 100644 index 180196d..0000000 --- a/.config/bash/rc/solarized +++ /dev/null @@ -1,23 +0,0 @@ -[[ "$OSTYPE" == *darwin* ]] && return; - -echo -ne '\eP\e]10;#839496\a' # Foreground -> base0 -echo -ne '\eP\e]11;#002B36\a' # Background -> base03 - -echo -ne '\eP\e]12;#DC322F\a' # Cursor -> red - -echo -ne '\eP\e]4;0;#073642\a' # black -> Base02 -echo -ne '\eP\e]4;8;#002B36\a' # bold black -> Base03 -echo -ne '\eP\e]4;1;#DC322F\a' # red -> red -echo -ne '\eP\e]4;9;#CB4B16\a' # bold red -> orange -echo -ne '\eP\e]4;2;#859900\a' # green -> green -echo -ne '\eP\e]4;10;#586E75\a' # bold green -> base01 * -echo -ne '\eP\e]4;3;#B58900\a' # yellow -> yellow -echo -ne '\eP\e]4;11;#657B83\a' # bold yellow -> base00 * -echo -ne '\eP\e]4;4;#268BD2\a' # blue -> blue -echo -ne '\eP\e]4;12;#839496\a' # bold blue -> base0 * -echo -ne '\eP\e]4;5;#D33682\a' # magenta -> magenta -echo -ne '\eP\e]4;13;#6C71C4\a' # bold magenta -> violet -echo -ne '\eP\e]4;6;#2AA198\a' # cyan -> cyan -echo -ne '\eP\e]4;14;#93A1A1\a' # bold cyan -> base1 * -echo -ne '\eP\e]4;7;#EEE8D5\a' # white -> Base2 -echo -ne '\eP\e]4;15;#FDF6E3\a' # bold white -> Base3 diff --git a/.config/bash/solarized b/.config/bash/solarized new file mode 100644 index 0000000..180196d --- /dev/null +++ b/.config/bash/solarized @@ -0,0 +1,23 @@ +[[ "$OSTYPE" == *darwin* ]] && return; + +echo -ne '\eP\e]10;#839496\a' # Foreground -> base0 +echo -ne '\eP\e]11;#002B36\a' # Background -> base03 + +echo -ne '\eP\e]12;#DC322F\a' # Cursor -> red + +echo -ne '\eP\e]4;0;#073642\a' # black -> Base02 +echo -ne '\eP\e]4;8;#002B36\a' # bold black -> Base03 +echo -ne '\eP\e]4;1;#DC322F\a' # red -> red +echo -ne '\eP\e]4;9;#CB4B16\a' # bold red -> orange +echo -ne '\eP\e]4;2;#859900\a' # green -> green +echo -ne '\eP\e]4;10;#586E75\a' # bold green -> base01 * +echo -ne '\eP\e]4;3;#B58900\a' # yellow -> yellow +echo -ne '\eP\e]4;11;#657B83\a' # bold yellow -> base00 * +echo -ne '\eP\e]4;4;#268BD2\a' # blue -> blue +echo -ne '\eP\e]4;12;#839496\a' # bold blue -> base0 * +echo -ne '\eP\e]4;5;#D33682\a' # magenta -> magenta +echo -ne '\eP\e]4;13;#6C71C4\a' # bold magenta -> violet +echo -ne '\eP\e]4;6;#2AA198\a' # cyan -> cyan +echo -ne '\eP\e]4;14;#93A1A1\a' # bold cyan -> base1 * +echo -ne '\eP\e]4;7;#EEE8D5\a' # white -> Base2 +echo -ne '\eP\e]4;15;#FDF6E3\a' # bold white -> Base3