2018-12-28 11:23:49 +01:00
|
|
|
alias vi='vim'
|
|
|
|
sudo() { if [[ $# == "1" ]] && [[ $1 == "su" ]]; then command sudo -i; else command sudo "$@"; fi }
|
2022-01-07 18:12:09 +01:00
|
|
|
alias history="fc -l 0"
|
2018-12-28 11:23:49 +01:00
|
|
|
|
|
|
|
##
|
|
|
|
# Caracterisation du shell
|
|
|
|
##
|
|
|
|
|
2022-02-07 11:05:36 +01:00
|
|
|
# If this is an xterm set the title to user@host:dir
|
|
|
|
case "$TERM" in
|
|
|
|
xterm*|rxvt*)
|
|
|
|
PS1="\[\e]0;\u@\h: \w\a\]$PS1"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-12-28 11:23:49 +01:00
|
|
|
bind -m '^L'='^U 'clear'^M^Y'
|
|
|
|
bind '^[[4~'=end-of-line
|
|
|
|
bind '^[[1~'=beginning-of-line
|
|
|
|
bind '^[[3~'=delete-char-forward
|
|
|
|
bind '^[[8~'=end-of-line
|
|
|
|
bind '^[[7~'=beginning-of-line
|
|
|
|
bind '^[Oc'=forward-word
|
|
|
|
bind '^[Od'=backward-word
|
|
|
|
bind '^[^[[C'=forward-word
|
|
|
|
bind '^[^[[D'=backward-word
|
2022-01-07 18:12:09 +01:00
|
|
|
|
|
|
|
set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM
|
2022-01-25 17:28:28 +01:00
|
|
|
pgrep -q vmd
|
2022-01-07 18:12:09 +01:00
|
|
|
if [ $? = 0 ]; then
|
|
|
|
set -A complete_vmctl -- console load reload start stop reset status
|
|
|
|
set -A complete_vmctl_2 -- $(vmctl status | awk '!/NAME/{print $NF}')
|
|
|
|
fi
|
|
|
|
if [ -d ~/.password-store ]; then
|
|
|
|
PASS_LIST=$(
|
|
|
|
cd ~/.password-store
|
|
|
|
find . -type f -name \*.gpg | sed 's/^\.\///' | sed 's/\.gpg$//g'
|
|
|
|
)
|
|
|
|
|
|
|
|
set -A complete_pass -- $PASS_LIST -c generate edit insert git
|
|
|
|
set -A complete_pass_2 -- $PASS_LIST push
|
|
|
|
fi
|
|
|
|
PKG_LIST=$(ls -1 /var/db/pkg)
|
|
|
|
set -A complete_pkg_delete -- $PKG_LIST
|
|
|
|
set -A complete_pkg_info -- $PKG_LIST
|
|
|
|
set -A complete_rcctl_1 -- disable enable get ls order set reload check restart stop start
|
|
|
|
set -A complete_rcctl_2 -- $(ls /etc/rc.d)
|
|
|
|
set -A complete_signify_1 -- -C -G -S -V
|
|
|
|
set -A complete_signify_2 -- -q -p -x -c -m -t -z
|
|
|
|
set -A complete_signify_3 -- -p -x -c -m -t -z
|
|
|
|
set -A complete_make_1 -- install clean repackage reinstall
|
|
|
|
set -A complete_gpg2 -- --refresh --receive-keys --armor --clearsign --sign --list-key --decrypt --verify --detach-sig
|
|
|
|
set -A complete_git -- pull push mpull mpush status clone branch add rm checkout fetch show tag commit
|
|
|
|
set -A complete_ifconfig_1 -- $(ifconfig | grep ^[a-z] | cut -d: -f1)
|