diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-02-26 13:48:33 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-02-26 13:48:33 +0100 |
commit | 178ffef0226b45ad4b1862c7e9223cd539788bcc (patch) | |
tree | 765e23862f50479dd48ab312f6cb9aa0fa202a86 | |
parent | 724bb024d49f2883c186e80a016abd9b956bba96 (diff) | |
download | dotfiles-178ffef0226b45ad4b1862c7e9223cd539788bcc.tar.gz |
removed bashit
-rw-r--r-- | .bash_profile | 21 | ||||
-rw-r--r-- | .bashrc | 71 | ||||
-rw-r--r-- | bash/alias.bash | 9 | ||||
-rw-r--r-- | bash/color.bash | 44 | ||||
-rw-r--r-- | bash/env.profile | 3 | ||||
-rw-r--r-- | bash/git.bash | 8 | ||||
-rw-r--r-- | bash/prompt.bash | 12 | ||||
-rw-r--r-- | bashit_bash_profile | 13 | ||||
-rw-r--r-- | bashit_bashrc | 71 |
9 files changed, 180 insertions, 72 deletions
diff --git a/.bash_profile b/.bash_profile index 5f73e6a..8dc994e 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,13 +1,18 @@ +# vi:syntax=sh # -# ~/.bash_profile +# .bash_profile # -alias vim=nvim +if [[ -f ~/.files ]]; then + source ~/.files +else + DOTFILEBASE="/home/jonas/dotfiles" +fi -export EDITOR=nvim -export VISUAL=nvim +for f in $DOTFILEBASE/bash/*.profile ; do + source $f +done -PATH=~/bin:$PATH -[[ -f ~/.files ]] && source ~/.files && PATH="$DOTFILEBASE/scripts:$PATH" - -[[ -f ~/.bashrc ]] && . ~/.bashrc +if [[ -f ~/.bashrc ]]; then + source ~/.bashrc +fi @@ -1,71 +1,14 @@ #!/usr/bin/env bash -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac +#Light and fancy bash -if [ -e ".files" ] -then - source .files +if [[ -f "$HOME/.files" ]]; then + source "$HOME/.files" else - DOTFILEBASE="/home/jonas/vimconfig" + DOTFILEBASE="/home/jonas/dotfiles" fi -export BASH_IT_CUSTOM=$DOTFILEBASE +for f in $DOTFILEBASE/bash/*.bash; do + source $f +done -# Path to the bash it configuration -export BASH_IT="$DOTFILEBASE/bash-it" - -# Lock and Load a custom theme file. -# Leave empty to disable theming. -# location /.bash_it/themes/ -export BASH_IT_THEME="$DOTFILEBASE/theme.bash" - -# (Advanced): Change this to the name of your remote repo if you -# cloned bash-it with a remote other than origin such as `bash-it`. -# export BASH_IT_REMOTE='bash-it' - -# Your place for hosting Git repos. I use this for private repos. -export GIT_HOSTING='git@git.domain.com' - -# Don't check mail when opening terminal. -unset MAILCHECK - -# Change this to your console based IRC client of choice. -export IRC_CLIENT='irssi' - -# Set this to the command you use for todo.txt-cli -export TODO="t" - -# Set this to false to turn off version control status checking within the prompt for all themes -export SCM_CHECK=true - -# Set Xterm/screen/Tmux title with only a short hostname. -# Uncomment this (or set SHORT_HOSTNAME to something else), -# Will otherwise fall back on $HOSTNAME. -#export SHORT_HOSTNAME=$(hostname -s) - -# Set Xterm/screen/Tmux title with only a short username. -# Uncomment this (or set SHORT_USER to something else), -# Will otherwise fall back on $USER. -#export SHORT_USER=${USER:0:8} - -# Set Xterm/screen/Tmux title with shortened command and directory. -# Uncomment this to set. -#export SHORT_TERM_LINE=true - -# Set vcprompt executable path for scm advance info in prompt (demula theme) -# https://github.com/djl/vcprompt -#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt - -# (Advanced): Uncomment this to make Bash-it reload itself automatically -# after enabling or disabling aliases, plugins, and completions. -# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1 - -# Uncomment this to make Bash-it create alias reload. -# export BASH_IT_RELOAD_LEGACY=1 - -# Load Bash It -source "$BASH_IT"/bash_it.sh diff --git a/bash/alias.bash b/bash/alias.bash new file mode 100644 index 0000000..c655059 --- /dev/null +++ b/bash/alias.bash @@ -0,0 +1,9 @@ +# vi:syntax=sh + +alias ls="ls --color" +alias la="ls -a" +alias ll="ls -lh" + +alias vim="nvim" + +alias ssh="TERM=xterm-color ssh" diff --git a/bash/color.bash b/bash/color.bash new file mode 100644 index 0000000..9bc93c6 --- /dev/null +++ b/bash/color.bash @@ -0,0 +1,44 @@ +# vi:syntax=sh + +black="\[\e[0;30m\]" +red="\[\e[0;31m\]" +green="\[\e[0;32m\]" +yellow="\[\e[0;33m\]" +blue="\[\e[0;34m\]" +purple="\[\e[0;35m\]" +cyan="\[\e[0;36m\]" +white="\[\e[0;37m\]" +orange="\[\e[0;91m\]" + +bold_black="\[\e[30;1m\]" +bold_red="\[\e[31;1m\]" +bold_green="\[\e[32;1m\]" +bold_yellow="\[\e[33;1m\]" +bold_blue="\[\e[34;1m\]" +bold_purple="\[\e[35;1m\]" +bold_cyan="\[\e[36;1m\]" +bold_white="\[\e[37;1m\]" +bold_orange="\[\e[91;1m\]" + +underline_black="\[\e[30;4m\]" +underline_red="\[\e[31;4m\]" +underline_green="\[\e[32;4m\]" +underline_yellow="\[\e[33;4m\]" +underline_blue="\[\e[34;4m\]" +underline_purple="\[\e[35;4m\]" +underline_cyan="\[\e[36;4m\]" +underline_white="\[\e[37;4m\]" +underline_orange="\[\e[91;4m\]" + +background_black="\[\e[40m\]" +background_red="\[\e[41m\]" +background_green="\[\e[42m\]" +background_yellow="\[\e[43m\]" +background_blue="\[\e[44m\]" +background_purple="\[\e[45m\]" +background_cyan="\[\e[46m\]" +background_white="\[\e[47;1m\]" +background_orange="\[\e[101m\]" + +normal="\[\e[0m\]" +reset_color="\[\e[39m\]" diff --git a/bash/env.profile b/bash/env.profile new file mode 100644 index 0000000..52c1a21 --- /dev/null +++ b/bash/env.profile @@ -0,0 +1,3 @@ +# vi:syntax=sh + +export EDITOR=vim diff --git a/bash/git.bash b/bash/git.bash new file mode 100644 index 0000000..365eac2 --- /dev/null +++ b/bash/git.bash @@ -0,0 +1,8 @@ +# vi:syntax=sh + +function get_git_state () { + local GIT_STATUS=$(git status -bs) + local GIT_BRANCH=$(echo $GIT_STATUS | grep "^## :") + local GIT_CHANGED=$(echo $GIT_STATUS | grep -c "^ M") + local GIT_UNTRACKED=$(echo $GIT_STATUS | grep -c "^??") +} diff --git a/bash/prompt.bash b/bash/prompt.bash new file mode 100644 index 0000000..2510ea5 --- /dev/null +++ b/bash/prompt.bash @@ -0,0 +1,12 @@ +# vi:syntax=sh + +function prompt_command () { + local EXIT="$?" + if [ $EXIT -eq 0 ]; then + EXIT="" + fi + #PS1="\n${cyan}\h:$(virtualenv_prompt) ${reset_color} ${yellow}\w ${green}$(scm_prompt_info)\n${red}${EXIT} ${reset_color}→ " + PS1="\n${cyan}\h: ${reset_color} ${yellow}\w \n${red}${EXIT} ${reset_color}→ " +} + +PROMPT_COMMAND=prompt_command diff --git a/bashit_bash_profile b/bashit_bash_profile new file mode 100644 index 0000000..5f73e6a --- /dev/null +++ b/bashit_bash_profile @@ -0,0 +1,13 @@ +# +# ~/.bash_profile +# + +alias vim=nvim + +export EDITOR=nvim +export VISUAL=nvim + +PATH=~/bin:$PATH +[[ -f ~/.files ]] && source ~/.files && PATH="$DOTFILEBASE/scripts:$PATH" + +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/bashit_bashrc b/bashit_bashrc new file mode 100644 index 0000000..119272d --- /dev/null +++ b/bashit_bashrc @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +if [ -e ".files" ] +then + source .files +else + DOTFILEBASE="/home/jonas/vimconfig" +fi + +export BASH_IT_CUSTOM=$DOTFILEBASE + +# Path to the bash it configuration +export BASH_IT="$DOTFILEBASE/bash-it" + +# Lock and Load a custom theme file. +# Leave empty to disable theming. +# location /.bash_it/themes/ +export BASH_IT_THEME="$DOTFILEBASE/theme.bash" + +# (Advanced): Change this to the name of your remote repo if you +# cloned bash-it with a remote other than origin such as `bash-it`. +# export BASH_IT_REMOTE='bash-it' + +# Your place for hosting Git repos. I use this for private repos. +export GIT_HOSTING='git@git.domain.com' + +# Don't check mail when opening terminal. +unset MAILCHECK + +# Change this to your console based IRC client of choice. +export IRC_CLIENT='irssi' + +# Set this to the command you use for todo.txt-cli +export TODO="t" + +# Set this to false to turn off version control status checking within the prompt for all themes +export SCM_CHECK=true + +# Set Xterm/screen/Tmux title with only a short hostname. +# Uncomment this (or set SHORT_HOSTNAME to something else), +# Will otherwise fall back on $HOSTNAME. +#export SHORT_HOSTNAME=$(hostname -s) + +# Set Xterm/screen/Tmux title with only a short username. +# Uncomment this (or set SHORT_USER to something else), +# Will otherwise fall back on $USER. +#export SHORT_USER=${USER:0:8} + +# Set Xterm/screen/Tmux title with shortened command and directory. +# Uncomment this to set. +#export SHORT_TERM_LINE=true + +# Set vcprompt executable path for scm advance info in prompt (demula theme) +# https://github.com/djl/vcprompt +#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt + +# (Advanced): Uncomment this to make Bash-it reload itself automatically +# after enabling or disabling aliases, plugins, and completions. +# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1 + +# Uncomment this to make Bash-it create alias reload. +# export BASH_IT_RELOAD_LEGACY=1 + +# Load Bash It +source "$BASH_IT"/bash_it.sh |