-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
executable file
·58 lines (50 loc) · 2.14 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
### Initialization
source ~/.zsh_path
source ~/.zsh_aliases
source ~/.zsh_zinit
### File and Directory Operations
setopt auto_param_slash # Auto-append slash to directory names during tab completion
setopt mark_dirs # Mark directory names with a trailing slash during listing
setopt list_types # Indicate file types in directory listings
setopt auto_cd # Auto-cd into a directory by typing its name
### Shell Interactivity
setopt auto_menu # Auto-list choices on ambiguous tab completion
setopt auto_param_keys # Enable key-based parameter name completion
setopt interactive_comments # Allow comments in interactive shells
setopt always_last_prompt # Ensure prompt is always the last line on terminal
### Globbing and Pattern Matching
setopt extended_glob # Enable extended globbing features
setopt globdots # Include filenames starting with a dot in wildcard matches
setopt list_packed # Show globbed patterns as individual matches
### Miscellaneous
setopt magic_equal_subst # Allow filename expansion after equals sign in parameters
setopt complete_in_word # Allow tab completion in middle of word
setopt print_eight_bit # Print 8th bit set characters as is, no metafication
### Completion
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit
zstyle ':completion:*:default' menu select=2 # select by arrow keys
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' verbose yes
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' completer _expand _complete _match _prefix _approximate _list _history # set the completion strategy sequence
zstyle ':completion:*:options' description 'yes'
### History
setopt hist_ignore_dups
setopt hist_ignore_all_dups
setopt extended_history
setopt hist_no_store
setopt hist_reduce_blanks
setopt hist_save_no_dups
setopt share_history
function select-history() {
BUFFER=$(history -nr 1 | fzf -q "$LBUFFER" --prompt="History> " --reverse)
CURSOR=${#BUFFER}
}
zle -N select-history
bindkey '^r' select-history
# bun completions
[ -s "/Users/kmizuki/.bun/_bun" ] && source "/Users/kmizuki/.bun/_bun"
### Epilogue
typeset -U path PATH
source ~/.zsh_finalize