diff options
-rw-r--r-- | roles/basic/files/csh.cshrc | 54 | ||||
-rw-r--r-- | roles/basic/tasks/main.yml | 5 |
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 |