changeset 495:3aff0a2bfc0b

Updated config and indentation
author unexist
date Fri, 12 Jun 2020 12:29:08 +0200
parents ac5266c9fb5a
children 3954af64d52c
files .vimrc .zshalias .zshrc
diffstat 3 files changed, 169 insertions(+), 161 deletions(-) [+]
line wrap: on
line diff
--- a/.vimrc	Sun Jun 07 11:59:25 2020 +0200
+++ b/.vimrc	Fri Jun 12 12:29:08 2020 +0200
@@ -14,9 +14,9 @@
 set noincsearch
 set hlsearch
 set nowrap
-set ts=2
+set ts=4
 set bs=2
-set sw=2
+set sw=4
 set ch=1
 set scrolloff=2
 set expandtab
@@ -50,20 +50,20 @@
 
 " Commandline
 if has("cmdline_info")
-  set ruler
-  set showcmd
+    set ruler
+    set showcmd
 endif
 
 " Functions
 function! ToggleCopy()
-  if exists("&number")
-    set number!
-    set listchars=
-  else
-    set number
-    set listchars=trail:-,tab:>-,eol:<,nbsp:%,extends:>,precedes:< 
-    syntax sync fromstart
-  endif
+    if exists("&number")
+        set number!
+        set listchars=
+    else
+        set number
+        set listchars=trail:-,tab:>-,eol:<,nbsp:%,extends:>,precedes:< 
+        syntax sync fromstart
+    endif
 endfunction
 
 " Maps
@@ -114,8 +114,8 @@
 
 " Filetype
 if has("autocmd")
-  filetype plugin on
-  filetype indent off
+    filetype plugin on
+    filetype indent off
 endif
 
 " Match
--- a/.zshalias	Sun Jun 07 11:59:25 2020 +0200
+++ b/.zshalias	Fri Jun 12 12:29:08 2020 +0200
@@ -25,115 +25,129 @@
 
 # Sudo
 if [ -e /usr/bin/sudo ] ; then
-  alias halt="sudo /sbin/halt"
-  alias reboot="sudo /sbin/reboot"
-  alias killjobs="sudo lprm -"
-  alias s="sudo"
-  alias fuck='sudo $(fc -ln -1)'
+    alias halt="sudo /sbin/halt"
+    alias reboot="sudo /sbin/reboot"
+    alias killjobs="sudo lprm -"
+    alias s="sudo"
+    alias fuck='sudo $(fc -ln -1)'
 
-  # Based on dist
-  if [ -e /usr/bin/pacman ] ; then
-    alias p="packer --noedit"
-    alias I="sudo pacman -S"
-    alias R="sudo pacman -R"
-    alias S="pacman -Q"
-  elif [ -e /usr/bin/apt-get ] ; then
-    alias p="sudo apt-get"
-    alias I="sudo apt-get install"
-    alias R="sudo apt-get remove"
-    alias S="apt-cache search"
-    alias keptback="sudo apt-get --with-new-pkgs upgrade"
-  fi
+    # Based on dist
+    if [ -e /usr/bin/pacman ] ; then
+        alias p="packer --noedit"
+        alias I="sudo pacman -S"
+        alias R="sudo pacman -R"
+        alias S="pacman -Q"
+    elif [ -e /usr/bin/apt-get ] ; then
+        alias p="sudo apt-get"
+        alias I="sudo apt-get install"
+        alias R="sudo apt-get remove"
+        alias S="apt-cache search"
+        alias keptback="sudo apt-get --with-new-pkgs upgrade"
+    fi
 fi
 
 # Valgrind
-if [ -e /usr/bin/valgrind ] ; then
-  alias memcheck="valgrind --tool=memcheck --leak-check=full --suppressions=$HOME/.suppressions"
-  alias addrcheck="valgrind --tool=addrcheck --leak-check=full --suppressions=$HOME/.suppressions"
-  alias sgcheck="valgrind --tool=exp-sgcheck"
+command -v valgrind &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias memcheck="valgrind --tool=memcheck --leak-check=full --suppressions=$HOME/.suppressions"
+    alias addrcheck="valgrind --tool=addrcheck --leak-check=full --suppressions=$HOME/.suppressions"
+    alias sgcheck="valgrind --tool=exp-sgcheck"
 fi
 
 # Calc
-if [ -e /usr/bin/concalc ] ; then
-  alias calc='noglob concalc'
+command -v concalc &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias calc='noglob concalc'
 fi
 
 # Mercurial
 command -v hg &>/dev/null
 
 if [ $? -eq 0 ]; then
-  alias hgs="hg status|grep -v '^?'"
+    alias hgs="hg status|grep -v '^?'"
 fi
 
 # Git
 command -v git &>/dev/null
 
 if [ $? -eq 0 ]; then
-  alias gits="git status|grep -v '^?'"
+    alias gits="git status|grep -v '^?'"
 fi
 
 # Mpd
-if [ -e /usr/bin/mpc ] ; then
-  alias mpc="nocorrect mpc"
+command -v mpc &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias mpc="nocorrect mpc"
 fi
 
 # Firefox
-if [ -e /usr/bin/firefox ] ; then
-  alias ff="firefox -no-remote -ProfileManager &>/dev/null &!"
+command -v firefox &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias ff="firefox -no-remote -ProfileManager &>/dev/null &!"
 fi
 
 # Chrome/chromium
 for i in chrome chromium google-chrome chromium-browser; do
-  command -v $i &>/dev/null
+    command -v $i &>/dev/null
 
-  if [ $? -eq 0 ] ; then
-    alias chrome="$i &>/dev/null &!"
-    alias chromeunsafe="$i --disable-web-security --user-data-dir=/tmp --allow-file-access-from-files --enable-unrestricted-ssl3-fallback --ignore-certificate-errors --temp-profile &>/dev/null &!"
-  fi
+    if [ $? -eq 0 ] ; then
+        alias chrome="$i &>/dev/null &!"
+        alias chromeunsafe="$i --disable-web-security --user-data-dir=/tmp --allow-file-access-from-files --enable-unrestricted-ssl3-fallback --ignore-certificate-errors --temp-profile &>/dev/null &!"
+    fi
 done
 
 # Xephyr
-if [ -e /usr/bin/Xephyr ] ; then
-  XEPHYR_OPTS="-ac -noreset +extension RANDR +xinerama"
+command -v Xephyr &>/dev/null
+
+if [ $? -eq 0 ]; then
+    XEPHYR_OPTS="-ac -noreset +extension RANDR +xinerama"
     #-keybd ephyr,,,xkbmodel=evdev,xkblayout=de"
-  alias xeph1024="Xephyr $XEPHYR_OPTS -name xeph1024 -screen 1024x600 :2 &>/dev/null &!"
-  alias xeph800="Xephyr $XEPHYR_OPTS -name xeph800 -screen 800x800 :2 &!"
-  alias xeph640="Xephyr $XEPHYR_OPTS -name xeph640 -screen 640x480 :2 &!"
+    alias xeph1024="Xephyr $XEPHYR_OPTS -name xeph1024 -screen 1024x600 :2 &>/dev/null &!"
+    alias xeph800="Xephyr $XEPHYR_OPTS -name xeph800 -screen 800x800 :2 &!"
+    alias xeph640="Xephyr $XEPHYR_OPTS -name xeph640 -screen 640x480 :2 &!"
 fi
 
 # GVim
-if [ -e /usr/bin/gvim ] ; then
-  alias gvim="gvim &>/dev/null &!"
+command -v gvim &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias gvim="gvim &>/dev/null &!"
 fi
 
 # Keychain
-if [ -f /usr/bin/keychain ] ; then
-  alias kc="keychain -q --nocolor id_rsa && source $HOME/.keychain/$HOST-sh"
-fi
+command -v keychain &>/dev/null
 
-# Mplayer
-if [ -f /usr/bin/mplayer ] ; then
-  alias dts="mplayer -ac hwdts,hwac3, -ao alsa:device=spdif"
-  alias mp="mplayer -vo x11 -no-audio -zoom -fs"
+if [ $? -eq 0 ]; then
+    alias kc="keychain -q --nocolor id_rsa && source $HOME/.keychain/$HOST-sh"
 fi
 
 # subtle
-if [ -f /usr/bin/subtle ] ; then
-  alias sirb='ripl -r"subtle/subtlext"'
-fi
+command -v subtle &>/dev/null
 
-if [ -f $HOME/projects/subtle-contrib/ruby/vitag.rb ] ; then
-  alias vitag="ruby $HOME/projects/subtle-contrib/ruby/vitag.rb"
+if [ $? -eq 0 ]; then
+    alias sirb='ripl -r"subtle/subtlext"'
+
+    if [ -f $HOME/projects/subtle-contrib/ruby/vitag.rb ] ; then
+        alias vitag="ruby $HOME/projects/subtle-contrib/ruby/vitag.rb"
+    fi
 fi
 
 # ImageMagick
-if [ -f /usr/bin/import ] ; then
-  alias import="import +repage"
+command -v import &>/dev/null
+
+if [ $? -eq 0 ]; then
+    alias import="import +repage"
 fi
 
 # Rsync
-if [ -f /usr/bin/rsync ]; then
-  alias rsync="rsync -avh --progress"
+command -v rsync &>/dev/null
+
+if [ $? -eq 0 ]; then
+  alias rsync="rsync -trvh"
 fi
 
 # Java
@@ -141,42 +155,53 @@
   export JAVA_HOME="/usr/lib/jvm/default-java"
 fi
 
-# PA
-alias louder="pactl -- set-sink-volume 0 "
+# xrandr
+command -v xrandr &>/dev/null
 
-# Twttr
-if [ -e "/usr/bin/psql" ] ; then
-  alias tsql="PGPASSWORD=twttr psql -U twttr twttr -h localhost"
-fi  
+if [ $? -eq 0 ]; then
+    alias xrandr3="xrandr \
+        --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
+        --output DP-2-2 --mode 1920x1200 --pos 768x0 --right-of eDP-1 \
+        --output DP-2-3 --mode 1920x1080 --pos 2688x0 --right-of DP-2-2 --rotate left \
+        --dpi 96"
 
-# xrandr
-if [ -e "/usr/bin/xrandr" ] ; then
-  alias xrandr3="xrandr \
-    --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
-    --output DP-2-2 --mode 1920x1200 --pos 768x0 --right-of eDP-1 \
-    --output DP-2-3 --mode 1920x1080 --pos 2688x0 --right-of DP-2-2 --rotate left \
-    --dpi 96"
+    alias xrandr2="xrandr \
+        --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
+        --output DP-2-2 --mode 1920x1080 --pos 768x0 --right-of eDP-1 \
+        --output DP-2-3 --off
+        --dpi 96"
 
-  alias xrandr2="xrandr \
-    --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
-    --output DP-2-2 --mode 1920x1080 --pos 768x0 --right-of eDP-1 \
-    --output DP-2-3 --off
-    --dpi 96"
-
-  alias xrandr1="xrandr \
-    --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
-    --output DP-2-2 --off \
-    --output DP-2-3 --off \
-    --dpi 96"
+    alias xrandr1="xrandr \
+        --output eDP-1 --primary --mode 1366x768 --pos 0x0 \
+        --output DP-2-2 --off \
+        --output DP-2-3 --off \
+        --dpi 96"
 fi
 
-# netstat
-if [ -e "/bin/netstat" ] ; then
-  function port2proc {
-    sudo netstat -ltnp | \grep -w ":$1"
-  }
-fi  
+# Netstat
+command -v netstat &>/dev/null
+
+if [ $? -eq 0 ]; then
+    function port2proc {
+        sudo netstat -ltnp | \grep -w ":$1"
+    }
+fi
+
+# macOS
+if [[ "x$OSTYPE" == "xdarwin"* ]] ; then
+    alias ldd="otool -L"
 
-function bl {
-  su -c "echo $1 > /sys/class/backlight/intel_backlight/brightness"
-}
+    if type brew &>/dev/null; then
+        HOMEBREW_PREFIX=$(brew --prefix)
+
+        # gnubin
+        for d in ${HOMEBREW_PREFIX}/opt/*/libexec/gnubin; do
+            export PATH=$d:$PATH
+        done
+
+        # gnuman
+        for d in ${HOMEBREW_PREFIX}/opt/*/libexec/gnuman; do
+            export MANPATH=$d:$MANPATH
+        done
+    fi
+fi
--- a/.zshrc	Sun Jun 07 11:59:25 2020 +0200
+++ b/.zshrc	Fri Jun 12 12:29:08 2020 +0200
@@ -80,42 +80,39 @@
 
 # Functions
 function search-backwords {
-   zle history-incremental-search-backward $BUFFER
+    zle history-incremental-search-backward $BUFFER
 }
 
 function ansi-colors {
-  typeset esc="\033[" line1 line2
-  echo " _ _ _40 _ _ _41_ _ _ _42 _ _ 43_ _ _ 44_ _ _45 _ _ _ 46_ _ _ 47_ _ _ 49_ _"
-  for fore in 30 31 32 33 34 35 36 37; do
-    line1="$fore "
-    line2="   "
-    for back in 40 41 42 43 44 45 46 47 49; do
-      line1="${line1}${esc}${back};${fore}m Normal ${esc}0m"
-      line2="${line2}${esc}${back};${fore};1m Bold   ${esc}0m"
+    typeset esc="\033[" line1 line2
+    echo " _ _ _40 _ _ _41_ _ _ _42 _ _ 43_ _ _ 44_ _ _45 _ _ _ 46_ _ _ 47_ _ _ 49_ _"
+
+    for fore in 30 31 32 33 34 35 36 37; do
+        line1="$fore "
+        line2="   "
+
+        for back in 40 41 42 43 44 45 46 47 49; do
+            line1="${line1}${esc}${back};${fore}m Normal ${esc}0m"
+            line2="${line2}${esc}${back};${fore};1m Bold   ${esc}0m"
+        done
+
+        echo -e "$line1\n$line2"
     done
-    echo -e "$line1\n$line2"
-  done
-}
-
-function t {
-  if ! [ -z "$TMUX" ]; then
-    tmux new-window -c $PWD
-  fi
 }
 
 # Prompt
 prompt_status() {
-  if [[ $? == "0" ]]; then
-    echo -e ""
+    if [[ $? == "0" ]]; then
+        echo -e ""
     else
-    echo -e "🚨 "
-  fi
+        echo -e "🚨 "
+    fi
 }
 
 if [ "$USER" = "root" ] ; then
-  PS1=%1~$'%{\e[36;1m%}%(1j.%%%j.)%{\e[30;1m%} ➤ %{\e[0m%}'
+    PS1=%1~$'%{\e[36;1m%}%(1j.%%%j.)%{\e[30;1m%} $(prompt_status)➤ %{\e[0m%}'
 else
-  PS1=%1~$'%{\e[36;1m%}%(1j.%%%j.)%{\e[34;1m%} ➤ %{\e[0m%}'
+    PS1=%1~$'%{\e[36;1m%}%(1j.%%%j.)%{\e[34;1m%} $(prompt_status)➤ %{\e[0m%}'
 fi
 
 PS1=$'${(r:$COLUMNS::\u2500:)}'$PS1
@@ -132,90 +129,76 @@
 
 # Extending the path var
 if [ -e $HOME/bin ] ; then
