-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_zshrc
102 lines (86 loc) · 2.75 KB
/
_zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
###############################################
# Mahito .zshrc file
# initial setup file for only interactive zsh
# This file is read after .zshenv file is read
# Created by Mahito for 4.3.10
###############################################
# Set Shell variable
# WORDCHARS=$WORDCHARS:s,/,,
# 履歴サイズ、保存ファイル、保存数を設定
HISTSIZE=20000 HISTFILE=~/.zhistory SAVEHIST=20000
# プロンプト前方に"マシン名{ユーザ名}% "で表示
PROMPT='%m(%n)%% '
# プロンプト後方に"[カレントディレクトリ"]を表示
RPROMPT='[%~]'
# Set shell option
# Enable option is less mutable
# Disable option is conbiniente, but more mutable
setopt auto_cd auto_remove_slash auto_name_dirs auto_pushd
setopt extended_history hist_ignore_dups hist_ignore_space prompt_subst
setopt extended_glob list_types no_beep always_last_prompt
setopt cdable_vars sh_word_split auto_param_keys pushd_ignore_dups
setopt correct list_packed nolistbeep
#setopt auto_menu correct rm_star_silent sun_keyboard_hack
#setopt share_history inc_append_history
# Alias and functions
alias copy='cp -ip' del='rm -i' move='mv -i'
alias ls='ls -F -G' la='ls -a' ll='ls -la'
alias pu=pushd po=popd dirs='dirs -v'
alias .='source'
alias df='df -h' du='du -h'
alias vi='vim'
alias aptitude='sudo aptitude'
alias service= 'sudo service'
alias reboot='sudo reboot'
alias shutdown='sudo shutdown -h now'
alias be='bundle exec'
mdcd () {mkdir -p "$@" && cd "$*[-1]"}
mdpu () {mkdir -p "$@" && pushd "$*[-1]"}
# Suffix aliases
alias -s dvi=xdvi
alias -s {odt,ods,odp,doc,xls,ppt}=soffice
alias -s {tgz,lzh,zip,arc}=file-roller
# binding keys
bindkey -e
#bindkey '^p' history-beginning-search-backward
#bindkey '^n' history-beginning-search-forward
# 補完システムを利用
zstyle ':completion:*' format '%BCompleting %d%b'
zstyle ':completion;*' group-name ''
autoload -U compinit && compinit
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^p" history-beginning-search-backward-end
bindkey "^n" history-beginning-search-forward-end
autoload zed
autoload colors
colors
# anyenv setting
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init - zsh)"
# Java setting
export JAVA_HOME=`/usr/libexec/java_home`
# Golang Setting
export GOPATH="$HOME/.go"
export PATH="$GOPATH/bin:$PATH"
export GOROOT=`go env GOROOT`
function do_enter() {
if [ -n "$BUFFER" ]; then
zle accept-line
return 0
fi
ls_abbrev
echo
ls -a
if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ]; then
echo
echo -e "\e[0;33m--- git status ---\e[0m"
git status -sb
fi
zle reset-prompt
return 0
}
zle -N do_enter
bindkey '^m' do_enter
eval "$(direnv hook zsh)"