Skip to content

Commit

Permalink
Dotfiles update
Browse files Browse the repository at this point in the history
  • Loading branch information
aranair committed Nov 8, 2019
1 parent 92be2c1 commit 26841aa
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 51 deletions.
115 changes: 115 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
source $ZSH/oh-my-zsh.sh
source ~/.bin/tmuxinator.zsh
# autoload -U promptinit; promptinit
# prompt pure

# eval $(docker-machine env)
source /usr/local/share/zsh/site-functions/_aws
# source /Users/homan/Projects/tulip/scripts/setPaths.source.sh
prompt_context () { }

# Azure
alias kz="KUBECONFIG=~/.kube/config-azure kubectl"
alias kzs="KUBECONFIG=~/.kube/config-azure kubectl -n kube-system"
alias k3="KUBECONFIG=~/Projects/k3s/kubeconfig.yaml kubectl"

# Python
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi

alias k="kubectl"
alias ks="kubectl -n kube-system"
alias gl="git pull"
alias gs="git status"
alias gb="git branch"
alias gc="git checkout"
alias gcb="git checkout -b"
alias gcm="git commit -m"
alias gpo="git push origin"
alias gpof="git push origin --force-with-lease"
alias gph="git push heroku"
alias grh="git reset HEAD"
alias stree='open -a SourceTree .'
alias be="bundle exec"
alias syn='git branch --merged | grep -v "\*" | grep -v master | grep -v development | xargs -n 1 git branch -d'
alias tl="cd ~/Projects/tulip"
alias tlf="cd ~/Projects/tulip/environments/cloud/Central/factory"
alias tlt="cd ~/Projects/tulip/environments/cloud/telekube"
alias tlm="cd ~/Projects/tulip/environments/cloud/services/src/tulip/migrations"
alias tlh="cd ~/Projects/tulip/environments/cloud/kubernetes/helm"
alias tlw="cd ~/Projects/tulip/environments/cloud/services/src/tulip/tulipweb/"
alias send-onprem="scp *.tar tulip@172.16.55.3:"

# Bat / Fzf
alias b="bat"
alias ff="fzf --preview 'bat --color \"always\" {}'"
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(vim {})+abort'"
function fh() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//')
}

# tmux alias
alias tmux="TERM=screen-256color-bce tmux"
alias ta="tmux a -t"
alias tn="tmux new -s"

export EDITOR='vim'
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# GO
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$GOBIN"

# Elixir
export PATH="$PATH:/path/to/elixir/bin"

# Ruby
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

export NOTES_DIRECTORY="/Users/homan/Dropbox/notes"

