aboutsummaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
authorHumphrey Lin <[email protected]>2020-12-01 21:13:29 +0800
committerHumphrey Lin <[email protected]>2020-12-01 21:13:29 +0800
commit0b5c0e2e318ed131200183c6d32e9cab30952b12 (patch)
tree2f6bbca3cac8856243871f8bbe699a9549110b66 /.zshrc
parent7fdb35cec7474819c6e39678b4dceb0053113867 (diff)
parent514eab77de4da4b9ffb4c411d81729d04e55588f (diff)
downloaddotfiles-0b5c0e2e318ed131200183c6d32e9cab30952b12.tar.gz
dotfiles-0b5c0e2e318ed131200183c6d32e9cab30952b12.tar.bz2
dotfiles-0b5c0e2e318ed131200183c6d32e9cab30952b12.zip
Add config for ruby on macOS
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc19
1 files changed, 16 insertions, 3 deletions
diff --git a/.zshrc b/.zshrc
index 474becf..652f00c 100644
--- a/.zshrc
+++ b/.zshrc
@@ -3,15 +3,16 @@ setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
+EDITOR=vim
+
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
-export EDITOR=/usr/bin/vim
-
# file
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
+[[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
# proxy
@@ -24,6 +25,9 @@ export no_proxy=localhost,127.0.0.1
case `uname` in
Darwin)
# commands for macOS
+
+ # ruby
+ [ -d /usr/local/opt/ruby/bin ] && export PATH="/usr/local/opt/ruby/bin:$PATH"
;;
Linux)
# commands for Linux
@@ -33,15 +37,24 @@ FreeBSD)
;;
esac
+# WSL 2
+if [[ `uname -a` =~ "microsoft" ]]; then
+ export hostip=$(cat /etc/resolv.conf | grep -oP '(?<=nameserver\ ).*')
+ export http_proxy="socks5://${hostip}:7890"
+ export https_proxy="socks5://${hostip}:7890"
+ export all_proxy="socks5://${hostip}:7890"
+fi
+
# zplug
if [ ! -d ~/.zplug ]; then
echo 'Installing zplug ... '
- git clone [email protected]:zplug/zplug.git ~/.zplug
+ git clone https://github.com/zplug/zplug.git ~/.zplug
fi
source ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting"
+zplug "zsh-users/zsh-autosuggestions"
zplug "dracula/zsh", as:theme
if ! zplug check --verbose; then
printf "Install? [y/N]: "