aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2025-08-29 14:58:00 -0600
committerjason2025-08-29 14:58:00 -0600
commit5d2bffa6e8c1b0276beafa9bdc83ad022c7d6267 (patch)
tree7cec1753be748dfb85248ae271140db888dcc802
parentd143c4d58f90e5a8f0faed6698d3d0f0ea2a510b (diff)
downloaddotfiles-5d2bffa6e8c1b0276beafa9bdc83ad022c7d6267.tar.gz
dotfiles-5d2bffa6e8c1b0276beafa9bdc83ad022c7d6267.zip
add kshrc
-rw-r--r--ksh/.kshrc104
1 files changed, 104 insertions, 0 deletions
diff --git a/ksh/.kshrc b/ksh/.kshrc
new file mode 100644
index 0000000..b8f8648
--- /dev/null
+++ b/ksh/.kshrc
@@ -0,0 +1,104 @@
1# .kshrc
2#
3# note: this file is executed by interactive non-login shell
4# if it needs to execute for login shells too (i.e. virtual
5# tty) add export ENV=$HOME/.kshrc to .profile
6
7LC_ALL="en_US.UTF-8"
8# This PS1 is completed at the end, allowing statuses to be included between the directory and closing $
9PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]"
10END_PS1="\$\[\e[m\] "
11# This is the original PS1
12#PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]\$\[\e[m\] "
13PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}"
14
15# OpenBSD
16# FreeBSD
17# Darwin
18# Linux
19OS_NAME=`uname`
20
21## Shell History
22export HISTSIZE=99999
23export HISTFILE=$HOME/.ksh_history
24export HISTCONTROL="ignoredupes:ignorespace"
25
26export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
27
28## Telemetry
29# Disable various telemetry
30export SAM_CLI_TELEMETRY=0
31
32## Warpdir
33WD=`which warpdir 2> /dev/null`
34if [ -x "$WD" ]; then
35 wd() {
36 output=$(warpdir $@)
37 status_code=$?
38 if [[ $status_code -eq 0 ]]; then
39 cd "$output"
40 elif [[ "$output" != "" ]]; then
41 echo "$output"
42 fi
43 unset output
44 unset status_code
45 }
46fi
47
48## FZF
49FZF=`which fzf 2> /dev/null`
50if [ -x "$FZF" ]; then
51 # fzf does not have first class ksh support.
52 function fzf-histo {
53 RES=$(fzf --tac --no-sort -e < $HISTFILE)
54 test -n "$RES" || exit 0
55 eval "$RES"
56 }
57
58 # space so it isn't saved in the history
59 bind -m ^R=' fzf-histo'^J
60fi
61
62
63## Python
64__workon() {
65 source ~/.virtualenvs/$1/bin/activate
66}
67__mkvirtualenv() {
68 python -mvenv ~/.virtualenvs/$1
69 . $HOME/.virtualenvs/$1/bin/activate
70}
71alias workon=__workon
72alias mkvirtualenv=__mkvirtualenv
73
74## Go
75
76if [ -d "$HOME/go/bin" ]; then
77 export PATH=$HOME/go/bin:$PATH
78fi
79
80## direnv
81DIRENV=`which direnv 2> /dev/null`
82if [ -x "$DIRENV" ]; then
83 # https://github.com/direnv/direnv/issues/873
84 refresh_direnv() {
85 eval "$("$DIRENV" export bash | sed 's@=\$'\''@='\''@g')"
86 }
87
88 direnv() {
89 "$DIRENV" "$@"
90 refresh_direnv
91 }
92
93 cd() {
94 builtin cd "$@"
95 refresh_direnv
96 }
97fi
98
99## nvm
100export NVM_DIR="$HOME/.nvm"
101[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
102
103# Close off the PS1 with the $
104export PS1=${PS1}${END_PS1}