diff --git a/config/zshrc b/config/zshrc index 64bc8bc..ffb2c1b 100644 --- a/config/zshrc +++ b/config/zshrc @@ -3,12 +3,6 @@ source "${HOME}/.zgen.zsh" if ! zgen saved; then echo "Creating a zgen save" - zgen oh-my-zsh - omzplugs=(ssh-agent pyenv git) - # plugins - for plug in "${omzplugs[@]}"; do - zgen oh-my-zsh plugins/$plug - done zgen load zsh-users/zsh-syntax-highlighting # Themes diff --git a/nvim/nvimrc.plugins b/nvim/nvimrc.plugins index 9b262f6..2f34291 100644 --- a/nvim/nvimrc.plugins +++ b/nvim/nvimrc.plugins @@ -26,7 +26,6 @@ Plug 'jsx/jsx.vim' Plug 'mitsuhiko/jinja2', { 'rtp': 'ext/Vim' } Plug 'groenewege/vim-less' -Plug 'bbenne10/simpleburn' Plug 'morhetz/gruvbox' call plug#end() diff --git a/shell/copy.sh b/shell/copy.sh deleted file mode 100644 index 6594d3d..0000000 --- a/shell/copy.sh +++ /dev/null @@ -1,54 +0,0 @@ -copy() { - if [[ $1 =~ ^-?[hH] ]]; then - echo "Intelligently copies command results, text file, or raw text to" - echo "the clipboard" - echo - echo "Usage: copy [command or text]" - echo " or pipe a command: [command] | copy" - return - fi - - local output - local res=false - local tmpfile="${TMPDIR}/copy.$RANDOM.txt" - local msg="" - - if [[ $# == 0 ]]; then - output=$(cat) - msg="Input copied to clipboard" - res=true - else - local cmd="" - for arg in $@; do - cmd+="\"$(echo -en $arg|sed -E 's/"/\\"/g')\" " - done - output=$(eval "$cmd" 2> /dev/null) - if [[ $? == 0 ]]; then - msg="Results of command are in the clipboard" - res=true - else - if [[ -f $1 ]]; then - output="" - for arg in $@; do - if [[ -f $arg ]]; then - type=`file "$arg"|grep -c text` - if [ $type -gt 0 ]; then - output+=$(cat $arg) - msg+="Contents of $arg are in the clipboard.\n" - res=true - else - msg+="File \"$arg\" is not plain text.\n" - fi - fi - done - else - output=$@ - msg="Text copied to clipboard" - res=true - fi - fi - fi - - $res && echo -ne "$output" | pbcopy -Prefer txt - echo -e "$msg" -} diff --git a/shell/myfzf.sh b/shell/myfzf.sh deleted file mode 100644 index 9a0237d..0000000 --- a/shell/myfzf.sh +++ /dev/null @@ -1,60 +0,0 @@ - -# fh - repeat history -fh() { - print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//') -} - -# fkill - kill process -fkill() { - pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}') - - if [ "x$pid" != "x" ] - then - kill -${1:-9} $pid - fi -} - - -## Git - -# fbr - checkout git branch (including remote branches) -fbr() { - local branches branch - branches=$(git branch --all | grep -v HEAD) && - branch=$(echo "$branches" | - fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) && - git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##") -} - -# fco - checkout git branch/tag -fco() { - local tags branches target - tags=$( - git tag | awk '{print "\x1b[31;1mtag\x1b[m\t" $1}') || return - branches=$( - git branch --all | grep -v HEAD | - sed "s/.* //" | sed "s#remotes/[^/]*/##" | - sort -u | awk '{print "\x1b[34;1mbranch\x1b[m\t" $1}') || return - target=$( - (echo "$tags"; echo "$branches") | - fzf-tmux -l30 -- --no-hscroll --ansi +m -d "\t" -n 2) || return - git checkout $(echo "$target" | awk '{print $2}') -} - -# fshow - git commit browser -fshow() { - local out sha q - while out=$( - git log --decorate=short --graph --oneline --color=always | - fzf --ansi --multi --no-sort --reverse --query="$q" --print-query); do - q=$(head -1 <<< "$out") - while read sha; do - [ -n "$sha" ] && git show --color=always $sha | less -R - done < <(sed '1d;s/^[^a-z0-9]*//;/^$/d' <<< "$out" | awk '{print $1}') - done -} - -vs(){ - #List all vagrant boxes available in the system including its status, and try to access the selected one via ssh - cd $(cat ~/.vagrant.d/data/machine-index/index | jq '.machines[] | {name, vagrantfile_path, state}' | jq '.name + "," + .state + "," + .vagrantfile_path'| sed 's/^"\(.*\)"$/\1/'| column -s, -t | sort -rk 2 | fzf | awk '{print $3}'); vagrant ssh -} diff --git a/shell/python.sh b/shell/python.sh index 633d99f..f75ab5d 100644 --- a/shell/python.sh +++ b/shell/python.sh @@ -1,9 +1,9 @@ export PYENV_ROOT="$HOME/.pyenv" if $(which pyenv 2>&1 >/dev/null); then - eval "$(pyenv init -)" + eval "$(pyenv init --no-rehash -)" elif test -f $PYENV_ROOT/bin/pyenv; then - eval "$($PYENV_ROOT/bin/pyenv init -)" + eval "$($PYENV_ROOT/bin/pyenv init --no-rehash -)" fi test -d $PYENV_ROOT/plugins/pyenv-virtualenv && eval "$($PYENV_ROOT/bin/pyenv virtualenv-init -)" diff --git a/shell/ssh.sh b/shell/ssh.sh new file mode 100644 index 0000000..4551b3e --- /dev/null +++ b/shell/ssh.sh @@ -0,0 +1,10 @@ +if [[ -f ~/.ssh-find-agent.sh ]]; then + source ~/.ssh-find-agent.sh + ssh-find-agent -a + if [ -z "$SSH_AUTH_SOCK" ] + then + eval $(ssh_agent) > /dev/null + ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh' + fi +fi +