-  export PATH=$HOME/bin:$PATH
+    export PATH=$HOME/bin:$PATH
 fi
 
 if [ -e /usr/local/bin/ ] ; then
-  export PATH=/usr/local/bin:$PATH
+    export PATH=/usr/local/bin:$PATH
 fi
 
 # Adding brew stuff
 if [ -e /usr/local/bin/brew ] ; then
-  export PATH="$(brew --prefix)/bin:$PATH"
+    export PATH="$(brew --prefix)/bin:$PATH"
 fi
 
 # Adding rust stuff
 if [ -e $HOME/.cargo/bin ] ; then
-  export PATH=$HOME/.cargo/bin:$PATH
+    export PATH=$HOME/.cargo/bin:$PATH
 fi
 
 # Adding android stuff
 if [ -e $HOME/Android ] ; then
-  export PATH=$HOME/Android/Sdk/build-tools/27.0.3/:$HOME/Android/Sdk/platform-tools/:$PATH
+    export PATH=$HOME/Android/Sdk/build-tools/27.0.3/:$HOME/Android/Sdk/platform-tools/:$PATH
 fi
 
 if [ -e /opt/android-sdk/tools ] ; then
-  export PATH=/opt/android-sdk/tools:$PATH
+    export PATH=/opt/android-sdk/tools:$PATH
 fi
 
 # Setting default editor
 if [ -f /usr/bin/vim ] ; then
-  export EDITOR=/usr/bin/vim
-fi
-
-# PostgreSQL
-if [ -f /usr/bin/psql ] ; then
-  export PGDATA=/home/unexist/misc/postgres
-  export PGUSER=unexist
-  export PGDATABASE=unexist
+    export EDITOR=/usr/bin/vim
 fi
 
 # XDG dirs
 if [ -e "$HOME/.config/user-dirs.dirs" ] ; then
-  source $HOME/.config/user-dirs.dirs
+    source $HOME/.config/user-dirs.dirs
 fi
 
 # Browser
 export BROWSER="/usr/bin/chromium"
 
-# Update title
-case $TERM in
-  xterm*|urxvt*|screen*)
-    chpwd() { print -Pn "\e]0;%n@%m: %~\a" }
-    ;;
-esac
-
 # Aliases
 if [ -f $HOME/.zshalias ] ; then
-  source $HOME/.zshalias
+    source $HOME/.zshalias
 fi
 
 # Keychain
 if [ -f /usr/bin/keychain ] ; then
-  if ! [ -f $HOME/.keychain/$HOST-sh ] ; then
-    keychain -q --nocolor --nogui id_rsa
-  fi
+    if ! [ -f $HOME/.keychain/$HOST-sh ] ; then
+        keychain -q --nocolor --nogui id_rsa
+    fi
 
-  source $HOME/.keychain/$HOST-sh
+    source $HOME/.keychain/$HOST-sh
 fi
 
 # Arm
 if [ -e /home/unexist/projects/arm-cs-tools/bin ] ; then
-  export PATH=/home/unexist/projects/arm-cs-tools/bin:$PATH
+    export PATH=/home/unexist/projects/arm-cs-tools/bin:$PATH
 fi
 
 # Pebble
 if [ -d $HOME/projects/pebble ] ; then
-  # Add pebble to PATH for scripting
-  PATH=$PATH:$HOME/projects/pebble/pebble-sdk-4.3-linux64/bin
+    # Add pebble to PATH for scripting
+    PATH=$PATH:$HOME/projects/pebble/pebble-sdk-4.3-linux64/bin
 fi
 
 # RVM
 if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
-  source "$HOME/.rvm/scripts/rvm"
+    source "$HOME/.rvm/scripts/rvm"
 
-  # Add RVM to PATH for scripting
-  PATH=$PATH:$HOME/.rvm/bin
+    # Add RVM to PATH for scripting
+    PATH=$PATH:$HOME/.rvm/bin
 fi
 
 # JAVA