diff options
-rwxr-xr-x | .config/herbstluftwm/panel.sh | 18 | ||||
-rw-r--r-- | .vimrc | 9 | ||||
-rw-r--r-- | .zshrc | 19 |
3 files changed, 43 insertions, 3 deletions
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh index 6417ebf..b3ff75b 100755 --- a/.config/herbstluftwm/panel.sh +++ b/.config/herbstluftwm/panel.sh @@ -45,6 +45,22 @@ hc pad $monitor $bheight # functions for retrieving and processing data # upon events +# bytes to human readable, cropped to 4 chars wide +#b2hc() { +# suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' ) +# sindex=0 +# val=$1 +# [[ -z $(echo $1 | grep "^[0-9]*$") ]] && read val +# +# while [[ $(echo $val / 1024 | bc) -ne 0 ]]; do +# val=$(echo "scale=2; $val / 1024" | bc) +# let sindex=sindex+1 +# done +# +# val=$(echo $val | sed +# echo "${val}${suffixes[$sindex]}" +#} + update_taglist() { echo -n "%{l}%{B${bg_normal} F${fg_normal} U${fg_normal}}" hc tag_status | tr '\t' '\n' | sed \ @@ -132,7 +148,7 @@ get_date() { get_when() { { while true; do - if [[ "$(when --future=1 | sed '1,2d')" == "" ]]; then + if [[ "$(when --future=2 | sed '1,2d')" == "" ]]; then echo -e 'when\t0' else echo -e 'when\t1' @@ -27,6 +27,8 @@ nnoremap <C-g> :buffers<CR>:b<Space> nnoremap <C-n> :tabn<CR> nnoremap <C-p> :tabp<CR> nnoremap <C-t> <C-w>s<C-w>T +nnoremap <C-w><C-n> :tabm +1<CR> +nnoremap <C-w><C-p> :tabm -1<CR> "insert lines below nnoremap ++ == @@ -74,6 +76,7 @@ autocmd FileType cpp call Settings_cpp() autocmd FileType tex call Settings_tex() autocmd FileType haskell call Settings_haskell() autocmd FileType make call Settings_script() +autocmd FileType matlab call Settings_matlab() autocmd FileType perl call Settings_script() autocmd FileType python call Settings_script() autocmd FileType sh call Settings_script() @@ -111,6 +114,12 @@ function! Settings_haskell() nnoremap -- O--<Space> endfunction +function! Settings_matlab() + "settings + "mappings + nnoremap -- O%<Space> +endfunction + function! Settings_script() "settings setlocal shiftwidth=4 @@ -72,15 +72,30 @@ alias diff='colordiff' alias less='less -R' alias latex='latex -output-format=pdf' -alias vmount='udevil mount' -alias vumount='udevil umount' alias def='sdcv' +alias ssh-socks='ssh -C2qTnN -D 9853 shmibbles.me' alias thesaurus='aiksaurus' +alias vmount='udevil mount' +alias vumount='udevil umount' export EDITOR="vim" export PAGER="less -R" ################## FUNCTIONS ################## +b2h() { + suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' ) + sindex=1 + val=$1 + [[ -z $(echo $1 | grep "^[0-9]*$") ]] && read val + + while [[ $(echo $val / 1024 | bc) -ne 0 ]]; do + val=$(echo "scale=2; $val / 1024" | bc) + let sindex=sindex+1 + done + + echo "${val}${suffixes[$sindex]}" +} + send() { if [ "$1" ]; then scp $@ shmibbles.me:/srv/http/tmp/ |