From f4a8ead91507d984a294725efe5f4da58c8f923a Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Sat, 23 Dec 2017 14:43:30 -0600 Subject: [PATCH] some tweaks to get things working in arch --- .bash_aliases | 1 - .bash_functions | 54 ++++++++----------------------------------------- .environment | 11 ++++------ .gitconfig | 2 +- .profile | 12 +++++------ bootstrap.sh | 12 ++++++++++- 6 files changed, 29 insertions(+), 63 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index afe4be2..4098829 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -9,7 +9,6 @@ alias ll='ls -hGla' #rake alias bake='bundle exec rake' -alias clear="clear && printmotd" #tools alias resrc='source ~/.bash_aliases && source ~/.bashrc && source ~/.profile' diff --git a/.bash_functions b/.bash_functions index 150396c..4abe806 100644 --- a/.bash_functions +++ b/.bash_functions @@ -1,16 +1,6 @@ #!/bin/bash #vim: set ft=sh -# `a` with no arguments opens the current directory in Atom Editor, otherwise -# opens the given location -function a() { - if [ $# -eq 0 ]; then - atom .; - else - atom "$@"; - fi; -} - # Simple calculator function calc() { local result=""; @@ -99,22 +89,14 @@ function dumptcp(){ sudo tcpdump -s 0 -A -i $DUMPINTERFACE "tcp port $DUMPPORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" } -# Use Git’s colored diff when available -hash git &>/dev/null; -if [ $? -eq 0 ]; then - function diff() { - git diff --color "$@" | diff-so-fancy; - } - - function diff-file() { - if [[ -z $1 ]] || [[ -z $2 ]]; then - echo "diff-file diffs two files (don't have to be in a repo)" - echo "usage diff-file " - return -1 - fi - git diff --no-index --color --color-words "$@" | diff-so-fancy; - } -fi; +function diff-file() { + if [[ -z $1 ]] || [[ -z $2 ]]; then + echo "diff-file diffs two files (don't have to be in a repo)" + echo "usage diff-file " + return -1 + fi + git diff --no-index --color --color-words "$@" | diff-so-fancy; +} # UTF-8-encode a string of Unicode symbols function escape() { @@ -233,24 +215,6 @@ function prunelocal(){ for b in `git branch --merged | grep -v \*`; do git branch -D $b; done } -# prints message of the day and a fortune -function printmotd(){ - if [[ $WORK ]]; then - cat ~/work_motd - else - cat ~/motd - fi - - if [[ -f $GOPATH/bin/fortune ]]; then - echo "" - $GOPATH/bin/fortune -file="$GOPATH/bin/fortunes.txt" - elif [[ -f $(which fortune 2>/dev/null) ]]; then - echo "" - fortune - fi - echo "" -} - function tunnel(){ if [[ -z $1 ]]; then echo "Takes an ssh config host name and starts an SSH tunnel" @@ -266,8 +230,6 @@ function tunnel(){ fi } - - # `s` with no arguments opens the current directory in Sublime Text, otherwise # opens the given location function s() { diff --git a/.environment b/.environment index 1153951..ba4536d 100644 --- a/.environment +++ b/.environment @@ -16,23 +16,20 @@ shopt -s histappend # Append to the history file, not over export LESS='-iMR' # Case insensite search, verbose prompting and raw output export PAGER=less # Used to display text / man files -export ANSIBLE_HOSTS="~/.ansible/hosts" - export LANG="en_US.UTF-8" -export WINDOWS="FALSE" -export GIT_EDITOR=vim export POWERLINE_CONFIG_COMMAND=~/Tools/modules/powerline/scripts/powerline-config +export WINDOWS=false if [ -d "${HOME}/.bin" ] ; then PATH=${HOME}/.bin:${PATH} fi + +export GIT_EDITOR=vim + # give windows boxes a chance to override environment if [ -d "/c/Windows" ]; then WINDOWS="TRUE" - ANSIBLE_HOSTS="/c/ansible/hosts" - GOROOT="/d/Programs/Go" - GOPATH="/d/Projects/Programming/go" GIT_EDITOR=~/tools/vim/gvim.exe if [ -f ~/.windows ]; then diff --git a/.gitconfig b/.gitconfig index faed669..0569415 100644 --- a/.gitconfig +++ b/.gitconfig @@ -167,4 +167,4 @@ # for OSX #helper = osxkeychain # for Linux - helper = /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring + helper =/usr/lib/git-core/git-credential/git-credential-gnome-keyring diff --git a/.profile b/.profile index 26a735f..70f7c82 100644 --- a/.profile +++ b/.profile @@ -1,27 +1,25 @@ #!/bin/bash - # source environment settings if [ -f ~/.environment ]; then . ~/.environment fi +# Load functions +#if [ -f ~/.bash_functions ]; then + #. ~/.bash_functions +#fi + # Load any extra aliases if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi -# Load functions -if [ -f ~/.bash_functions ]; then - . ~/.bash_functions -fi - # Load pretty colors if [ -f ~/.shell_colors ]; then . ~/.shell_colors fi - # for when you want to do custom junk # Sources a folder with shell extensions if [ -d ~/.extensions ]; then diff --git a/bootstrap.sh b/bootstrap.sh index 5718eba..0e594b9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -29,7 +29,7 @@ done echo "" echo "loading git modules in $source..." -pushd $source 2&> /dev/null +pushd $source git submodule init git submodule update popd @@ -94,7 +94,17 @@ elif [[ $(uname -o) == "Msys" ]]; then fi mkdir ~/.extensions +cat <~/.extensions/README.md +# Extensions +All script files in this folder get loaded by the .profile, so this is a nice place to organize plugins +or enhancements to the dotfile setup +EOF + +if [[ -f "~/.bashrc" ]]; then + echo "sourcing .profile in .bashrc" + echo "source ./.profile" >> ~/.bashrc +fi echo ""