serene/scripts/zsh/.zshrc

73 lines
2.3 KiB
Bash

#! /bin/zsh
# shellcheck disable=all
# Serene Programming Language
#
# Copyright (c) 2019-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
mkdir -p "$HOME/.config/serene/"
export HISTFILE="$HOME/.config/serene/.zsh_history"
export HISTFILESIZE=500
export SAVEHIST=500
export HISTSIZE=500
setopt HIST_IGNORE_DUPS
setopt NO_HIST_BEEP
setopt PROMPT_SUBST
setopt NO_BEEP
setopt AUTO_CD
setopt CORRECT
setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
function user_prompt () {
if [ $UID != 0 ]; then
echo "%F{028}%F{002}> "
else
echo "%F{001}# "
fi
}
autoload -U colors && colors
autoload -Uz compinit
compinit
# zstyle ':completion:*' auto-description 'specify: %d'
# zstyle ':completion:*' completer _expand _complete _correct _approximate
# zstyle ':completion:*' format 'Completing %d'
# zstyle ':completion:*' group-name ''
# if [ "$(uname 2> /dev/null)" = "Linux" ]; then
# zstyle ':completion:*' menu select=2 eval "$(dircolors -b)"
# fi
# zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# zstyle ':completion:*' list-colors ''
# zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
# zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
# zstyle ':completion:*' menu select=long
# zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
# zstyle ':completion:*' use-compctl false
# zstyle ':completion:*' verbose true
# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
# zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
echo "Welcome to serene's development environment"
PROMPT='
%F{015}[%F{099}SERENE%F{015}][%F{198}$(git branch --show-current)%F{015}]
%F{005}%~%F{003} $(user_prompt)%f'
export PROMPT