Mercurial > ec-dotfiles
annotate rc/shellinit-posix @ 657:91d7c2e5936c
Remove need to manually switch directory with sud
author | nanaya <me@nanaya.pro> |
---|---|
date | Sun, 25 Jul 2021 21:36:52 +0900 |
parents | 92eb89781346 |
children |
rev | line source |
---|---|
527 | 1 #!/bin/sh |
2 | |
3 _os="$(uname)" | |
4 | |
5 export LANG="en_US.UTF-8" | |
6 export LC_CTYPE="en_US.UTF-8" | |
7 # The en_US.UTF-8 causes weird sorting. | |
8 # (not really, but I prefer C based sort.) | |
9 export LC_COLLATE=C | |
10 export LC_MESSAGES=C | |
11 | |
12 if command -v tmux > /dev/null 2>&1; then | |
13 case "${_os}" in | |
14 OpenBSD) | |
15 # FIXME: OpenBSD version check | |
16 _tmux_conf_ver=1.9 | |
17 ;; | |
18 *) | |
19 case "$(tmux -V 2> /dev/null)" in | |
20 "tmux 1."[1-9][0-9]*|"tmux 1.9"*) _tmux_conf_ver=1.9;; | |
21 "tmux 1."[4-8]*) _tmux_conf_ver=1.4;; | |
22 *) _tmux_conf_ver=1.3;; | |
23 esac | |
24 ;; | |
25 esac | |
26 alias tmux="tmux -f '""${HOME}""/.tmux-""${_tmux_conf_ver}"".conf'" | |
27 unset _tmux_conf_ver | |
28 fi | |
29 | |
30 if command -v vim > /dev/null 2>&1; then | |
31 alias vi=vim | |
32 export EDITOR=vim | |
33 fi | |
34 | |
35 if command -v less > /dev/null 2>&1; then | |
36 export PAGER=less | |
37 export LESS=-FMRXginsz-2 | |
38 fi | |
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 | 43 unset _os |