Skip to content

Commit

Permalink
All my configuration files in one place.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Hayden committed Jul 1, 2015
0 parents commit 6756f0e
Show file tree
Hide file tree
Showing 50 changed files with 1,422 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
files/.config/fish/fish_history
files/.config/fish/fishd.*
files/.config/pudb/saved-*
files/.config/git_iws
files/.config/configstore/
files/.vim/*
files/.nvim/*
files/.nvim/autoload/plug.vim
!files/.nvim/autoload/
!files/.nvim/after/
files/.ipython/*
!files/.ipython/profile_default/ipython_config.py
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "files/.config/base16-shell"]
path = files/.config/base16-shell
url = https://github.com/chriskempson/base16-shell.git
9 changes: 9 additions & 0 deletions README.md
@@ -0,0 +1,9 @@
# Collection of .files

This is a list of configuration files for a \*nix system or Mac OSX. To use any of these files, I recommend using [stow](http://www.gnu.org/software/stow/).

```bash
$> git clone git@github.com:beardedprojamz/DotFiles.git
$> cd ~/DotFiles
$> stow files
```
6 changes: 6 additions & 0 deletions files/.agignore
@@ -0,0 +1,6 @@
*.jpg
*.png
*.gif
*.pdf
*.pyc
*.pkl
3 changes: 3 additions & 0 deletions files/.aws/config
@@ -0,0 +1,3 @@
[default]
output = json
region = us-east-1
1 change: 1 addition & 0 deletions files/.config/base16-shell
Submodule base16-shell added at 5acf56
5 changes: 5 additions & 0 deletions files/.config/fish/completions/gbd.fish
@@ -0,0 +1,5 @@
function __my_git_branches
git branch --no-color 2>/dev/null | sed 's/^..//'
end

complete -f -c gbd -a '(__my_git_branches)' -d 'Branch'
6 changes: 6 additions & 0 deletions files/.config/fish/completions/hub.fish
@@ -0,0 +1,6 @@
complete -f -c hub -a 'pull-request' -d 'Open a pull request on GitHub'
complete -f -c hub -a 'fork' -d 'Make a fork of a remote repository on GitHub and add as remote'
complete -f -c hub -a 'create' -d 'Create this repository on GitHub and add GitHub as origin'
complete -f -c hub -a 'browse' -d 'Open a pull request on GitHub'
complete -f -c hub -a 'compare' -d 'Open a compare page on GitHub'
complete -f -c hub -a 'ci-status' -d 'Show the CI status of a commit'
5 changes: 5 additions & 0 deletions files/.config/fish/completions/nosetests.fish
@@ -0,0 +1,5 @@
function __fish_nosetests
set -l file (commandline -ot)
command nosecomplete $file ^/dev/null | sed -e 's/ /\n/g'
end
complete -f -c nosetests -a '(__fish_nosetests)' -d 'Nosetests'
51 changes: 51 additions & 0 deletions files/.config/fish/completions/sshrc.fish
@@ -0,0 +1,51 @@
#
# Load common sshrc options
#

__fish_complete_ssh sshrc

complete -x -c sshrc -d Hostname -a "
(__fish_print_hostnames)
(
#Prepend any username specified in the completion to the hostname
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
)(__fish_print_hostnames)
"

complete -x -c sshrc -d User -a "
(__fish_print_users | sgrep -v '^_')@
"
complete -c sshrc --description "Command to run" -x -a '(__fish_complete_subcommand --fcs-skip=2)'

complete -c sshrc -s a --description "Disables forwarding of the authentication agent"
complete -c sshrc -s A --description "Enables forwarding of the authentication agent"
complete -x -c sshrc -s b --description "Interface to transmit from" -a "
(
cat /proc/net/arp ^/dev/null| sgrep -v '^IP'|cut -d ' ' -f 1 ^/dev/null
)
"

complete -x -c sshrc -s e --description "Escape character" -a "\^ none"
complete -c sshrc -s f --description "Go to background"
complete -c sshrc -s g --description "Allow remote host to connect to local forwarded ports"
complete -c sshrc -s I --description "Smartcard device"
complete -c sshrc -s k --description "Disable forwarding of Kerberos tickets"
complete -c sshrc -s l -x -a "(__fish_complete_users)" --description "User"
complete -c sshrc -s m --description "MAC algorithm"
complete -c sshrc -s n --description "Prevent reading from stdin"
complete -c sshrc -s N --description "Do not execute remote command"
complete -c sshrc -s p -x --description "Port"
complete -c sshrc -s q --description "Quiet mode"
complete -c sshrc -s s --description "Subsystem"
complete -c sshrc -s t --description "Force pseudo-tty allocation"
complete -c sshrc -s T --description "Disable pseudo-tty allocation"
complete -c sshrc -s x --description "Disable X11 forwarding"
complete -c sshrc -s X --description "Enable X11 forwarding"
complete -c sshrc -s L --description "Locally forwarded ports"
complete -c sshrc -s R --description "Remotely forwarded ports"
complete -c sshrc -s D --description "Dynamic port forwarding"

# Since sshrc runs subcommands, it can accept any switches
complete -c sshrc -u
83 changes: 83 additions & 0 deletions files/.config/fish/config.fish
@@ -0,0 +1,83 @@
######################
### Basic Settings ###
######################

set -x PATH /usr/local/bin $PATH
set -x EDITOR "nvim"
# http://fishshell.com/docs/current/#variables-special
set fish_user_paths ~/bin

# File editing with NeoVim
alias vim 'nvim'
# Refresh fish settings
alias src 'source ~/.config/fish/config.fish'
# Quick jumps for editing config files
alias ef 'nvim ~/.config/fish/config.fish'
alias eh 'nvim ~/.config/fish/fish_history'
alias ev 'nvim ~/.nvimrc'
# Parent directory madness
alias ... 'cd ../..'
alias .... 'cd ../../..'
alias ..... 'cd ../../../..'
# Solarized Silver Searcher
alias ag 'ag --color-match 31\;31 --color-line-number 2\;33 --color-path 2\;32'

# Set GOPATH if there is a go-zone
if test -d ~/go-zone/bin
set -x GOPATH ~/go-zone
set fish_user_paths ~/go-zone/bin $fish_user_paths
end

# Load Git abbreviations & aliases
git_user_aliases
# Load any other abbreviations
my_abbrs
# Setup virtualfish & its plugins
eval (python -m virtualfish auto_activation)

############################
### OS Specific Settings ###
############################

switch (uname)
case Darwin
set fish_user_paths (brew --prefix go)/libexec/bin (brew --prefix gnu-sed)/libexec/gnubin (brew --prefix coreutils)/libexec/gnubin $fish_user_paths
# Homebrew cask aliases
alias cask_install 'brew cask install --appdir=/Applications'
alias cask_uninstall 'brew cask uninstall --appdir=/Applications'
alias cask_search 'brew cask search'
alias cask_list 'brew cask list'
# Add Slack Env. Variables
if test -f ~/.slack
source ~/.slack
end
# Add Docker Env. Variables
boot2docker shellinit ^/dev/null | while read line; eval $line; end
# Misc Aliases
alias .f 'cd ~/DotFiles'
alias bc 'cd ~/BriteCore'
alias em 'nvim ~/DotFiles/files/bin/macsimus.sh'
alias bpr './bin/britecore_shell.py -c pull_request'
alias jenkins 'git-iws-jenkins-build'
alias htop 'sudo htop'
# Increase file descriptors for Mac
ulimit -S -n 4096
case Linux
# Set some Arch Linux specific aliases
if test -f /etc/arch-release
alias pacadd 'sudo pacman -S'
alias pacdelete 'sudo pacman -Runcs'
alias pacupgrade 'sudo pacman -U'
end
end

###################
### UI Settings ###
###################

# Base16 Shell
eval sh $HOME/.config/base16-shell/base16-atelierforest.dark.sh
# Update default fish prompt colors
set_fish_colors
# Setup fancy directory colors
eval (dircolors -c ~/.dircolors)
4 changes: 4 additions & 0 deletions files/.config/fish/functions/dvc.fish
@@ -0,0 +1,4 @@
function dvc -a client -d "Create a devbrite project for the given client."
devbrite create $client $client -w -i premium_records files
return 0
end
6 changes: 6 additions & 0 deletions files/.config/fish/functions/fish_greeting.fish
@@ -0,0 +1,6 @@
function fish_greeting -d "what's up, fish?"
set_color -o df5320
uname -npsr
uptime
set_color normal
end
92 changes: 92 additions & 0 deletions files/.config/fish/functions/fish_prompt.fish
@@ -0,0 +1,92 @@
# name: scorphish-ish
# author: Ben Hayden

function _prompt_rubies -d 'Display current Ruby (rvm/rbenv)'
[ "$theme_display_ruby" = 'no' ]; and return
set -l ruby_version
if type rvm-prompt >/dev/null 2>&1
set ruby_version (rvm-prompt i v g)
else if type rbenv >/dev/null 2>&1
set ruby_version (rbenv version-name)
# Don't show global ruby version...
[ "$ruby_version" = (rbenv global) ]; and echo -n -s '--'; and return
end
[ -z "$ruby_version" ]; and return

echo -n -s $ruby_version
end

function _prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)"
[ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and echo -n -s '--'; and return
echo -n -s (basename "$VIRTUAL_ENV")
end

function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end

function _is_git_dirty
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
end

function _git_dirty_remotes
set current_branch (git rev-parse --abbrev-ref HEAD)
set current_ref (git rev-parse HEAD)
for remote in (git remote)
# if test $remote != 'origin'
set remote_ref_branch "refs/remotes/$remote/$current_branch"
set remote_ref (git for-each-ref --format='%(objectname)' $remote_ref_branch)
if test "$remote_ref" != ''
if test "$remote_ref" != $current_ref
echo !
end
end
# end
end
end


function fish_prompt
set -l gray 68615e

set_color $gray
printf '['
set_color normal ; set_color blue
printf '%s' (prompt_pwd)

set_color $gray
printf '|'
set_color normal ; set_color red
_prompt_rubies

set_color $gray
printf '|'
set_color normal ; set_color green
_prompt_virtualfish

set_color $gray
echo ']'
set_color normal

set -l gray (set_color $gray)
set -l red (set_color red)
set -l normal (set_color normal)
set -l yellow (set_color yellow)

# Show git branch and dirty state
if [ (_git_branch_name) ]
set -l git_branch (_git_branch_name)

set dirty_remotes (_git_dirty_remotes)

if [ (_is_git_dirty) ]
echo -n -s $gray '' $normal $yellow $git_branch $red '*' $dirty_remotes $gray '' $normal
else
echo -n -s $gray '' $normal $yellow $git_branch $red $dirty_remotes $gray '' $normal
end
else
echo -n -s $gray '' $normal
end

set_color normal
end
14 changes: 14 additions & 0 deletions files/.config/fish/functions/fish_right_prompt.fish
@@ -0,0 +1,14 @@
function fish_right_prompt
set -l exit_code $status
if test $exit_code -ne 0
set_color red
else
set_color green
end
printf '%d' $exit_code
set_color 68615e
echo '|'
set_color 9c9491
printf '%s' (date +%H:%M:%S)
set_color normal
end
4 changes: 4 additions & 0 deletions files/.config/fish/functions/fish_title.fish
@@ -0,0 +1,4 @@
function fish_title
[ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and printf '%s %s' $_ (pwd); and return
printf '%s %s' (basename "$VIRTUAL_ENV") (pwd)
end
3 changes: 3 additions & 0 deletions files/.config/fish/functions/fish_user_key_bindings.fish
@@ -0,0 +1,3 @@
function fish_user_key_bindings
bind \cr history-search-backward
end
8 changes: 8 additions & 0 deletions files/.config/fish/functions/gbd.fish
@@ -0,0 +1,8 @@
function gbd -a br -d "Delete Local and Remote Git Branches from origin"
git branch -D $br
set -l origin_branches (git ls-remote --heads origin | sed -rn 's/.*\/([-a-zA-Z0-9_]+$)/\1/p')
if contains $br $origin_branches
git push --delete origin $br
end
return 0
end
12 changes: 12 additions & 0 deletions files/.config/fish/functions/gfoo.fish
@@ -0,0 +1,12 @@
function gfoo -d "Toggle temporary 'foo' Git branch"
set -l my_branches (git branch --no-color 2>/dev/null | sed 's/^..//')
if contains 'foo' $my_branches
git checkout master
git branch -D foo
else
git checkout -b foo upstream/master
if test (count $argv) -gt 0
git cherry-pick $argv
end
end
end

0 comments on commit 6756f0e

Please sign in to comment.