aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/zsh/zshrc
blob: 935eb7c8a8b0e30458b4bda8311b4f2da9b63b5f (plain)
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
#!/usr/bin/env zsh

HYPHEN_INSENSITIVE="true"
DISABLE_UPDATE_PROMPT="true"
DISABLE_AUTO_TITLE="true"
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000

setopt NO_BEEP
setopt MENU_COMPLETE
setopt extended_history       # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups       # ignore duplicated commands history list
setopt hist_ignore_space      # ignore commands that start with space
setopt hist_verify            # show command with history expansion to user before running it
setopt share_history          # share command history data

typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern line)
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd completion)

fpath=(~/.local/share/zsh/site-functions "${fpath[@]}")

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
for f in ~/.zsh/*.*sh; do source $f; done

eval "$(starship init zsh)"

function set_win_title() {
    folder=$(sed "s/$USER/~/g" <<<$PWD:t)

    window_title="\033]0;$USER@$HOST: $folder\007"
    echo -ne "$window_title"
}

precmd_functions+=(set_win_title)

autoload -U compinit
compinit -i

zstyle ':completion:*' menu select
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh