annotate rc/shellinit-posix @ 719:bcdf320dabf4

Rewrite the ed2k again in php Getting openssl to hash md4 is a pain.
author nanaya <me@nanaya.net>
date Sun, 10 Dec 2023 00:35:22 +0900
parents 92eb89781346
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
527
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/bin/sh
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 _os="$(uname)"
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
4
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
5 export LANG="en_US.UTF-8"
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 export LC_CTYPE="en_US.UTF-8"
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
7 # The en_US.UTF-8 causes weird sorting.
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 # (not really, but I prefer C based sort.)
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 export LC_COLLATE=C
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 export LC_MESSAGES=C
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
11
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 if command -v tmux > /dev/null 2>&1; then
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 case "${_os}" in
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
14 OpenBSD)
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 # FIXME: OpenBSD version check
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
16 _tmux_conf_ver=1.9
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 ;;
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 *)
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
19 case "$(tmux -V 2> /dev/null)" in
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 "tmux 1."[1-9][0-9]*|"tmux 1.9"*) _tmux_conf_ver=1.9;;
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
21 "tmux 1."[4-8]*) _tmux_conf_ver=1.4;;
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
22 *) _tmux_conf_ver=1.3;;
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
23 esac
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
24 ;;
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
25 esac
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
26 alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'"
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
27 unset _tmux_conf_ver
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
28 fi
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
29
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
30 if command -v vim > /dev/null 2>&1; then
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
31 alias vi=vim
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
32 export EDITOR=vim
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
33 fi
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
34
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
35 if command -v less > /dev/null 2>&1; then
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
36 export PAGER=less
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
37 export LESS=-FMRXginsz-2
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
38 fi
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
39
528
92eb89781346 Enforce emacs-style commandline editor.
edogawaconan <me@myconan.net>
parents: 527
diff changeset
40 # Must be set after setting $EDITOR.
92eb89781346 Enforce emacs-style commandline editor.
edogawaconan <me@myconan.net>
parents: 527
diff changeset
41 set -o emacs
92eb89781346 Enforce emacs-style commandline editor.
edogawaconan <me@myconan.net>
parents: 527
diff changeset
42
527
cb4e2a6595ea Add ksh support.
edogawaconan <me@myconan.net>
parents:
diff changeset
43 unset _os