summaryrefslogtreecommitdiff
path: root/.zshrc
blob: bc64b7218bf9c84f5a911d841bde0606e2366f58 (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
#!/bin/zsh

# Exports

export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

export XDG_DOWNLOAD_DIR="${HOME}/downloads"

export EDITOR="nvim"

export PATH="${PATH}:${HOME}/.local/bin"
export PATH="${PATH}:${HOME}/.cargo/bin"
export ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}"

export QT_QPA_PLATFORM="wayland-egl"
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ General                         		                    ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

export HISTFILE="${HOME}/.zsh_history"
export HISTCONTROL="ignoredups:ignorespace"
export HISTSIZE="100000"
export HISTFILESIZE="200000"
export SAVEHIST="${HISTSIZE}"
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS 
setopt HIST_VERIFY
setopt SHARE_HISTORY

export TERM="xterm-256color"
export COLUMNS="80"

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ ZSH Plugins                         		                ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

ZSH_CUSTOM="$ZDOTDIR/plugins"

plugins=(
  zsh-autosuggestions
  zsh-syntax-highlighting
)

for plugin in $plugins; do
  source "$ZSH_CUSTOM/$plugin/${plugin}.zsh"
done

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#999999"

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Completion system (modern menu)		                      ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

autoload -Uz compinit && compinit
zstyle ':completion:*' menu select	# arrow-key menu
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'  # case insensitive
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # colored completion
zstyle ':completion:*' rehash true                # auto-refresh completion if new programs installed

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Keybinds		            			                          ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

bindkey '^[[Z' autosuggest-accept   # Shift+Tab accepts suggestion
bindkey '^ ' autosuggest-accept     # Ctrl+Space also accepts
bindkey '^[[A' history-beginning-search-backward  # Up arrow: search history
bindkey '^[[B' history-beginning-search-forward   # Down arrow: search history

# Common bindings for Alt + Arrow (Meta + Arrow)
bindkey '^[[1;3C' forward-word      # Alt + Right
bindkey '^[[1;3D' backward-word     # Alt + Left

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Alias		            	    		                          ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

alias ls='ls --color=auto --group-directories-first'
alias ll='ls -lh --color=auto --group-directories-first'
alias la='ls -lah --color=auto --group-directories-first'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Prompt with git status		            	                ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

# Load version control info
autoload -Uz vcs_info

# Load colors
autoload -Uz colors && colors

# Run vcs_info before each prompt
precmd_functions+=(vcs_info)

# Enable prompt substitution
setopt prompt_subst

# Configure the format for git
zstyle ':vcs_info:git:*' formats ' (%b)'
zstyle ':vcs_info:git:*' enable git

# Set the PROMPT variable to include the vcs_info_msg_0_ variable
PROMPT='%F{#bb9af7}%~%f%F{#7dcfff}${vcs_info_msg_0_}%f %# '