From c6c2695b03dcc98c5a9fb2e8b2622e4e5685a63b Mon Sep 17 00:00:00 2001 From: shmibs Date: Tue, 24 Jun 2014 09:47:56 -0700 Subject: updated vim tab / buffer management things are super easy now =D --- .config/herbstluftwm/autostart | 2 +- .config/herbstluftwm/calc.sh | 22 ++++++++++++++++++++++ .vimrc | 40 +++++++++++++++++++++++----------------- .xinitrc | 6 ++++++ 4 files changed, 52 insertions(+), 18 deletions(-) diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index b414be2..7d06bab 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -177,7 +177,7 @@ hc rule focus=on hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off # set apppropriate things to pseudotile hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on focus=on -hc rule class~'(milkytracker|goattrk2|FTL|Tegaki-recognize|Gcalctool|Pcsx2|Tilem2)' pseudotile=on focus=on +hc rule class~'(freeciv-sdl|milkytracker|FTL|Tegaki-recognize|Pcsx2|Tilem2)' pseudotile=on focus=on # unlock, just to be sure hc unlock diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh index 358f43d..142065e 100755 --- a/.config/herbstluftwm/calc.sh +++ b/.config/herbstluftwm/calc.sh @@ -5,8 +5,30 @@ in="first" prompt="calc:" pi="3.1415926535897932384626433832795028841971694" e="2.7182818284590452353602874713526624977572471" + +# check first word for special commands +command_check() { + case "$(echo $1 | cut -d ' ' -f 1)" in + "y") + echo "$2" | tr -d '~' | xclip -selection clipboard + return 1 + ;; + "yank") + echo "$2" | tr -d '~' | xclip -selection clipboard + return 1 + ;; + + *) + return 0 + ;; + esac +} + while [ "$in" != "" ]; do in=$(echo "" | dmenu -q -h 18 -nb $1 -nf $2 -sb $3 -sf $4 -p "$prompt") + if [[ $(command_check "$in" "$acc") -eq 1 ]]; then + break + fi # replace "ans" with the previous value in=$(echo $in | sed -e "s/ans/$acc/g") diff --git a/.vimrc b/.vimrc index 1c4a8fb..0fc9402 100644 --- a/.vimrc +++ b/.vimrc @@ -16,19 +16,17 @@ set noshowmode "allow edited background buffers set hidden -"vim-latex settings -set grepprg=grep\ -nH\ $* -let g:tex_flavor="latex" - "gvim-specific settings set guifont=Tamsyn\ 11 set guioptions=aegimt -"buffer controls to match pentadactyl -noremap :bn -noremap :bp -noremap :badd -noremap :buffers:b +"buffer / tab controls +nnoremap :bn +nnoremap :bp +nnoremap :buffers:b +nnoremap :tabn +nnoremap :tabp +nnoremap sT "insert lines above and below with (=|+) "very hackish, but i couldn't think of a better way @@ -73,7 +71,7 @@ let g:c_no_if0_fold = 1 "doing with viml), so separate lines it is. autocmd FileType asm call Settings_asm() autocmd FileType c call Settings_c() -autocmd FileType cpp call Settings_c() +autocmd FileType cpp call Settings_cpp() autocmd FileType haskell call Settings_haskell() autocmd FileType make call Settings_script() autocmd FileType perl call Settings_script() @@ -83,27 +81,35 @@ autocmd FileType vim call Settings_vim() function! Settings_asm() setlocal cindent - set foldmethod=syntax - noremap -- A; + setlocal foldmethod=syntax + nnoremap -- A; endfunction function! Settings_c() setlocal cindent - set foldmethod=syntax - noremap -- A/**/hhi + setlocal foldmethod=syntax + nnoremap -- O*/hhi/* +endfunction + +function! Settings_cpp() + setlocal cindent + setlocal foldmethod=syntax + setlocal shiftwidth=4 + setlocal tabstop=4 + nnoremap -- O*/hhi/* endfunction function! Settings_haskell() setlocal smartindent - noremap -- A-- + nnoremap -- O-- endfunction function! Settings_script() setlocal smartindent - noremap -- A# + nnoremap -- O# endfunction function! Settings_vim() setlocal smartindent - noremap -- A" + nnoremap -- A" endfunction diff --git a/.xinitrc b/.xinitrc index 34f9988..62aba2b 100644 --- a/.xinitrc +++ b/.xinitrc @@ -16,6 +16,12 @@ export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx" fcitx & +#clean up sxiv cache +#and ensure necessary EV +#exists +sxiv -c +export XDG_CACHE_HOME=/home/shmibs/.cache + #disable power saving xset -dpms xset s off -- cgit v1.2.3