@@ -11,16 +11,10 @@ ZSH_THEME="ham"
1111# Uncomment the following line to display red dots whilst waiting for completion.
1212COMPLETION_WAITING_DOTS=" true"
1313
14- plugins=(git laravel5 command-not-found common-aliases composer docker git-extras git-flow gitignore gulp node npm pip ssh-agent supervisor tmux vagrant vim-interaction battery last-working-dir themes)
14+ plugins=(git laravel5 command-not-found common-aliases composer docker git-extras git-flow gitignore gulp node npm pip ssh-agent tmux vagrant vim-interaction last-working-dir themes)
1515
1616# User configuration
17- export PATH=" /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:~/PhpStorm-144.3656/bin:$PATH "
18-
19- if [ ` uname -o` = " Cygwin" ]; then
20- export VAGRANT_DETECTED_OS=cygwin
21- VAGRANT_HOME=/cygdrive/c/Users/edbiz/
22- export VAGRANT_HOME
23- fi
17+ export PATH=" /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:~/PhpStorm-144.3656/bin:/usr/local/terraform/bin:/home/edbizarro/terraform:$PATH "
2418
2519source $ZSH /oh-my-zsh.sh
2620
@@ -72,6 +66,51 @@ BASE16_SHELL="$HOME/.base16-shell/base16-ocean.dark.sh"
7266
7367fpath=(~/.zsh/completion $fpath )
7468
69+ # ################
70+ # ## FUNCTIONS ###
71+ # ################
72+
73+ lsp () {
74+ lpass show -c --password $( lpass ls | fzf | awk ' {print $(NF)}' | sed ' s/\]//g' )
75+ }
76+
77+ # fbr - checkout git branch (including remote branches)
78+ fbr () {
79+ local branches branch
80+ branches=$( git branch --all | grep -v HEAD) &&
81+ branch=$( echo " $branches " |
82+ fzf-tmux -d $(( 2 + $(wc - l <<< "$branches ") )) +m) &&
83+ git checkout $( echo " $branch " | sed " s/.* //" | sed " s#remotes/[^/]*/##" )
84+ }
85+
86+ fkill () {
87+ pid=$( ps -ef | sed 1d | fzf -m | awk ' {print $2}' )
88+
89+ if [ " x$pid " != " x" ]
90+ then
91+ kill -${1:- 9} $pid
92+ fi
93+ }
94+
95+ ftpane () {
96+ local panes current_window current_pane target target_window target_pane
97+ panes=$( tmux list-panes -s -F ' #I:#P - #{pane_current_path} #{pane_current_command}' )
98+ current_pane=$( tmux display-message -p ' #I:#P' )
99+ current_window=$( tmux display-message -p ' #I' )
100+
101+ target=$( echo " $panes " | grep -v " $current_pane " | fzf +m --reverse) || return
102+
103+ target_window=$( echo $target | awk ' BEGIN{FS=":|-"} {print$1}' )
104+ target_pane=$( echo $target | awk ' BEGIN{FS=":|-"} {print$2}' | cut -c 1)
105+
106+ if [[ $current_window -eq $target_window ]]; then
107+ tmux select-pane -t ${target_window} .${target_pane}
108+ else
109+ tmux select-pane -t ${target_window} .${target_pane} &&
110+ tmux select-window -t $target_window
111+ fi
112+ }
113+
75114# ALIAS
76115
77116alias ls=' ls -Glah --color=always'
@@ -103,11 +142,13 @@ alias vbu='vagrant box update'
103142alias cu=' composer update --prefer-dist'
104143alias ci=' composer install --prefer-dist'
105144
106- # NPM
145+ # NPM
107146alias ni=' npm install'
108147alias nig=' npm install -g'
109148
110149# GULP
111150
112151alias g=' gulp'
113152alias gw=' gulp watch'
153+
154+ [ -f ~ /.fzf.zsh ] && source ~ /.fzf.zsh
0 commit comments