env/dotfiles/shrc

83 lines
1.6 KiB
Plaintext
Raw Normal View History

2019-09-11 04:11:40 +02:00
# env
2023-06-20 03:00:31 +02:00
# Written in 2019-2023 by Lucas
2019-09-11 04:11:40 +02:00
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
EDITOR=ed
PAGER=less
VISUAL=ed
export EDITOR PAGER VISUAL
GPG_TTY=$(tty)
export GPG_TTY
SEKRIT_GPG_ID=sekrit_key
export SEKRIT_GPG_ID
2019-09-11 04:11:40 +02:00
alias cp="cp -i"
alias l="ls -F"
alias la="ls -aF"
alias ll="ls -lF"
alias mv="mv -i"
alias p="$PAGER"
if command -v nvi >/dev/null; then
2020-08-23 16:27:26 +02:00
alias vi=nvi
fi
if [ -d ~/local/man ] && [ -x /usr/bin/man ]; then
2019-09-11 04:11:40 +02:00
alias man="/usr/bin/man -m ~/local/man"
fi
2020-07-09 23:52:40 +02:00
if [ -d ~/local/libdata/perl5/site_perl ]; then
PERL5LIB=~/local/libdata/perl5/site_perl
export PERL5LIB
fi
if [ -x /sbin/sysctl ] && /sbin/sysctl -n hw.ncpuonline >/dev/null 2>&1; then
alias ncpu="/sbin/sysctl -n hw.ncpuonline"
fi
2019-12-09 12:03:41 +01:00
PS1=
2019-09-11 04:11:40 +02:00
case $SHELL in
/bin/mksh)
2019-12-09 12:03:41 +01:00
PS1=$PS1'${HOSTNAME:=$(hostname -s)}\$ '
2019-09-11 04:11:40 +02:00
;;
2020-08-22 02:01:38 +02:00
*)
PS1=$PS1'\h\$ '
2019-09-11 04:11:40 +02:00
;;
esac
export PS1
case $(uname -s) in
2021-12-15 10:06:33 +01:00
OpenBSD)
# Seems it's just set in /etc/rc and isn't inherited by the shell.
stty status "^T"
;;
2020-08-22 02:01:38 +02:00
Linux)
stty erase "^?"
2019-09-11 04:11:40 +02:00
;;
esac
if command -v nncp-call >/dev/null; then
2022-03-20 05:13:00 +01:00
NNCPCFG=~/.config/nncp
export NNCPCFG
fi
2022-08-08 18:35:17 +02:00
if command -v calendar >/dev/null && [ -f ~/.calendar/calendar ]; then
calendar
fi
if [ -r ~/.shrc.local ]; then
. ~/.shrc.local
2022-10-01 17:02:34 +02:00
fi
2019-09-11 04:11:40 +02:00
set -o emacs