dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit abaeead30c74fafe3c349bee8180ad6ee107e17d
parent 8a2f0b86b22dd98a1373099154235745fa91f5cc
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 12 Sep 2019 14:20:06 +0200

Update aliases

Diffstat:
M.commands.sh | 11+++++++++--
M.gitconfig | 16+++++++++++++++-
M.yashrc | 70+---------------------------------------------------------------------
3 files changed, 25 insertions(+), 72 deletions(-)

diff --git a/.commands.sh b/.commands.sh @@ -15,8 +15,14 @@ c() { [ -d "$dir" ] && cd "$dir" || return } -alias ls='ls -F' -alias l='ls -alFh' +alias ls=ls; unalias ls +alias ls='ls -hF' +alias l='ls' +alias la='l -a' +alias ll='l -l' +alias lo='l -alo' + +alias r='fc -s' o() { [ "$(uname)" = 'Darwin' ] && open="open" || open="xdg-open" @@ -80,6 +86,7 @@ alias gl="git log --graph --oneline --decorate --all --color=always | alias w3m="w3m -B" alias w3mtor='torsocks w3m -B "$@"' +alias wanip='curl https://ipinfo.io/ip' news() { if [ $# -eq 0 ]; then url="https://text.npr.org" diff --git a/.gitconfig b/.gitconfig @@ -3,13 +3,27 @@ name = Anders Damsgaard # gpg --list-secret-keys --keyid-format LONG signkey = 5C959DF243CE4DD17A5B2610B790F4AD1BF858FE + +[alias] + l = log --pretty='format:%h %s%d' -n 20 --graph + tags = tag -l + branches = branch -a + remotes = remote -v + s = status -sb + ss = s -uno + [color] - ui = auto + ui = false + diff = auto + [push] default = simple + [github] user = anders-dc + [core] excludesfile = ~/.gitignore + [credential] helper = store diff --git a/.yashrc b/.yashrc @@ -11,7 +11,6 @@ set --extended-glob set --no-clobber set --no-unset set --hist-space - set --notify-le set --le-no-conv-meta set --le-predict @@ -27,31 +26,15 @@ bindkey --vi-insert '\^U' backward-kill-line bindkey --vi-insert '\$' backward-kill-line bindkey --vi-insert '\^W' backward-delete-viword bindkey --vi-insert '\^Y' put-left -bindkey --vi-insert '\N' complete-next-column -bindkey --vi-insert '\P' complete-prev-column bindkey --vi-insert '\^_' accept-prediction bindkey --vi-command '\^N' beginning-search-forward bindkey --vi-command '\^P' beginning-search-backward -#bindkey '\^Z' _foreground -#_editor() { -# expect-verbatim echo hi -# accept-line -#} -#bindkey --vi-insert '\^E' _editor - -alias la='ls -a' ll='ls -l' lla='ll -a' -alias r='fc -s' - # ensure job control works as expected case $- in (*m*) trap - TSTP TTIN TTOU esac -: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)} - -MAILCHECK=0 - # emulate bash's $SHLVL if [ "${_old_shlvl+set}" != set ]; then _old_shlvl=${SHLVL-} @@ -65,6 +48,7 @@ PROMPT_COMMAND=() YASH_AFTER_CD=() # define prompt +: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)} if [ -n "${SSH_CONNECTION-}" ]; then _hc='\fy.' # yellow hostname for SSH remote else @@ -94,42 +78,6 @@ unset _hc _uc _2c # No escape sequences allowed in the POSIXly-correct mode. PS1='${LOGNAME}@${HOSTNAME%%.*} '$PS1 -# find escape sequence to change terminal window title -case "$TERM" in - (xterm|xterm[+-]*|gnome|gnome[+-]*|putty|putty[+-]*|cygwin) - _tsl='\033];' _fsl='\a' ;; - (*) - _tsl=$( (tput tsl 0; echo) 2>/dev/null | - sed -e 's;\\;\\\\;g' -e 's;;\\033;g' -e 's;;\\a;g' -e 's;%;%%;g') - _fsl=$( (tput fsl ; echo) 2>/dev/null | - sed -e 's;\\;\\\\;g' -e 's;;\\033;g' -e 's;;\\a;g' -e 's;%;%%;g') ;; -esac -# if terminal window title can be changed... -if [ "$_tsl" ] && [ "$_fsl" ]; then - - # set terminal window title on each prompt - _set_term_title() - if [ -t 2 ]; then - printf "$_tsl"'%s@%s:%s'"$_fsl" "${LOGNAME}" "${HOSTNAME%%.*}" \ - "${${PWD:/$HOME/\~}/#$HOME\//\~\/}" >&2 - fi - PROMPT_COMMAND=("$PROMPT_COMMAND" '_set_term_title') - - # reset window title when changing host or user - ssh() { - if [ -t 2 ]; then printf "$_tsl"'ssh %s'"$_fsl" "$*" >&2; fi - command ssh "$@" - } - su() { - if [ -t 2 ]; then printf "$_tsl"'su %s'"$_fsl" "$*" >&2; fi - command su "$@" - } - sudo() { - if [ -t 2 ]; then printf "$_tsl"'sudo %s'"$_fsl" "$*" >&2; fi - command sudo "$@" - } - -fi # define function that updates $_vcs_info and $_vcs_root _update_vcs_info() { @@ -176,20 +124,4 @@ _update_vcs_info() { # update $_vcs_info on each prompt PROMPT_COMMAND=("$PROMPT_COMMAND" '_update_vcs_info') -# these aliases choose a version controlling program for the current directory -alias _vcs='${${_vcs_info:?not in a version-controlled directory}%%@*}' -alias ci='_vcs commit' -alias co='_vcs checkout' -alias di='_vcs diff' -alias log='_vcs log' -alias st='_vcs status' -alias up='_vcs update' - -# print file type when executing non-executable files -_file_type() -if [ -e "$1" ] && ! [ -d "$1" ]; then - file -- "$1" -fi -COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_file_type "$@"') - . ~/.commands.sh