some tweaks to get things working in arch
parent
e85eeb3b1e
commit
f4a8ead915
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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 <file1> <file2>"
|
||||
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 <file1> <file2>"
|
||||
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() {
|
||||
|
|
|
|||
11
.environment
11
.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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
12
.profile
12
.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
|
||||
|
|
|
|||
12
bootstrap.sh
12
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 <<EOF >~/.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 ""
|
||||
|
|
|
|||
Loading…
Reference in New Issue