Merge branch 'master' of gitlab.com:tyrelsouza/dotfiles

This commit is contained in:
Tyrel Souza 2017-05-11 22:17:42 -04:00
commit 4842a33192
No known key found for this signature in database
GPG Key ID: 2EECB5087209E6A5
11 changed files with 1569 additions and 79 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ vim/view
.netrwhist
chromedriver
config/fish/fishd.*
emacs.d/elpa

View File

@ -18,6 +18,7 @@ rm -rf ~/.gitignore
rm -rf ~/.git_template
rm -rf ~/.hushlogin
rm -rf ~/.vim
rm -rf ~/.emacs
rm -rf ~/.vimrc
rm -rf ~/.zshrc
rm -rf ~/.pythonstartup.py
@ -34,6 +35,7 @@ ln -s $(pwd)/gitconfig ~/.gitconfig
ln -s $(pwd)/gitignore ~/.gitignore
ln -s $(pwd)/git_template ~/.git_template
ln -s $(pwd)/hushlogin ~/.hushlogin
ln -s $(pwd)/emacs ~/.emacs
ln -s $(pwd)/vim ~/.vim
ln -s $(pwd)/vimrc ~/.vimrc
ln -s $(pwd)/zshrc ~/.zshrc
@ -57,8 +59,8 @@ ln -s $(pwd)/config/fish ~/.config/fish
mkdir -p ~/.vim/bundle
cd ~/.vim/bundle
# Put Bundles Here
git clone git@github.com:JamshedVesuna/vim-markdown-preview.git
git clone git@github.com:Shougo/denite.nvim.git
git clone git@github.com:spolu/dwm.vim.git
git clone git@github.com:croaky/vim-colors-github.git
git clone git@github.com:danro/rename.vim.git
git clone git@github.com:fatih/vim-go.git
@ -66,5 +68,7 @@ git clone git@github.com:kien/ctrlp.vim.git
git clone git@github.com:mileszs/ack.vim.git
git clone git@github.com:pbrisbin/vim-mkdir.git
git clone git@github.com:scrooloose/syntastic.git
git clone git@github.com:spolu/dwm.vim.git
git clone git@github.com:tpope/vim-surround.git
git clone git@github.com:vim-airline/vim-airline-themes.git
git clone git@github.com:vim-airline/vim-airline.git

View File

