diff --git a/zsh/commands b/zsh/commands index ff0a9aa..11791cb 100644 --- a/zsh/commands +++ b/zsh/commands @@ -1,3 +1,32 @@ +# editor + +if command -v nvim &> /dev/null; then + alias vim=nvim + alias vi=nvim + export EDITOR='nvim' +elif command -v vim &> /dev/null; then + alias nvim=vim + alias vi=vim + export EDITOR='vim' +elif command -v nano &> /dev/null; then + alias nvim=nano + alias vim=nano + alias vi=nano + export EDITOR='nano' +elif command -v mcedit &> /dev/null; then + alias nvim=mcedit + alias vim=mcedit + alias vi=mcedit + export EDITOR='mcedit' +elif command -v vi &> /dev/null; then + alias nvim=vi + alias vim=vi + alias vi=vi + export EDITOR='vi' +fi +alias e=$EDITOR +alias :e=$EDITOR + # aliases alias cd..='cd ..' diff --git a/zsh/commands-pc b/zsh/commands-pc index 8cd042f..3c4eab3 100644 --- a/zsh/commands-pc +++ b/zsh/commands-pc @@ -1,6 +1,8 @@ -eval "$(gnome-keyring-daemon --start --daemonize --components=pkcs11,secrets,ssh,gpg)" -export SSH_AUTH_SOCK -export GPG_AGENT_INFO +if [ "$(uname)" != "Darwin" ] ; then + eval "$(gnome-keyring-daemon --start --daemonize --components=pkcs11,secrets,ssh,gpg)" + export SSH_AUTH_SOCK + export GPG_AGENT_INFO +fi # aliases diff --git a/zsh/zshrc.local b/zsh/zshrc.local index 0b874b3..386317a 100644 --- a/zsh/zshrc.local +++ b/zsh/zshrc.local @@ -27,6 +27,9 @@ case "$MTYPE" in if [[ "$(ssh-add -l)" == "The agent has no identities." ]]; then ssh-add fi + if [ ! -f '/var/run/crond.pid' ] ; then + sudo /etc/init.d/cron start + fi ;; "SERVER") source $HOME/.zsh/commands-server @@ -45,15 +48,11 @@ if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh elif [ -f "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] ; then source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +elif [ -f "/opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] ; then + source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh else printf "-!- zsh-syntax-highlighting not installed!" fi # completion zstyle ':completion:*:*:kill:*:processes' command "ps -u $USER -o pid,user,comm,args -w -w" - -export EDITOR='vim' - -if [ ! -f '/var/run/crond.pid' ] ; then - sudo /etc/init.d/cron start -fi