# Opens the github page for the current git repository in your browser
function gh() {
giturl=$(git config --get remote.origin.url)
giturl=${giturl/git\@github\.com\:/https://github.com/}
giturl=${giturl/\.git/\/tree/}
# branch="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch="$(git rev-parse --abbrev-ref HEAD)" ||
branch="(unnamed branch)" # detached HEAD
branch=${branch##refs/heads/}
giturl=$giturl$branch
open $giturl
}

# Opens the github page for current git repo and compares it -> for a new PR.
function newpr() {
giturl=$(git config --get remote.origin.url)
giturl=${giturl/git\@github\.com\:/https://github.com/}
giturl=${giturl/\.git/\/compare/}
branch="$(git rev-parse --abbrev-ref HEAD)" ||
branch="(unnamed branch)" # detached HEAD
branch=${branch##refs/heads/}
giturl=$giturl$branch
open $giturl
}
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
export PATH="/usr/local/opt/openssl/bin:$PATH"
. "/Users/homan/.acme.sh/acme.sh.env"

ssh-add -K ~/.ssh/id_rsa
export PATH="/usr/local/opt/mongodb@3.6/bin:$PATH"

# FZF
export FZF_DEFAULT_COMMAND='
(git ls-tree -r --name-only HEAD ||
find . -path "*/\.*" -prune -o -type f -print -o -type l -print |
sed s/^..//) 2> /dev/null'

autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/local/bin/mc mc
5 changes: 4 additions & 1 deletion fresh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ brew install zsh
brew install tmux
brew install tmuxinator
brew install reattach-to-user-namespace
brew install bat

# npm install -g tldr

# Oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Expand Down Expand Up @@ -48,7 +51,7 @@ cp ~/dotfiles/Monokai.vim ~/.vim/colors/

# GIT
echo -e "\n\n\n" ssh-keygen -t rsa -b 4096 -C "boa.homan@gmail.com"
# ssh-keygen -t rsa -b 4096 -C "comment" -P "examplePassphrase" -f "desired pathAndName" -q
# ssh-keygen -t rsa -b 4096 -C "comment" -P "examplePassphrase" -f "desired pathAndName" -q
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

Expand Down
21 changes: 14 additions & 7 deletions tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ set -g prefix C-Space
bind Space send-prefix
# set -g prefix C-a

# Use m to toggle mouse mode
# unbind m
# bind m setw mouse
# a mouse
# set -g mode-mouse on
# setw -g mouse-select-window on
Expand Down Expand Up @@ -65,12 +68,15 @@ bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# set some pretty colors
# ----------------------
# set pane colors - highlight the active pane
set-option -g pane-border-fg colour15 #base02
set-option -g pane-active-border-fg colour12 #base01
# set-option -g pane-border-fg colour15 #base02
# set-option -g pane-active-border-fg colour12 #base01
set -g pane-border-style fg=colour15
set -g pane-active-border-style fg=colour12
# colorize messages in the command line
set-option -g message-bg black #base02
set-option -g message-fg brightred #orange
# set-option -g message-bg black
# set-option -g message-fg brightred
set -g message-style fg=brightred,bg=black
# ----------------------
# Status Bar
Expand All @@ -84,15 +90,16 @@ setw -g monitor-activity off
set -g visual-activity off
# set color for status bar
set-option -g status-bg default #base02
set-option -g status-bg default
set-option -g status-fg colour5
set-option -g status-attr dim
# set-option -g status-attr dim
set -g status-style default
# show session name, window & pane number,
# date and time on right side of status bar
set -g status-right-length 50
set -g status-left "#[fg=colour39]#S"
set -g status-right "#[fg=colour39]%d %b %Y :: %l:%M %p "
set -g status-right "#[fg=colour39]%a, %d %b %Y, #(date -u '+%%H:%%M') (%H:%M %Z)"
set -g window-status-format "#[fg=white,bg=default] #I #W "
set -g window-status-current-format "#[fg=colour17,bg=colour39,noreverse] #I #W "
Expand Down
51 changes: 51 additions & 0 deletions tmuxinator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ~/.tmuxinator/backend.yml

name: factory
root: ~/Projects/tulip

# Optional tmux socket
# socket_name: foo

# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start

# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247

# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf

# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu

# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: logs

# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false

# Runs after everything. Use it to attach to tmux with custom options etc.
# post: tmux -CC attach -t backend

windows:
- vim:
layout: even-horizontal
panes:
- vim
- cd ~/Projects/tulip
- server:
layout: main-vertical
panes:
- cd ~/Projects/tulip
- prod:
layout: main-vertical
panes:
- mulch t
- staging:
layout: main-vertical
panes:
- mulch --staging t
- proxy:
layout: main-vertical
panes:
- mulch prom-ui
22 changes: 11 additions & 11 deletions tmuxinator.yml.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ~/.tmuxinator/backend.yml

name: backend
root: ~/Projects/HB-Backend
name: factory
root: ~/Projects/tulip

# Optional tmux socket
# socket_name: foo
Expand Down Expand Up @@ -32,20 +32,20 @@ windows:
layout: even-horizontal
panes:
- vim
- bundle exec rails s
- dev:
- cd ~/Projects/tulip
- server:
layout: main-vertical
panes:
- bundle exec rails console
- staging:
- cd ~/Projects/tulip
- prod:
layout: main-vertical
panes:
- cd ~/Projects/HB-Backend
- prod:
- mulch t
- staging:
layout: main-vertical
panes:
- cd ~/Projects/HB-Backend
- zeus:
- mulch --staging t
- proxy:
layout: main-vertical
panes:
- zeus start
- mulch prom-ui
Loading

0 comments on commit 26841aa

Please sign in to comment.