From a98a44ba5d3b126f4a217a3045f51a41acc9e527 Mon Sep 17 00:00:00 2001 From: Andrea Mistrali Date: Thu, 28 Oct 2021 10:11:01 +0200 Subject: [PATCH] Test of integration of brew and utils --- .gitmodules | 3 +++ zsh.d/10-environment.zsh | 18 +++++++++++++----- zsh.d/50-functions.zsh | 31 ++++++++++--------------------- zsh.d/90-plugins.zsh | 12 ++++++++++++ zsh.d/Darwin/50-darwin.zsh | 7 +++---- zsh.d/plugins/zsh-z | 1 + 6 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 zsh.d/90-plugins.zsh create mode 160000 zsh.d/plugins/zsh-z diff --git a/.gitmodules b/.gitmodules index 501386b..1bbdd2a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "zsh.d/prompts/pure"] path = zsh.d/prompts/pure url = https://github.com/sindresorhus/pure.git +[submodule "zsh.d/plugins/zsh-z"] + path = zsh.d/plugins/zsh-z + url = https://github.com/agkozak/zsh-z diff --git a/zsh.d/10-environment.zsh b/zsh.d/10-environment.zsh index c1f911e..4bc536a 100644 --- a/zsh.d/10-environment.zsh +++ b/zsh.d/10-environment.zsh @@ -3,8 +3,6 @@ ## Vars used always PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin:." -# LANG="it_IT.UTF-8" -# TZ='Europe/Rome' MIBS=all LOGD=/var/log @@ -27,10 +25,20 @@ EDITOR=vim VISUAL=vim export QUOTING_STYLE=escape -# -# Hack for svn -export SVN_EDITOR=${VISUAL} + + +# Setup brew +# We need it here to fix the PATH +# so we can setup pyenv and other stuff + +for prefix in /usr/local /opt/homebrew; do + brew=$(whence $prefix/bin/brew) + if [ $brew ]; then + eval "$($brew shellenv)" + fi +done # Set umask to collaborative mode umask 002 + # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/50-functions.zsh b/zsh.d/50-functions.zsh index 1ebb592..f17dc06 100644 --- a/zsh.d/50-functions.zsh +++ b/zsh.d/50-functions.zsh @@ -1,29 +1,18 @@ ####################################################################################### # Functions - -# cdb - Goes to folder by complete path -autoload -U cdb - -# hist - Grep from history -autoload -U hist - -# hdu - Human readable report of files and directories sizes -autoload -U hdu - -# dust - list total size in . directory -autoload -U dust - -# bak - remove backup files -autoload -U bak # -# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false -autoload -U fancyTerm +# Autoload all functions in zshfunctions +# +autoload -U ./zshfunctions/*(.:t) -# # repo_char - returns a character based on the type of repo we are in -# autoload -U repo_char +# # cdb - Goes to folder by complete path +# autoload -U cdb -autoload -U x509 +# # bak - remove backup files +# autoload -U bak -autoload -U awsprofile +# autoload -U x509 + +# autoload -U awsprofile # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/90-plugins.zsh b/zsh.d/90-plugins.zsh new file mode 100644 index 0000000..12e183e --- /dev/null +++ b/zsh.d/90-plugins.zsh @@ -0,0 +1,12 @@ +# pyenv +if type pyenv; then + export PYENV_ROOT="$HOME/.pyenv" + eval "$(pyenv init --path)" + eval "$(pyenv init -)" +fi + +# thefuck +type thefuck && eval $(thefuck --alias) + +#z +type ./plugins/zsh-z/zsh-z.plugin.zsh && source ./plugins/zsh-z/zsh-z.plugin.zsh diff --git a/zsh.d/Darwin/50-darwin.zsh b/zsh.d/Darwin/50-darwin.zsh index 417b4fe..f02fdac 100644 --- a/zsh.d/Darwin/50-darwin.zsh +++ b/zsh.d/Darwin/50-darwin.zsh @@ -6,9 +6,8 @@ alias ls='ls -F -G' alias skill=killall alias lsrebuild='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user' -# alias vim='/Applications/MacVim.app/Contents/MacOS/Vim ' -# alias vi='/Applications/MacVim.app/Contents/MacOS/Vim ' -# alias mvim='mvim --remote-tab-silent ' -# alias mvim='open -a MacVim ' +# Setup iTerm shell integration +test -e $HOME/.iterm2_shell_integration.zsh && source $HOME/.iterm2_shell_integration.zsh && export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=YES || echo "iTerm sh integration not installed" + # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh.d/plugins/zsh-z b/zsh.d/plugins/zsh-z new file mode 160000 index 0000000..9eb7b94 --- /dev/null +++ b/zsh.d/plugins/zsh-z @@ -0,0 +1 @@ +Subproject commit 9eb7b94c87adb56d09680a8eee543dc9f2cd86c0