aboutsummaryrefslogtreecommitdiffstats
path: root/.kshrc
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-10-17 10:40:11 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-17 10:40:11 -0700
commitea127689e0ae2d39b49004be605e541ff80e2621 (patch)
treeabbe79e5e37792bd8ebea8f9ac788ff5b8aed704 /.kshrc
downloadopenbsd-dotfiles-ea127689e0ae2d39b49004be605e541ff80e2621.zip
Initial Commit
Diffstat (limited to '.kshrc')
-rw-r--r--.kshrc84
1 files changed, 84 insertions, 0 deletions
diff --git a/.kshrc b/.kshrc
new file mode 100644
index 0000000..258dc75
--- /dev/null
+++ b/.kshrc
@@ -0,0 +1,84 @@
+#!/bin/ksh
+
+# PS1 with git branch support
+git_branch() {
+ git branch 2>/dev/null | grep '^\*' | cut -d' ' -f2-
+}
+PS1='$(
+ p=$PWD
+ if [ $PWD = $HOME ]; then
+ printf " ~ "
+ else
+ dir_b="${p%/*}" # /home/user/projects
+ dir_b="${dir_b##*/}" # projects
+ dir_a="${p##*/}" # myfolder
+ result="$dir_b/$dir_a"
+ printf " %s " $result
+ fi
+
+ branch=$(git_branch)
+ if [ -n "$branch" ]; then
+ printf "\033[32m(%s)\033[0m " "$branch"
+ fi
+ if [ "$(id -u)" -eq 0 ]; then
+ printf "# "
+ else
+ printf "$ "
+ fi
+)'
+
+#
+# Setup shell history
+#
+export HISTFILE=~/.ksh_history
+export HISTSIZE=1000000
+
+#
+# Setup default env variables
+#
+export EDITOR="nvim"
+export BROWSER="firefox"
+export GPG_TTY=$(tty)
+export PAGER="less"
+export MANPAGER="less"
+export BAT_THEME="tokyonight_night"
+export LANG="en_US.UTF-8"
+export LC_CTYPE="en_US.UTF-8"
+export TERM="xterm-256color"
+
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
+export XDG_STATE_HOME="$HOME/.local/state"
+
+#
+# Append additional directories onto PATH
+#
+export PATH="$HOME/bin:$PATH"
+export PATH="$HOME/.local/bin:$PATH"
+
+#
+# Aliases
+#
+alias gs="git status"
+alias gc="git commit"
+alias ga="git add"
+alias gd="git diff"
+alias gds="git diff --staged"
+alias gp="git push"
+alias gpo="git push origin"
+alias gpl="git pull"
+alias gplrb="git pull --rebase"
+alias gl="git log"
+alias gv="git log --graph --decorate --oneline"
+alias gch="git checkout"
+alias gcb="git checkout -b"
+
+alias h="history 25"
+alias j="jobs -l"
+alias l="ls -al"
+
+alias vim="nvim"
+alias vi="nvim"
+
+set -o emacs