aboutsummaryrefslogtreecommitdiffhomepage
path: root/zsh/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/zshrc')
-rw-r--r--zsh/zshrc33
1 files changed, 26 insertions, 7 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index 01e97cf..1958b56 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -4,20 +4,30 @@
4# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 4# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
5ZSH_THEME="archcraft" 5ZSH_THEME="archcraft"
6 6
7
7# helper repo 8# helper repo
8export SETTING_DIR=$HOME/helper 9export SETTING_DIR=$HOME/helper
9source $SETTING_DIR/tools/init/load-settings.sh 10source $SETTING_DIR/tools/init/load-settings.sh
10fpath=($SETTING_DIR/zsh $fpath) 11fpath=($SETTING_DIR/zsh $fpath)
11 12
13
12# Options 14# Options
13setopt extended_glob 15setopt extended_glob
14setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. 16setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
15 17
16_comp_options+=(globdots) # With hidden files 18
19# Edit Command Line
20autoload -Uz edit-command-line; zle -N edit-command-line
21bindkey -- "^X^E" edit-command-line
22
23
24# Enable completion
17autoload -Uz compinit; compinit 25autoload -Uz compinit; compinit
26_comp_options+=(globdots) # With hidden files
18zstyle ':completion:*' menu select 27zstyle ':completion:*' menu select
19zstyle ':completion::complete:*' gain-privileges 1 28zstyle ':completion::complete:*' gain-privileges 1
20 29
30
21# PS1 with git status at right 31# PS1 with git status at right
22autoload -Uz add-zsh-hook 32autoload -Uz add-zsh-hook
23add-zsh-hook precmd precmd 33add-zsh-hook precmd precmd
@@ -27,13 +37,14 @@ function precmd() {
27 RPROMPT="%B%K{red}%F{black}${RIGHT}%f%k%b" 37 RPROMPT="%B%K{red}%F{black}${RIGHT}%f%k%b"
28} 38}
29 39
40
30# Directory Stack 41# Directory Stack
31#setopt AUTO_PUSHD # Push the current directory visited on the stack. 42setopt AUTO_PUSHD # Push the current directory visited on the stack.
32#setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack. 43setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack.
33#setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd. 44setopt PUSHD_SILENT # Do not print the directory stack after pushd or popd.
45alias d='dirs -v'
46for index ({1..9}) alias "$index"="cd +${index}"; unset index
34 47
35#alias d='dirs -v'
36#for index ({1..9}) alias "$index"="cd +${index}"; unset index
37 48
38# create a zkbd compatible hash; 49# create a zkbd compatible hash;
39# to add other keys to this hash, see: man 5 terminfo 50# to add other keys to this hash, see: man 5 terminfo
@@ -66,7 +77,6 @@ bindkey -- "\C-b" backward-char
66bindkey -- "\C-f" forward-char 77bindkey -- "\C-f" forward-char
67bindkey -- "\Eb" backward-word 78bindkey -- "\Eb" backward-word
68bindkey -- "\Ef" forward-word 79bindkey -- "\Ef" forward-word
69bindkey -- "\C-x-\C-e" edit-command-line
70bindkey -- "\C-v" quoted-insert 80bindkey -- "\C-v" quoted-insert
71bindkey -- "\E." insert-last-word 81bindkey -- "\E." insert-last-word
72bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history 82bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
@@ -74,6 +84,15 @@ bindkey -- "${key[PageDown]}" end-of-buffer-or-history
74bindkey -- "${key[Shift-Tab]}" reverse-menu-complete 84bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
75#bindkey -- "${key[Insert]}" overwrite-mode 85#bindkey -- "${key[Insert]}" overwrite-mode
76 86
87
88# Common shell options
89alias ls='ls --color'
90
91
92# Quick jump to parent folders
93source ~/helper/zsh/bd.zsh
94
95
77# Finally, make sure the terminal is in application mode, when zle is 96# Finally, make sure the terminal is in application mode, when zle is
78# active. Only then are the values from $terminfo valid. 97# active. Only then are the values from $terminfo valid.
79if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then 98if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then