diff options
Diffstat (limited to 'config/zshrc')
-rw-r--r-- | config/zshrc/.zshrc | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/config/zshrc/.zshrc b/config/zshrc/.zshrc index 574e631..47078d1 100644 --- a/config/zshrc/.zshrc +++ b/config/zshrc/.zshrc @@ -4,8 +4,6 @@ export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/bin:$PATH" export PATH="$HOME/go/bin:$PATH" -test -f ~/.config/zsh/variables.zsh && source ~/.config/zsh/variables.zsh - if [ ! $(pgrep Xorg) ] && [ "tty1" = "$(basename $(tty))" ] then clear @@ -16,18 +14,26 @@ then fi autoload -U select-word-style -select-word-style bash autoload -z edit-command-line zle -N edit-command-line zstyle ':compinstall' filename '/home/aluc/.zshrc' zstyle ':completion:*' menu select autoload -Uz compinit -compinit - autoload -Uz surround zle -N delete-surround surround zle -N add-surround surround zle -N change-surround surround +compinit + +for f in \ + /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh \ + /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \ + ~/.config/zsh/functions.zsh \ + ~/.config/zsh/aliases.zsh +do + test -f $f && source $f +done + bindkey -v bindkey -a cs change-surround bindkey -a ds delete-surround @@ -35,8 +41,8 @@ bindkey -a ys add-surround bindkey -M visual S add-surround bindkey "^A" beginning-of-line bindkey "^E" end-of-line -# necessary for completeinword -bindkey '^I' expand-or-complete-prefix +bindkey '^I' expand-or-complete-prefix # necessary for completeinword +bindkey '^Y' autosuggest-accept bindkey "^K" kill-line bindkey "^P" up-line-or-history bindkey "^N" down-line-or-history @@ -60,6 +66,10 @@ rehash_precmd() { } add-zsh-hook -Uz precmd rehash_precmd +# prompt +PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' +RPROMPT='%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)' + setopt prompt_subst parse_git_branch() { git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null @@ -67,12 +77,9 @@ parse_git_branch() { parse_git_status() { git status --short 2> /dev/null | head -n1 | awk '{print $1 " "}' } -PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' -RPROMPT='%F{red}$(parse_git_status)%f%F{green}$(parse_git_branch)%f%(?.. %?)' # Options setopt correct -#I am scared of "no matches found" setopt nonomatch setopt autocd setopt completeinword @@ -83,15 +90,30 @@ setopt interactivecomments setopt notify setopt cdablevars -for f in \ - /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh \ - /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \ - ~/.config/zsh/functions.zsh \ - ~/.config/zsh/aliases.zsh -do - test -f $f && source $f -done - +# Variables HISTFILE=~/.config/zsh/histfile HISTSIZE=100000 SAVEHIST=100000 + +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10' + +export ZOT="${HOME}/zot" + +export EDITOR="nvim" +export VISUAL="nvim" +export TERMINAL="alacritty" +export BROWSER="firefox" + +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +export XINITRC="$HOME/.config/x11/xinitrc" +export GNUPGHOME="$HOME/.config/gnupg" +export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" + +export PASSWORD_STORE_CLIP_TIME=5 + +# old +# export RANGER_LOAD_DEFAULT_RC=FALSE +# export VIMINIT="source ~/.config/vim/vimrc" +# export NVM_DIR="$HOME/.config/nvm" +# export fpath=($HOME/.config/zsh/completion/ $fpath) |