@ -1,21 +1,25 @@
#!/usr/local/bin/zsh
export HOMEBREW_GITHUB_API_TOKEN="caf4cd85c6eb6ddcf006d4571d4a294c0b0592e4"
alias ag='\ag --pager="less"'
alias cg='cd "$(git rev-parse --show-toplevel)"'
alias fuck='eval $(thefuck $(fc -ln -1)); \history -r'
alias g='git'
alias pdb="python -m pdb"
alias ppjson="python -m json.tool"
# Addgene specific
# Aliases
alias adg="workon addgene-core"
alias adocs='cd $ADDGENE_CORE_REPO_DIR/docs && make html && open $ADDGENE_CORE_REPO_DIR/docs/build/html/index.html'
alias aenv='env | sort | grep ADDGENE'
alias sl="source local.env.$(basename $SHELL)"
alias ag='\ag --pager="less"'
alias cg='cd "$(git rev-parse --show-toplevel)"'
alias dots="cd $(dirname `readlink ~/.vim`)"
alias g='git'
alias gp='git push'
alias pdb="python -m pdb"
alias ppjson="python -m json.tool"
alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy"
alias sl="source local.env"
alias stabbats='sudo killall VDCAssistant && open https://appear.in/stab-bats'
if [[ $OSTYPE == darwin* ]]; then
alias rm=trash;
fi;
# Functions
function adtest () {
no_slashes="$(echo "$1" | sed -e 's/\//\./g')";
a_test="$(echo "$no_slashes" | sed -e 's/.py//g')";
@ -24,14 +28,6 @@ function adtest () {
echo "Evaling $run_test";
eval $run_test;
}
function dots(){
cd $(dirname `readlink ~/.vim`)
}
function adg () {
workon addgene-core
}
function cpbr () {
if branch=$(git symbolic-ref --short -q HEAD)
then
@ -42,9 +38,6 @@ function cpbr () {
fi
}
function hidden() { ls -a "$@" | grep '^\.'; }
alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy"
function h () {
if [ -z "$*" ]
then
@ -54,4 +47,3 @@ function h () {
fi
}
alias stabbats='sudo killall VDCAssistant && open https://appear.in/stab-bats'

1450
bin/Markdown.pl Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,14 @@
#!/bin/bash
set -v
if [[ $OSTYPE == "darwin*" ]];then
umount /Volumes/ramdisk
mysql.server stop
killall mysqld
killall mysqld
killall mysqld
killall mysqld
killall mysqld
killall mysqld
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://2048000`
cp -r /usr/local/var/mysql /Volumes/ramdisk
mysql.server start
else
sudo service mysql stop
# This works on Ubuntu 14.04, but not 16.04:
# sudo mkdir -p /mnt/mysql-data-orig
# sudo mount --bind /var/lib/mysql /mnt/mysql-data-orig
# sudo mount -t tmpfs -o size=32G,uid=mysql,gid=mysql,mode=700 tmpfs /var/lib/mysql
# sudo sh -c 'cp -avi /mnt/mysql-data-orig/* /var/lib/mysql/'
# This works on 16.04 and maybe elsewhere too
sudo mkdir -p /mnt/mysql-ram
sudo mount -t tmpfs -o size=8G,uid=mysql,gid=mysql,mode=700 tmpfs /mnt/mysql-ram
sudo mount -t aufs -o br:/mnt/mysql-ram:/var/lib/mysql=ro aufs /var/lib/mysql
sudo service mysql start
fi
umount /Volumes/ramdisk
mysql.server stop
killall mysqld
killall mysqld
killall mysqld
killall mysqld
killall mysqld
killall mysqld
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://2048000`
cp -r /usr/local/var/mysql /Volumes/ramdisk
mysql.server start

5
bin/release_package.sh Executable file
View File

@ -0,0 +1,5 @@
python setup.py clean
python setup.py sdist bdist_wheel
gpg --detach-sign -a dist/*.gz
gpg --detach-sign -a dist/*.whl
twine upload dist/*

53
emacs Normal file
View File

@ -0,0 +1,53 @@
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(setq sml/theme 'dark)
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
(quote
("3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default)))
'(package-selected-packages
(quote
(neotree smart-mode-line powerline magit use-package helm evil-visual-mark-mode))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(use-package evil
:ensure t
:config
(evil-mode 1)
;; More configuration goes here
)
(use-package magit)
(use-package smart-mode-line
:ensure t
:config
(sml/setup)
)
(use-package powerline
:ensure t
:config
(powerline-center-evil-theme)
)
; https://www.emacswiki.org/emacs/NeoTree
(use-package neotree
:ensure t
:config
(global-set-key [f8] 'neotree-toggle)
)
;; Set Powerline Configuration
(setq powerline-arrow-shape 'curve)
(setq powerline-default-separator-dir '(right . left))

View File

@ -16,32 +16,21 @@
[format]
pretty = format:%C(auto)%h %C(green)%G? %C(red)%<(15,trunc)%aN %C(cyan)%<(15,trunc)%ar %C(white)%<(60,trunc)%s %C(auto)%d
[alias]
# show all these aliases
alias = "!git config -l | grep alias | cut -c 7-"
# delete all merged branches
bc = !git branch --merged master | grep -v master | xargs git branch -d
# Way more information on git log
ll = log --stat --abbrev-commit
# Show files modified per commit
files = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
# show a tree with branches merging
logtree= "log --graph --oneline --decorate --all"
# get the most 10 recent branches worked on
recent = "!git for-each-ref --format=\"%(committerdate:relative) | %(refname)\" --sort=-committerdate refs/heads | sed '/master/d' | head -n 15"
# show tabs with ⌑ replacing tabs
tabs = "!git diff --color | sed 's/\t/⌑/g'"
# show the current version tag
v=describe --tags --match 'v*'
# alias like `hg st`, because I like st, shorter is nice!
st = status
# prettier diffs
d = diff --color-words
#push
alias = "!git config -l | grep alias | cut -c 7-" # show all these aliases
bc = !git branch --merged master | grep -v master | xargs git branch -d # delete all merged branches
d = diff --color-words # prettier diffs
dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f" # Diff so fancy!
files = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat # Show files modified per commit
ll = log --stat --abbrev-commit # Way more information on git log
lb = log --stat --no-merges origin/master..
logtree= "log --graph --oneline --decorate --all" # show a tree with branches merging
p = push
pr = !"pr() { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }; pr"
# Diff so fancy!
dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f"
recent = "!git for-each-ref --format=\"%(committerdate:relative) | %(refname)\" --sort=-committerdate refs/heads | sed '/master/d' | head -n 15" # get the most 10 recent branches worked on
scrum = log --since='1 day ago' --author='Tyrel Souza' --oneline
st = status # alias like `hg st`, because I like st, shorter is nice!
tabs = "!git diff --color | sed 's/\t/⌑/g'" # show tabs with ⌑ replacing tabs
v=describe --tags --match 'v*' # show the current version tag
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
@ -53,3 +42,9 @@
newHighlight = green bold 22
[init]
templatedir = ~/.git_template
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true

12
vimrc
View File

@ -38,7 +38,7 @@ set paste
" Open new split panes to right and bottom, which feels more natural
set splitbelow
" set splitright
set splitright
" Quicker window movement
" Switch between the last two files
@ -133,9 +133,13 @@ nmap <silent> <F1> :set invnumber<CR>
autocmd StdinReadPre * let s:std_in=1
hi Normal ctermbg=none
" Local config
if filereadable($HOME . "/.vimrc.local")
source ~/.vimrc.local
endif
let g:go_fmt_command = "goimports"
nnoremap <leader><tab> :buffers<CR>:buffer<Space>
set background=dark
let vim_markdown_preview_hotkey='<C-m>'
let vim_markdown_preview_github=1
let vim_markdown_preview_browser='Google Chrome'
if filereadable($HOME . "/.vimrc.local")
source ~/.vimrc.local
endif

View File

@ -9,6 +9,7 @@ zstyle ':prezto:load' pmodule \
'completion' \
'tmux' \
'git' \
'python' \
'prompt'
zstyle ':prezto:module:autosuggestions:color' found ''
@ -19,6 +20,7 @@ zstyle ':prezto:module:git:status:ignore' submodules 'all'
zstyle ':prezto:module:prompt' theme 'paradox'
zstyle ':prezto:module:prompt' long-pwd 'yes'
zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
zstyle ':prezto:module:tmux:iterm' integrate 'yes'
zstyle ':prezto:module:tmux:auto-start' local 'yes'
zstyle ':prezto:module:tmux' session 'AddgeneImac'
zstyle ':prezto:module:python:info:virtualenv' format 'v:% v'

View File

@ -40,8 +40,9 @@ if [ -e ~/.ssh/id_addgene ];then
ssh-add ~/.ssh/id_addgene
fi
source ~/.bash_aliases
if [ -e $HOME/.credentials ];then
source $HOME/.credentials
fi
source ~/.bash_aliases
unsetopt share_history