dotfiles/.zshrc

121 lines
2.7 KiB
Bash
Raw Normal View History

2015-11-20 16:18:27 +00:00
platform=`uname`
2012-11-05 03:36:12 +00:00
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.zsh
2015-11-21 18:54:14 +00:00
# Plugins to enable - they are found in .zsh/plugins
2015-11-21 18:54:28 +00:00
PLUGINS=(safe-paste)
2015-11-21 18:54:14 +00:00
fpath=($fpath $ZSH/func)
typeset -U fpath
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($PLUGINS); do
if is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
fi
done
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($PLUGINS); do
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi
done
# Setup the custom prompt
2012-11-05 03:36:12 +00:00
setopt promptsubst
autoload -U promptinit
promptinit
prompt grb
2015-11-17 22:03:27 +00:00
# Linux specific config
2015-11-17 05:10:09 +00:00
if [[ $platform == 'Linux' ]]; then
2015-11-17 22:03:27 +00:00
# Set caps to ctrl
2020-03-15 18:44:36 +00:00
#setxkbmap -option 'caps:ctrl_modifier'
2015-11-17 22:03:27 +00:00
# Make caps act as Esc when tapped. Require `xcape` package.
2020-03-15 18:44:36 +00:00
#xcape -e 'Caps_Lock=Escape'
2015-11-17 05:10:09 +00:00
fi
2015-11-21 18:54:14 +00:00
# Autoload things before calling compinit
2015-11-17 05:10:09 +00:00
autoload -Uz compinit
2020-08-09 19:25:35 +00:00
compinit -i
2012-11-05 03:36:12 +00:00
2013-07-07 21:25:47 +00:00
# Never know when you're gonna need to popd!
setopt AUTO_PUSHD
2012-11-05 03:36:12 +00:00
2013-07-07 21:25:47 +00:00
# Allow completing of the remainder of a command
bindkey "^N" insert-last-word
2012-11-05 03:36:12 +00:00
2013-07-07 21:25:47 +00:00
# Show contents of directory after cd-ing into it
chpwd() {
if [[ $platform == 'Linux' ]]; then
ls -lrthG --color
elif [[ $platform == 'Darwin' ]]; then
2014-12-03 19:49:47 +00:00
ls -lG
fi
2013-07-07 21:25:47 +00:00
}
2012-11-05 03:36:12 +00:00
2013-07-07 21:25:47 +00:00
# Save a ton of history
export HISTSIZE=20000
2012-11-05 03:36:12 +00:00
export HISTFILE="$HOME/.history"
2020-08-09 19:25:35 +00:00
export HISTCONTROL=ignoredups
2012-11-05 03:36:12 +00:00
export SAVEHIST=$HISTSIZE
2015-11-17 05:10:09 +00:00
setopt appendhistory autocd
bindkey -e
2012-11-05 03:36:12 +00:00
2020-08-09 19:25:35 +00:00
# Unbreak broken, non-colored terminal
export TERM=xterm-256color
# Use vim as the editor
export EDITOR=vim
# Homebrew setup
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_INSECURE_REDIRECT=1
export HOMEBREW_CASK_OPTS=--require-sha
# Ruby
export RBENV_PATH="$HOME/.rbenv"
# Clojure
export LEIN_FAST_TRAMPOLINE=y
if [ -d "$HOME/.rbenv" ]; then
# Start rbenv
eval "$(rbenv init -)"
fi
2013-07-07 21:25:47 +00:00
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
2013-07-07 21:30:11 +00:00
# Load all of the config files in ~/.zsh that end in .zsh
2013-08-22 20:19:18 +00:00
source $ZSH/lib/*.zsh
2013-07-07 21:30:11 +00:00
2013-07-07 21:25:47 +00:00
# Source my custom files after oh-my-zsh so I can override things.
2020-08-09 19:25:35 +00:00
test -f $HOME/.env.common && . $HOME/.env.common
2015-11-29 23:25:11 +00:00
# Fix <c-h> in neovim
infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $HOME/.$TERM.ti
tic $HOME/.$TERM.ti