Skip to content

Instantly share code, notes, and snippets.

@shigemk2

shigemk2/.zshrc

Created Sep 20, 2015
Embed
What would you like to do?
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
# User configuration
export PATH=$HOME/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='/usr/bin/emacsclient'
else
export EDITOR='/usr/bin/emacsclient'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH="$HOME/bin:$PATH"
# function peco-select-history() {
# local tac
# if which tac > /dev/null; then
# tac="tac"
# else
# tac="tail -r"
# fi
# BUFFER=$(\history -n 1 | \
# eval $tac | \
# peco --query "$LBUFFER")
# CURSOR=$#BUFFER
# zle clear-screen
# }
# zle -N peco-select-history
function peco-select-history() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(\history -n 1 | eval $tac | awk '!a[$0]++' | peco --query "$LBUFFER")
CURSOR=$#BUFFER
# zle clear-screen
}
zle -N peco-select-history
bindkey '^r' peco-select-history
## Invoke the ``dired'' of current working directory in Emacs buffer.
function dired () {
emacsclient -e "(dired \"${1:a}\")"
}
## Chdir to the ``default-directory'' of currently opened in Emacs buffer.
function cde () {
EMACS_CWD=`emacsclient -e "
(expand-file-name
(with-current-buffer
(if (featurep 'elscreen)
(let* ((frame-confs (elscreen-get-frame-confs (selected-frame)))
(num (nth 1 (assoc 'screen-history frame-confs)))
(cur-window-conf (cadr (assoc num (assoc 'screen-property frame-confs))))
(marker (nth 2 cur-window-conf)))
(marker-buffer marker))
(nth 1
(assoc 'buffer-list
(nth 1 (nth 1 (current-frame-configuration))))))
default-directory))" | sed 's/^"\(.*\)"$/\1/'`
echo "chdir to $EMACS_CWD"
cd "$EMACS_CWD"
}
export GISTY_DIR="$HOME/projects/gists"
export GISTY_ACCESS_TOKEN=1cce4a27e0d2fb3365ebb4bfb334ef0e9a48a80d
export PATH=$PATH:/home/shigemk2/projects/activator
export PATH=$PATH:/home/shigemk2/projects/scala/bin
export PATH=$PATH:/home/shigemk2/.cabal/bin/
alias scala="rlwrap scala"
alias e="emacsclient -n"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# alias node="/usr/bin/node"
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$HOME/bin/cross/bin:$PATH
function peco-src () {
local selected_dir=$(ghq list -p | peco --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
zle -N peco-src
bindkey '^]' peco-src
function peco-cd () {
local selected_dir=$(find ~/ -type d | peco)
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
zle -N peco-cd
bindkey '^x^f' peco-cd
function gpi () {
[ "$#" -eq 0 ] && echo "Usage : gpi QUERY" && return 1
ghs "$@" | peco | awk '{print $1}' | ghq import
}
export PATH="/home/shigemk2/.cask/bin:$PATH"
export PATH="/home/shigemk2/projects/sbt/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
alias fuck='eval $(thefuck $(fc -ln -1))'
autoload -Uz compinit
compinit -u
fpath=(/home/shigemk2/projects/github.com/shigemk2/zsh-completions/src $fpath)
## rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
## gradle
export GRADLE_HOME=$HOME/bin/gradle
export PATH=$GRADLE_HOME/bin:$PATH
## emacs
export EMACS=/usr/local/bin/emacs
typeset -U PATH
## java
JAVA_OPTS="-Xms2048M -Xmx2048M -Xss1M -XX:MaxPermSize=512M -XX:-UseGCOverheadLimit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.