102 lines
3.0 KiB
Bash
102 lines
3.0 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
|
|
setopt NO_ERR_EXIT
|
|
|
|
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}${BUILDER:-SERENE}%F{015}][%F{198}$(git branch --show-current)%F{015}]
|
|
%F{005}%~%F{003} $(user_prompt)%f'
|
|
|
|
|
|
echo -e "\nSerene Development Shell $VERSION"
|
|
echo -e "\nCopyright (C) 2019-2024"
|
|
echo -e "Sameer Rahmani <lxsameer@gnu.org>"
|
|
echo -e "Serene comes with ABSOLUTELY NO WARRANTY;"
|
|
echo -e "This is free software, and you are welcome"
|
|
echo -e "to redistribute it under certain conditions;"
|
|
echo -e "for details take a look at the LICENSE file.\n"
|
|
echo -e "\nUse the 'help' command to view a list of helpers.\n"
|
|
|
|
ME=$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P)
|
|
export ME
|
|
|
|
BUILD_DIR_NAME="build"
|
|
export BUILD_DIR_NAME
|
|
|
|
BUILD_DIR="$ME/$BUILD_DIR_NAME"
|
|
export BUILD_DIR
|
|
|
|
SERENE_HOME_DIR="$HOME/.serene"
|
|
export SERENE_HOME_DIR
|
|
|
|
VERSION="0.9.0"
|
|
builder="${BUILDER:l}"
|
|
|
|
. "$ME/scripts/${builder}functions.sh"
|
|
|
|
|
|
export PROMPT
|