aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/.zshrc
blob: 2ee6b6c67795a9f5cd1f9b4b45fd49c87c6975c9 (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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# source zsh extensions (order is important)
source ~/.config/shell/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.config/shell/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
source ~/.config/shell/git-prompt.zsh
source ~/.config/shell/git-prompts/kj_sh604.zsh
# source ~/.config/shell/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh


# configure history settings
HISTFILE=~/.local/state/shell/zsh_history
HISTSIZE=9223372036854775804
SAVEHIST=9223372036854775804

# aliases
    # personal aliases
        alias ls="ls --group-directories-first -h -p --color -F"
        alias s="cd ~/.local/bin && ls"
        alias d="disown"
        alias c="cal"
        alias w="curl wttr.in"
        alias x="startx"
        alias t="timedatectl"
        alias p="command yay"
        alias pu="command yay -Syyu --answerclean yes --rebuildall --noconfirm"
        alias yay="echo"
        alias neofetch="alsi"
        alias grep='grep --colour=auto'
        alias egrep='grep -E'
        alias fgrep='grep -F'

    # youtube-dl aliases
        alias yt-mp4="youtube-dl -cif 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'"
        alias yt-webm="youtube-dl -cif 'bestvideo[ext=webm]+bestaudio[ext=webm]/best[ext=webm]/best'"
        alias yt-m4a="youtube-dl -cif 'bestaudio[ext=m4a]'"

    # pomodoro timer aliases
        alias work="timer 30m && notify-send \
        'Pomodoro' 'Work Timer is up! Take a Break 😊' -i \
        ~/.cache/pomo/pomo-tomato.png -t 30000 -w -A 'Dismiss'\
        & disown; mpv '/home/kylert/.cache/pomo/pomo-sound.mp3'"
        
        alias rest="timer 10m && notify-send \
        'Pomodoro' 'Break is over! Get back to work 😬' -i \
        ~/.cache/pomo/pomo-tomato.png -t 30000 -w -A 'Dismiss'\
        & disown; mpv '/home/kylert/.cache/pomo/pomo-sound.mp3'"

    # experimental rust-uutits substitutions for testing
        alias basenc=uu-basenc
        alias groups=uu-groups
        alias hostname=uu-hostname
        alias join=uu-join
        alias kill=uu-kill
        alias pathchk=uu-pathchk
        alias realpath=uu-realpath
        alias touch=uu-touch

# pfetch stuff 
export PF_INFO="ascii title os kernel uptime pkgs memory"

# initiate the prompt configuration with color support
autoload -Uz colors && colors

# load auto/tab completion and include hidden files
autoload -Uz compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)

# opt-in for automatic directory navigation and disallow terminal freeze via ctrl-s 
setopt AUTO_CD NO_FLOW_CONTROL
setopt INTERACTIVE_COMMENTS

# enable vi mode and setup keys for tab completion
bindkey -v
export KEYTIMEOUT=1
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char

# edit line in vim with ctrl-e
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
bindkey -M vicmd '^[[P' vi-delete-char
bindkey -M vicmd '^e' edit-command-line
bindkey -M visual '^[[P' vi-delete

# cursor shape settings for vi modes
function zle-keymap-select() {
    case $KEYMAP in
        vicmd)
            print -n '\e[2 q'
            ;;
        viins|main)
            print -n '\e[6 q'
            ;;
    esac
}
zle -N zle-keymap-select

zle-line-init() {
    zle -K viins
    print -n "\e[6 q"
}
zle -N zle-line-init
print -n '\e[6 q'

# disable blinking cursor after each command execution
function disable_blinking_cursor() {
    print -n '\e[0 q'
}
precmd_functions+=(disable_blinking_cursor)
disable_blinking_cursor

# less termcap variables (for colored man pages)
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;31m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;33m'

bindkey "^ " forward-word