diff --git a/aliases/zsh_aliases b/aliases/zsh_aliases index 0eb020c..23a6a64 100644 --- a/aliases/zsh_aliases +++ b/aliases/zsh_aliases @@ -17,6 +17,7 @@ export KEYTIMEOUT=1 # search history bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward +function src() { source $1 ; } alias cs='printf "\033c"' alias hst="history" @@ -63,6 +64,7 @@ alias "f."="f .." alias "f.2"="f ..." alias fd="f ~/Downloads" +function mvd() { mv $1 ~/Downloads ; } alias fds="f ~/Downloads/sch" alias doc="f ~/Documents" alias cfg="f ~/.config" @@ -145,7 +147,7 @@ function py() { python $1 ; } # device specific {{{ # # NZXT {{{ -if [ "$(hostname)" = "NZXT" ]; then +if [ "$(hostname)" = "nzxt" ]; then # rotate monitor {{{ # function rt() { @@ -223,11 +225,10 @@ if [ "$(hostname)" = "NZXT" ]; then # }}} resume # # }}} various coding projs # -fi # NZXT }}} # laptop {{{ -if [[ "$(hostname)" = "X1-Carbon" ]]; then +elif [[ "$(hostname)" = "X1-Carbon" ]]; then alias gbl="xbacklight -get" function bl() { xbacklight -set $(echo "scale=2;$1*10" | bc) ; } @@ -238,9 +239,22 @@ if [[ "$(hostname)" = "X1-Carbon" ]]; then alias plz="f ~/platterz2018/ocr-reader/app/src/main/java/com/google/android/gms/samples/vision/ocrreader" alias ans="f /usr/local/android-studio/bin/" -fi # laptop }}} +# ubuntu {{{ + +elif [ "$(hostname)" = "nzxt-ubuntu" ]; then + +# Stardew Valley {{{ + alias sdv="f ~/Documents/sdv-save" + function svmd() { f ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; } + function svm() { mv $1 ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; } +# }}} + +fi + +# }}} + # }}} device specific # # git {{{ # @@ -255,6 +269,7 @@ alias gac="git add -A . && git commit" # diff/log {{{ # alias gd="git diff -w" alias gdc="git diff --cached" +alias gds="git diff --stat" alias gl="git log" alias gsl="git shortlog" # }}} diff/log # diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index 11359d8..2b49133 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -5,3 +5,5 @@ ui = auto [core] editor = nvim +[push] + default = simple diff --git a/dotfiles/vimrc b/dotfiles/vimrc index c849b61..f8edd76 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -231,3 +231,34 @@ autocmd Filetype tex inoremap tx $t(x)$ " }}} tex " " }}} Local Mappings " + +" format XML {{{ +function! DoPrettyXML() + " save the filetype so we can restore it later + let l:origft = &ft + set ft= + " delete the xml header if it exists. This will + " permit us to surround the document with fake tags + " without creating invalid xml. + 1s///e + " insert fake tags around the entire document. + " This will permit us to pretty-format excerpts of + " XML that may contain multiple top-level elements. + 0put ='' + $put ='' + silent %!xmllint --format - + " xmllint will insert an header. it's easy enough to delete + " if you don't want it. + " delete the fake tags + 2d + $d + " restore the 'normal' indentation, which is one extra level + " too deep due to the extra tags we wrapped around the document. + silent %< + " back to home + 1 + " restore the filetype + exe "set ft=" . l:origft +endfunction +command! PrettyXML call DoPrettyXML() +" }}} diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 99a2bdb..ae16490 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -108,4 +108,6 @@ then xinput disable "ELAN Touchscreen" # enable horizontal scrolling synclient HorizTwoFingerScroll=1 +else + xmodmap ~/.Xmodmap fi