Adjustments for WSL and MacOS

main
Thomas Ba. 3 years ago
parent 75166934ec
commit 3f9dc9afdd

@ -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 # aliases
alias cd..='cd ..' alias cd..='cd ..'

@ -1,6 +1,8 @@
eval "$(gnome-keyring-daemon --start --daemonize --components=pkcs11,secrets,ssh,gpg)" if [ "$(uname)" != "Darwin" ] ; then
export SSH_AUTH_SOCK eval "$(gnome-keyring-daemon --start --daemonize --components=pkcs11,secrets,ssh,gpg)"
export GPG_AGENT_INFO export SSH_AUTH_SOCK
export GPG_AGENT_INFO
fi
# aliases # aliases

@ -27,6 +27,9 @@ case "$MTYPE" in
if [[ "$(ssh-add -l)" == "The agent has no identities." ]]; then if [[ "$(ssh-add -l)" == "The agent has no identities." ]]; then
ssh-add ssh-add
fi fi
if [ ! -f '/var/run/crond.pid' ] ; then
sudo /etc/init.d/cron start
fi
;; ;;
"SERVER") "SERVER")
source $HOME/.zsh/commands-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 source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
elif [ -f "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] ; then elif [ -f "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] ; then
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 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 else
printf "-!- zsh-syntax-highlighting not installed!" printf "-!- zsh-syntax-highlighting not installed!"
fi fi
# completion # completion
zstyle ':completion:*:*:kill:*:processes' command "ps -u $USER -o pid,user,comm,args -w -w" 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

Loading…
Cancel
Save