Commits

Tanel Liiv committed 5089cea

Some changes made over time

Comments (0)

Files changed (4)

 Bundle 'scrooloose/syntastic.git'
 " TAB completion to insert mode autocompletes
 Bundle 'ervandew/supertab.git'
+" Cool HTML/CSS constructor
+Bundle 'ZenCoding.vim'
 
 " Colorscheme
 Bundle 'xterm16.vim'
 Bundle 'noahfrederick/Hemisu.git'
 " Some kind of epic colorscheme
 Bundle 'altercation/vim-colors-solarized.git'
+" Nice colorscheme
+Bundle 'blackboard.vim'
 
 " }}}
 
 set smartcase                     " Override ignorecase if search contains Upper case characters
 set nobackup                      " No backup of file before overwrite
 set hlsearch                      " highlight search matches
-set nowrap                        " Don't wrap lines
+set wrap                          " Wrap lines(vs. nowrap)
 set number                        " Linenumbers???
 set confirm                       " Confirm some actions
 set ruler                         " Show cursor coordinates in bottom right
   au Filetype html,xml,xsl set spell
 
   " Enter relativenumber on Insert exit and Vice-versa
-  autocmd InsertEnter * :set number
-  autocmd InsertLeave * :set relativenumber
+  " autocmd InsertEnter * :set number
+  " autocmd InsertLeave * :set relativenumber
 
   " Remove trailing whitespace
   au BufWritePre * :call setline(1, map(getline(1, "$"), 'substitute(v:val, "\\s\\+$", "","")'))
   au BufNewFile,BufRead ~/.mutt/temp/mutt* map!  <F3>  <ESC>kgqji
 
   " set comment characters for common languages
+  au FileType rst                              set nolist
   au FileType python,sh,bash,zsh,ruby,perl     let StartComment="#"  | let EndComment=""
   au FileType cpp,php,c,javascript             let StartComment="//" | let EndComment=""
 
 urxvt &
 # time to start, the master - the window manager xmonad
 xsetroot -cursor_name left_ptr
+
+feh --bg-fill Black-Wood-wood-black-abstract-blue-1366x768.jpg
 exec ck-launch-session xmonad
   echo $hash | tr " " "\n" | ssdeep -bm /proc/self/fd/0 $2
 }
 
+
+function mcp
+{
+    set -A mcp_sources ${*[1,$(($# - 1))]}
+    local mcp_destination="${@[$#]}"
+    if [[ ! -d "${mcp_destination}" ]]; then
+        echo "mcp: destination must be extant directory" >&2
+        return 1
+    fi
+    for prog in pv tar du tput; do
+        hash "${prog}" || return 1
+    done
+    local mcp_errors="0"
+    echo "calculating total copy size..."
+    set -A mcp_sizes
+    local mcp_size_total="0"
+    local mcp_size_current="0"
+    for ii in `seq 1 "${#mcp_sources[*]}"`; do
+        mcp_sizes[${ii}]="`du -sb "${mcp_sources[${ii}]}" | awk '{print($1)}' -`"
+        mcp_size_total="$(( mcp_size_total + mcp_sizes[${ii}] ))"
+    done
+    tput cuu1; echo -ne '\033[K';
+    for ii in `seq 1 "${#mcp_sources[*]}"`; do
+        local full_path="`echo "${mcp_sources[${ii}]}" | sed 's#/*$##'`"
+        local tar_dir="`echo "${full_path}" | sed 's#[^/]*$##'`"
+        if [[ -z "${tar_dir}" ]]; then
+            tar_dir="."
+        fi
+        local tar_node="`echo "${full_path}" | sed 's#^.*/##'`"
+        if (( ${#mcp_sources[*]} > 1 )); then
+            printf '[%05.2f%%] ' "$(( ( ${mcp_size_current}.0 / ${mcp_size_total} ) * 100.0 ))"
+            echo "${tar_node}: "
+        fi
+        if [[ ! -e "${full_path}" ]]; then
+            echo -e "${full_path} not found"
+            mcp_errors="$(( ${mcp_errors} + 1 ))"
+            continue
+        fi
+        tar cf - -C "${tar_dir}" "${tar_node}" | \
+            pv --size "${mcp_sizes[${ii}]}" | \
+            tar xf - -C "${mcp_destination}" || return 1
+        mcp_size_current="$(( mcp_size_current + mcp_sizes[${ii}] ))"
+        tput cuu1; echo -ne '\033[K'; tput cuu1; echo -ne '\033[K'
+    done
+    unset mcp_sources
+    if (( ${mcp_errors} == 0 )); then
+        echo "complete!"
+    else
+        echo "done, but with errors"
+    fi
+    return 0
+}
+
 cd() {
   builtin cd "$@"; ll; builtin echo;
 }
 
 # ---[ exports ] {{{
 export HISTFILE=~/.zsh_history
-export BROWSER="chromium"
+export BROWSER="firefox"
 export EDITOR="vim"
 export PAGER="less -winm"
 export HISTSIZE=5000