remove the things that are redundant with nix
This commit is contained in:
parent
3bbee9a729
commit
1cd610ed12
6 changed files with 0 additions and 3364 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +0,0 @@
|
|||
if [ -L ~/.bashrc ] || [ -f ~/.bashrc ]; then
|
||||
source ~/.bashrc;
|
||||
fi
|
||||
|
||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
# don't put duplicate lines in the history. See bash(1) for more options
|
||||
# ... or force ignoredups and ignorespace
|
||||
HISTCONTROL=ignoredups:ignorespace
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
BLACK="\[\033[0;38m\]"
|
||||
RED="\[\033[0;31m\]"
|
||||
RED_BOLD="\[\033[01;31m\]"
|
||||
BLUE="\[\033[01;34m\]"
|
||||
GREEN="\[\033[0;32m\]"
|
||||
YELLOW="\[\033[0;33m\]"
|
||||
|
||||
parse_git_branch() {
|
||||
|
||||
git rev-parse --git-dir &> /dev/null
|
||||
git_status="$(git status 2> /dev/null)"
|
||||
branch_pattern="^# On branch ([^${IFS}]*)"
|
||||
remote_pattern="# Your branch is (.*) of"
|
||||
diverge_pattern="# Your branch and (.*) have diverged"
|
||||
if [[ ! ${git_status} =~ "nothing to commit" ]]; then
|
||||
state=" ${RED}!"
|
||||
else
|
||||
state=""
|
||||
fi
|
||||
# add an else if or two here if you want to get more specific
|
||||
if [[ ${git_status} =~ ${remote_pattern} ]]; then
|
||||
if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
|
||||
remote=" ${YELLOW}↑"
|
||||
else
|
||||
remote=" ${YELLOW}↓"
|
||||
fi
|
||||
fi
|
||||
if [[ ${git_status} =~ ${diverge_pattern} ]]; then
|
||||
remote=" ${YELLOW}↕"
|
||||
fi
|
||||
if [[ ${git_status} =~ ${branch_pattern} ]]; then
|
||||
branch=${BASH_REMATCH[1]}
|
||||
echo " $RED(${branch}${remote}${state}$RED) "
|
||||
fi
|
||||
}
|
||||
|
||||
export CLICOLOR=1
|
||||
export EDITOR=/usr/bin/mvim
|
||||
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
fi
|
||||
|
||||
alias grep='grep --color'
|
||||
alias fgrep='fgrep --color'
|
||||
alias egrep='egrep --color'
|
||||
|
||||
alias vim='~/local/bin/vim'
|
||||
|
||||
function ll(){ ls -lhF --color=auto "$@"| egrep "^d" ; ls -lXB "$@" 2>&-| \
|
||||
egrep -v "^d|total "; }
|
||||
|
||||
alias ls="ls -hF --color=auto"
|
||||
alias la='ls -Al --color=auto' # show hidden files
|
||||
alias lx='ls -lXB --color=auto' # sort by extension
|
||||
alias lk='ls -lSr --color=auto' # sort by size, biggest last
|
||||
alias lc='ls -ltcr --color=auto' # sort by and show change time, most recent last
|
||||
alias lu='ls -ltur --color=auto' # sort by and show access time, most recent last
|
||||
alias lt='ls -ltr --color=auto' # sort by date, most recent last
|
||||
alias lm='ls -al --color=auto | more' # pipe through 'more'
|
||||
alias lr='ls -lR --color=auto' # recursive ls
|
||||
alias tree='tree -Csu' # nice alternative to 'recursive ls'
|
||||
|
||||
alias mkdir='mkdir -p'
|
||||
# aliases
|
||||
alias cd..="cd .."
|
||||
alias lp="ls -p --color=auto"
|
||||
alias h=history
|
||||
|
||||
# the "kp" alias ("que pasa"), in honor of tony p.
|
||||
alias kp="ps auxwww"
|
||||
|
||||
# general path munging
|
||||
PATH=~/pg/yelp-main/tools:$PATH
|
||||
PATH=~/local/bin:~/dotfiles/bin:$PATH
|
||||
|
||||
if [ -f /opt/local/etc/bash_completion.d/git ]; then
|
||||
source /opt/local/etc/bash_completion.d/git
|
||||
fi
|
||||
|
||||
# configure my multi-line prompt
|
||||
prompt_func() {
|
||||
PS1="\n"
|
||||
PS1=$PS1"$BLACK[ \u@$RED\h $GREEN\w$RED$(parse_git_branch)$BLACK]"
|
||||
|
||||
PS1=$PS1"\n"
|
||||
if [ "$YELP_IN_SANDBOX" ]; then
|
||||
PS1=$PS1"(sandbox) "
|
||||
fi
|
||||
PS1=$PS1"> "
|
||||
}
|
||||
PROMPT_COMMAND=prompt_func
|
||||
|
||||
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
||||
|
||||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
#!bash
|
||||
#
|
||||
# git-flow-completion
|
||||
# ===================
|
||||
#
|
||||
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
|
||||
#
|
||||
# The contained completion routines provide support for completing:
|
||||
#
|
||||
# * git-flow init and version
|
||||
# * feature, hotfix and release branches
|
||||
# * remote feature, hotfix and release branch names
|
||||
#
|
||||
#
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# To achieve git-flow completion nirvana:
|
||||
#
|
||||
# 0. Install git-completion.
|
||||
#
|
||||
# 1. Install this file. Either:
|
||||
#
|
||||
# a. Place it in a `bash-completion.d` folder:
|
||||
#
|
||||
# * /etc/bash-completion.d
|
||||
# * /usr/local/etc/bash-completion.d
|
||||
# * ~/bash-completion.d
|
||||
#
|
||||
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
|
||||
# your .bashrc:
|
||||
#
|
||||
# source ~/.git-flow-completion.sh
|
||||
#
|
||||
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
|
||||
# $command case in _git:
|
||||
#
|
||||
# flow) _git_flow ;;
|
||||
#
|
||||
#
|
||||
# The Fine Print
|
||||
# --------------
|
||||
#
|
||||
# Copyright (c) 2011 [Justin Hileman](http://justinhileman.com)
|
||||
#
|
||||
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
|
||||
|
||||
_git_flow ()
|
||||
{
|
||||
local subcommands="init feature release hotfix support help version"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
init)
|
||||
__git_flow_init
|
||||
return
|
||||
;;
|
||||
feature)
|
||||
__git_flow_feature
|
||||
return
|
||||
;;
|
||||
release)
|
||||
__git_flow_release
|
||||
return
|
||||
;;
|
||||
hotfix)
|
||||
__git_flow_hotfix
|
||||
return
|
||||
;;
|
||||
support)
|
||||
__git_flow_support
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_init ()
|
||||
{
|
||||
local subcommands="help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
__git_flow_feature ()
|
||||
{
|
||||
local subcommands="list start finish publish track diff rebase checkout pull help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
pull)
|
||||
__gitcomp "$(__git_remotes)"
|
||||
return
|
||||
;;
|
||||
checkout|finish|diff|rebase)
|
||||
__gitcomp "$(__git_flow_list_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_branches 'feature') <(__git_flow_list_remote_branches 'feature'))"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'feature') <(__git_flow_list_branches 'feature'))"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_release ()
|
||||
{
|
||||
local subcommands="list start finish track publish help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_branches 'release')"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_branches 'release') <(__git_flow_list_remote_branches 'release'))"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'release') <(__git_flow_list_branches 'release'))"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
__git_flow_hotfix ()
|
||||
{
|
||||
local subcommands="list start finish help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_support ()
|
||||
{
|
||||
local subcommands="list start help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_prefix ()
|
||||
{
|
||||
case "$1" in
|
||||
feature|release|hotfix)
|
||||
git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_branches ()
|
||||
{
|
||||
local prefix="$(__git_flow_prefix $1)"
|
||||
git branch 2> /dev/null | tr -d ' |*' | grep "^$prefix" | sed s,^$prefix,, | sort
|
||||
}
|
||||
|
||||
__git_flow_list_remote_branches ()
|
||||
{
|
||||
local prefix="$(__git_flow_prefix $1)"
|
||||
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
|
||||
git branch -r 2> /dev/null | sed "s/^ *//g" | grep "^$origin/$prefix" | sed s,^$origin/$prefix,, | sort
|
||||
}
|
||||
|
||||
# alias __git_find_on_cmdline for backwards compatibility
|
||||
if [ -z "`type -t __git_find_on_cmdline`" ]; then
|
||||
alias __git_find_on_cmdline=__git_find_subcommand
|
||||
fi
|
||||
|
|
@ -1,241 +0,0 @@
|
|||
-----------------------------------------------
|
||||
-- Set up
|
||||
-----------------------------------------------
|
||||
|
||||
local tiling = require "hs.tiling"
|
||||
local hotkey = require "hs.hotkey"
|
||||
local hyper = {"shift", "cmd", "alt", "ctrl"}
|
||||
local mash = {"ctrl", "cmd"}
|
||||
|
||||
hs.window.animationDuration = 0
|
||||
|
||||
|
||||
-----------------------------------------------
|
||||
-- auto-tile commands
|
||||
-----------------------------------------------
|
||||
|
||||
hotkey.bind(mash, "j", function() tiling.cycle(1) end)
|
||||
hotkey.bind(mash, "k", function() tiling.cycle(-1) end)
|
||||
hotkey.bind(mash, "space", function() tiling.promote() end)
|
||||
hotkey.bind(mash, "f", function() tiling.goToLayout("fullscreen") end)
|
||||
hotkey.bind(mash, "r", function() tiling.goToLayout("rows") end)
|
||||
hotkey.bind(mash, "t", function() tiling.goToLayout("main-vertical") end)
|
||||
hotkey.bind(mash, "c", function() tiling.goToLayout("columns") end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper d for left one half window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'd', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y
|
||||
f.w = max.w / 2
|
||||
f.h = max.h
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper g for right one half window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'g', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x + (max.w / 2)
|
||||
f.y = max.y
|
||||
f.w = max.w / 2
|
||||
f.h = max.h
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper f for fullscreen
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'f', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y
|
||||
f.w = max.w
|
||||
f.h = max.h
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper e for top left one quarter window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'e', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y
|
||||
f.w = max.w / 2
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper r for top half window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'r', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y
|
||||
f.w = max.w
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper t for top right one quarter window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 't', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x + (max.w / 2)
|
||||
f.y = max.y
|
||||
f.w = max.w / 2
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper b for bottom left one quarter window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'b', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x + (max.w / 2)
|
||||
f.y = max.y + (max.h / 2)
|
||||
f.w = max.w / 2
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper v for bottom right one quarter window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'v', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y + (max.h / 2)
|
||||
f.w = max.w
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- hyper c for bottom right one quarter window
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'c', function()
|
||||
if hs.window.focusedWindow() then
|
||||
local win = hs.window.focusedWindow()
|
||||
local f = win:frame()
|
||||
local screen = win:screen()
|
||||
local max = screen:frame()
|
||||
|
||||
f.x = max.x
|
||||
f.y = max.y + (max.h / 2)
|
||||
f.w = max.w / 2
|
||||
f.h = max.h / 2
|
||||
win:setFrame(f)
|
||||
else
|
||||
hs.alert.show("No active window")
|
||||
end
|
||||
end)
|
||||
|
||||
-----------------------------------------------
|
||||
-- Reload config on write
|
||||
-----------------------------------------------
|
||||
|
||||
function reload_config(files)
|
||||
hs.reload()
|
||||
end
|
||||
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reload_config):start()
|
||||
hs.alert.show("Config loaded")
|
||||
|
||||
-----------------------------------------------
|
||||
-- Hyper i to show window hints
|
||||
-----------------------------------------------
|
||||
|
||||
hs.hotkey.bind(hyper, 'i', function()
|
||||
hs.hints.windowHints()
|
||||
end)
|
||||
|
||||
----------------------------------------------
|
||||
-- Shortcuts to common applications
|
||||
----------------------------------------------
|
||||
local appShortcuts = {
|
||||
['a'] = 'Slack',
|
||||
['q'] = 'Rubymine',
|
||||
}
|
||||
for shortcut, appName in pairs(appShortcuts) do
|
||||
hs.hotkey.bind({'alt', 'cmd'}, shortcut, function() hs.application.launchOrFocus(appName) end)
|
||||
end
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
|
||||
set -e
|
||||
|
||||
install_homebrew() {
|
||||
user_command ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
}
|
||||
|
||||
grab_dependencies() {
|
||||
user_command brew install git
|
||||
|
||||
user_command brew install vim
|
||||
|
||||
easy_install pip
|
||||
pip install neovim
|
||||
user_command brew install python3
|
||||
user_command pip3 install neovim
|
||||
user_command brew install neovim/neovim/neovim
|
||||
|
||||
user_command brew install zsh
|
||||
|
||||
user_command brew install tmux
|
||||
user_command brew install ag
|
||||
user_command brew install direnv
|
||||
|
||||
user_command brew install caskroom/cask/brew-cask
|
||||
user_command brew cask install iterm2
|
||||
user_command brew cask install hammerspoon
|
||||
user_command brew cask install karabiner
|
||||
user_command brew cask install seil
|
||||
}
|
||||
|
||||
user_command() {
|
||||
echo "$@"
|
||||
sudo -u $(logname) $@
|
||||
}
|
||||
|
||||
change_shell_to_zsh() {
|
||||
if grep -Fqx "$ZSH_PATH" /etc/shells; then
|
||||
echo "zsh already an allowed default shell :)"
|
||||
else
|
||||
echo "$(which zsh)" >> /etc/shells
|
||||
fi
|
||||
chsh -s $(which zsh)
|
||||
}
|
||||
|
||||
main() {
|
||||
# abort if homebrew is already installed; we don't want to accidentally stomp on things
|
||||
if type brew &> /dev/null; then
|
||||
if [[ "$1" != "--force" ]]; then
|
||||
echo "homebrew is already installed; this mac has probably been set up already!"
|
||||
echo "run with --force if you really want to continue"
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
install_homebrew
|
||||
fi
|
||||
grab_dependencies
|
||||
if [ -z $ZSH_NAME ]; then
|
||||
echo "zsh is already the default shell :)"
|
||||
else
|
||||
change_shell_to_zsh
|
||||
fi
|
||||
echo "done setting up the mac!"
|
||||
}
|
||||
|
||||
main $@
|
||||
Loading…
Add table
Add a link
Reference in a new issue