X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=34dc4ed83b8fe63b836143715974ddb051fc64e0;hb=3230001683e746f0bfe3337d627c69c6a66f0df5;hp=390ce7edba8dba58a2da6d3427f3222e4c64eb34;hpb=ee2f021829fff6de616c5839d9a707c44cf950db;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index 390ce7e..34dc4ed 100644 --- a/zsh/rc +++ b/zsh/rc @@ -76,6 +76,8 @@ fi # Autoload add-zsh-hook to add/remove zsh hook functions easily. autoload -Uz add-zsh-hook +# Load zmv (zsh move) which is powerful to rename files. +autoload zmv # HISTORY SETTINGS @@ -495,8 +497,34 @@ if [[ $TERM != screen* && $TERM != 'dumb' ]]; then fi -# Load rc file for current OS. -source_config ~/.zsh os rc $(uname) nolocal +# OS SPECIFIC SETTINGS + +if [[ $(uname) == Linux ]]; then + # Settings to create Debian packages. + DEBEMAIL=simon@ruderich.org + export DEBEMAIL + DEBFULLNAME="Simon Ruderich" + export DEBFULLNAME + +elif [[ $(uname) == Darwin ]]; then # Mac OS X + # Store the current clipboard in CLIPBOARD before every command so it can + # be used in commands. + os_darwin_preexec() { + export CLIPBOARD="$(pbpaste)" + } + # Add the function as preexec hook. + add-zsh-hook preexec os_darwin_preexec + + # Initialize CLIPBOARD so it's available for completion directly after + # startup. + CLIPBOARD="" + export CLIPBOARD + + # Fetch current URL in clipboard with wget. + alias wnc='wget --no-proxy $CLIPBOARD' +fi + + # Load rc file for current hostname (first part before a dot) or rc.local. source_config ~/.zsh host rc ${$(hostname)//.*/}