Skip to content

Instantly share code, notes, and snippets.

@luochen1990
Forked from zedongh/.zshrc
Last active May 23, 2019 06:41
Show Gist options
  • Save luochen1990/ff3d28a576b57edac62f6dab3778ffec to your computer and use it in GitHub Desktop.
Save luochen1990/ff3d28a576b57edac62f6dab3778ffec to your computer and use it in GitHub Desktop.
zsh config
[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
[[ -e ~/.shrc ]] && emulate sh -c 'source ~/.shrc'
source $HOME/.antigen.zsh
# POWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9k
antigen use oh-my-zsh
antigen bundles <<EOF
npm
node
docker
cabal
pyenv
python
scala
sbt
gradle
mvn
pip
lein
command-not-found
heroku
larkery/zsh-histdb
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
EOF
antigen theme bira
#antigen theme bhilburn/powerlevel9k powerlevel9k
antigen apply
# Configs for [histdb](https://github.com/larkery/zsh-histdb)
source ~/.antigen/bundles/larkery/zsh-histdb/sqlite-history.zsh
autoload -Uz add-zsh-hook
add-zsh-hook precmd histdb-update-outcome
_zsh_autosuggest_strategy_histdb_top(){
local query="select commands.argv from
history left join commands on history.command_id = commands.rowid
left join places on history.place_id = places.rowid
where commands.argv LIKE '$(sql_escape $1)%'
group by commands.argv
order by places.dir != '$(sql_escape $PWD)', count(*) desc limit 1"
suggestion=$(_histdb_query "$query")
}
ZSH_AUTOSUGGEST_STRATEGY=histdb_top
source histdb-interactive.zsh
bindkey '^r' _histdb-isearch
curl -L git.io/antigen > .antigen.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment