aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-04 23:52:23 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commitbee47448099c27b190568e716d734a6a95c66c39 (patch)
tree656ab78022b5822a50626f13f66cb2d1121b1c70 /roles
parent155868d75ac1eceeb905b9e74e013cc7a653ffd7 (diff)
downloadansible-dfly-vps-bee47448099c27b190568e716d734a6a95c66c39.tar.bz2
basic: install csh config file
Diffstat (limited to 'roles')
-rw-r--r--roles/basic/files/csh.cshrc54
-rw-r--r--roles/basic/tasks/main.yml5
2 files changed, 59 insertions, 0 deletions
diff --git a/roles/basic/files/csh.cshrc b/roles/basic/files/csh.cshrc
new file mode 100644
index 0000000..a8247d0
--- /dev/null
+++ b/roles/basic/files/csh.cshrc
@@ -0,0 +1,54 @@
+#
+# /etc/csh.cshrc
+# csh/tcsh resource script, read at beginning of execution by each shell
+#
+# Aaron LI
+#
+
+setenv EDITOR vi
+setenv PAGER less
+
+# Locale
+# NOTE: mosh (https://github.com/mobile-shell/mosh) requires UTF-8.
+# NOTE: login.conf(5) is ignored by SSH since it handles the login by its own
+setenv LANG en_US.UTF-8
+setenv MM_CHARSET UTF-8
+setenv LC_COLLATE C
+
+if ( $?prompt ) then
+ # An interactive shell
+ set prompt = "%N@%m%# "
+ set promptchars = "%#"
+ set filec
+ set history = 1000
+ set savehist = (1000 merge)
+ set autolist = ambiguous
+ set autoexpand
+ set autorehash
+ set mail = (/var/mail/$USER)
+
+ # A safer version of rm that isn't as annoying as -i
+ alias rm 'rm -I'
+ alias h history 25
+ alias j jobs -l
+ alias ls ls -G # color!
+ alias la ls -aF
+ alias lf ls -FA
+ alias ll ls -lAF
+
+ if ( $?tcsh ) then
+ bindkey "^W" backward-delete-word
+ bindkey -k up history-search-backward
+ bindkey -k down history-search-forward
+
+ # Credit:
+ # * https://stackoverflow.com/a/1912527/4856091
+ # * http://www.ibb.net/~anne/keyboard/keyboard.html#Tcsh
+ bindkey "\e[1~" beginning-of-line # Home
+ bindkey "\e[7~" beginning-of-line # Home rxvt
+ bindkey "\e[2~" overwrite-mode # Insert
+ bindkey "\e[3~" delete-char # Delete
+ bindkey "\e[4~" end-of-line # End
+ bindkey "\e[8~" end-of-line # End rxvt
+ endif
+endif
diff --git a/roles/basic/tasks/main.yml b/roles/basic/tasks/main.yml
index 078684b..8f3903c 100644
--- a/roles/basic/tasks/main.yml
+++ b/roles/basic/tasks/main.yml
@@ -33,6 +33,11 @@
state: touch
mode: 0600
+- name: csh - install /etc/csh.cshrc
+ copy:
+ src: csh.cshrc
+ dest: /etc/csh.cshrc
+
- name: pkg - disable repo auto update
lineinfile:
path: /usr/local/etc/pkg.conf