# HG changeset patch # User Steve Losh # Date 1396397173 14400 # Node ID 4afc39b82de4c5b0692a18b3d4ea56b3bb87f901 # Parent e69d43b76d146499769a29e808474700b4829831# Parent 758d680aa791d74cf9becbbb0ec4bd31aa754971 Merge. diff -r e69d43b76d14 -r 4afc39b82de4 .hgignore --- a/.hgignore Tue Apr 01 20:06:03 2014 -0400 +++ b/.hgignore Tue Apr 01 20:06:13 2014 -0400 @@ -34,3 +34,4 @@ fish/generated_completions/ weechat/python/autoload/local.py weechat/script/plugins.xml.gz +fish/local.fish diff -r e69d43b76d14 -r 4afc39b82de4 .hgsub --- a/.hgsub Tue Apr 01 20:06:03 2014 -0400 +++ b/.hgsub Tue Apr 01 20:06:13 2014 -0400 @@ -39,6 +39,7 @@ vim/bundle/strftimedammit = [hg]https://bitbucket.org/sjl/strftimedammit.vim/ vim/bundle/surround = [git]git://github.com/tpope/vim-surround.git vim/bundle/syntastic = [git]git://github.com/scrooloose/syntastic.git +vim/bundle/timl = [git]git://github.com/tpope/timl.git vim/bundle/tslime = [git]git://github.com/sjl/tslime.vim.git vim/bundle/vitality = [hg]https://bitbucket.org/sjl/vitality.vim vim/bundle/yankring = [git]git://github.com/vim-scripts/YankRing.vim.git diff -r e69d43b76d14 -r 4afc39b82de4 .hgsubstate --- a/.hgsubstate Tue Apr 01 20:06:03 2014 -0400 +++ b/.hgsubstate Tue Apr 01 20:06:13 2014 -0400 @@ -39,6 +39,7 @@ 26fbdd7d1f1aa5600d2ebf39bbdd292c38aac16e vim/bundle/strftimedammit 1a73f607f8f5477d6942df2eb6e7245c4864f4d3 vim/bundle/surround 14cb306414dda411b1809a088e18eb2796030095 vim/bundle/syntastic +e5433ec4644f266df27202f1e0d6b4ca45bff392 vim/bundle/timl 113b1f14a1fb92b9c026a71485c9ed402a2045f8 vim/bundle/tslime 84365f56fc87c11f1f04eed487d256cf8b128f7c vim/bundle/vitality a884f3a161fa3cd8c996eb53a3d1c68631f60c21 vim/bundle/yankring diff -r e69d43b76d14 -r 4afc39b82de4 agignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agignore Tue Apr 01 20:06:13 2014 -0400 @@ -0,0 +1,6 @@ +tags +tags.bak +*.wsdl +target +*.public.key +*.private.key diff -r e69d43b76d14 -r 4afc39b82de4 bash_profile --- a/bash_profile Tue Apr 01 20:06:03 2014 -0400 +++ b/bash_profile Tue Apr 01 20:06:13 2014 -0400 @@ -19,6 +19,7 @@ alias h='hg' alias g='git' +alias pj='python -m json.tool' alias pbc='pbcopy' alias pbp='pbpaste' alias pbpb='pbp | pb' diff -r e69d43b76d14 -r 4afc39b82de4 bin/bootstrap.sh --- a/bin/bootstrap.sh Tue Apr 01 20:06:03 2014 -0400 +++ b/bin/bootstrap.sh Tue Apr 01 20:06:13 2014 -0400 @@ -43,6 +43,7 @@ ensure_link "lib/dotfiles/hgignore" ".hgignore" ensure_link "lib/dotfiles/gitignore" ".gitignore" ensure_link "lib/dotfiles/ffignore" ".ffignore" +ensure_link "lib/dotfiles/agignore" ".agignore" ensure_link "lib/dotfiles/ctags" ".ctags" ensure_link "lib/dotfiles/grc" ".grc" ensure_link "lib/dotfiles/bash_profile" ".bash_profile" diff -r e69d43b76d14 -r 4afc39b82de4 bin/murder --- a/bin/murder Tue Apr 01 20:06:03 2014 -0400 +++ b/bin/murder Tue Apr 01 20:06:13 2014 -0400 @@ -8,7 +8,7 @@ # How much time processes should be given to finish their work before we try the # next signal. Configurable, as long as the number of elements in this array # matches the number of elements in $signals. -delays=(4 6 8 0) +delays=(10 10 15 1) # Takes a list of PIDs and ends the processes through increasingly rude means. function mykill { @@ -20,7 +20,7 @@ local retval=0 if [[ $# -eq 0 ]]; then - printf 'mykill: Too few arguments: %d\nmykill: Usage: mykill \n' $# + printf 'murder: Too few arguments: %d\nmurder: Usage: murder \n' $# retval=1 else for pid in $@; do @@ -28,6 +28,7 @@ # Try the next signal if the process is alive AND there are more # signals to attempt AND the previous kill reported no errors. while $ps $pid > /dev/null && [[ $index -lt ${#signals} ]] && [[ $retval -eq 0 ]]; do + echo trying: kill -s ${signals[$index]} $pid output=$(kill -s ${signals[$index]} $pid 2>&1) retval=$? local killed=1 @@ -37,17 +38,17 @@ done if [[ -z $killed ]]; then - printf 'mykill: Process with PID %d does not exist.\n' $pid + printf 'murder: Process with PID %d does not exist.\n' $pid elif ! ${ps} ${pid} > /dev/null; then index=$(($index - 1)) - printf 'mykill: Killed process with PID %d with signal %s (%d).\n' $pid ${names[$index]} ${signals[$index]} + printf 'murder: Killed process with PID %d with signal %s (%d).\n' $pid ${names[$index]} ${signals[$index]} elif [[ ${retval} -ne 0 ]]; then - printf 'mykill: kill failed: %s\n' $(echo ${output} | cut -d ' ' -f 5-) + printf 'murder: kill failed: %s\n' $(echo ${output} | cut -d ' ' -f 5-) elif [[ ${index} -eq ${#signals} ]]; then - printf 'mykill: Failed to kill process with PID %d with signals %s\n' $pid "$(echo ${names[@]})" + printf 'murder: Failed to kill process with PID %d with signals %s\n' $pid "$(echo ${names[@]})" retval=-1 fi done diff -r e69d43b76d14 -r 4afc39b82de4 fish/config.fish --- a/fish/config.fish Tue Apr 01 20:06:03 2014 -0400 +++ b/fish/config.fish Tue Apr 01 20:06:13 2014 -0400 @@ -1,6 +1,7 @@ # Useful functions {{{ function ef; vim ~/.config/fish/config.fish; end +function eff; vim ~/.config/fish/functions; end function ev; vim ~/.vimrc; end function ed; vim ~/.vim/custom-dictionary.utf-8.add; end function eo; vim ~/Dropbox/Org; end @@ -219,8 +220,8 @@ # }}} -if test -s $HOME/.config/fish/local.fish - . $HOME/.config/fish/local.fish +if test -f $HOME/.local.fish + . $HOME/.local.fish end true diff -r e69d43b76d14 -r 4afc39b82de4 fish/functions/ag.fish --- a/fish/functions/ag.fish Tue Apr 01 20:06:03 2014 -0400 +++ b/fish/functions/ag.fish Tue Apr 01 20:06:13 2014 -0400 @@ -22,6 +22,9 @@ # that little tidbit and can we please get a shell without complete # bullshit as a scripting language syntax? if grep -q 'pragma: skipvcs' '.agignore' + # If .agignore contains pragma: skipvcs, then we'll run ag in + # "disregard .gitignore/.hgignore/svn:ignore" mode. This lets us + # still search in files the VCS has ignored. actual_ag --search-files -U $argv else actual_ag --search-files $argv diff -r e69d43b76d14 -r 4afc39b82de4 fish/functions/irclogs.fish --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fish/functions/irclogs.fish Tue Apr 01 20:06:13 2014 -0400 @@ -0,0 +1,5 @@ +function irclogs -d "Open the IRC logs dir in vim" + cd ~/.weechat/logs/ + vim . + cd - +end diff -r e69d43b76d14 -r 4afc39b82de4 fish/functions/trademark.fish --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fish/functions/trademark.fish Tue Apr 01 20:06:13 2014 -0400 @@ -0,0 +1,3 @@ +function trademark + echo -n ™ | pbcopy +end diff -r e69d43b76d14 -r 4afc39b82de4 gitignore --- a/gitignore Tue Apr 01 20:06:03 2014 -0400 +++ b/gitignore Tue Apr 01 20:06:13 2014 -0400 @@ -6,3 +6,4 @@ *-SCRATCH.* .idea *.iml +.DS_Store diff -r e69d43b76d14 -r 4afc39b82de4 hgrc --- a/hgrc Tue Apr 01 20:06:03 2014 -0400 +++ b/hgrc Tue Apr 01 20:06:13 2014 -0400 @@ -19,6 +19,7 @@ schemes = progress = fetch = +shelve = prompt = ~/lib/dotfiles/mercurial/hg-prompt/prompt.py histedit = ~/lib/dotfiles/mercurial/histedit/hg_histedit.py hggit = ~/.hg-git/hggit diff -r e69d43b76d14 -r 4afc39b82de4 tmux/tmux.conf --- a/tmux/tmux.conf Tue Apr 01 20:06:03 2014 -0400 +++ b/tmux/tmux.conf Tue Apr 01 20:06:13 2014 -0400 @@ -88,7 +88,7 @@ set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour238,nobold]⮀#[fg=colour15,bg=colour238,bold] #(ls ~/.mail/steve-stevelosh.com/INBOX/cur ~/.mail/steve-stevelosh.com/INBOX/new | wc -l | tr -d " ") #[fg=colour238,bg=colour234,nobold]⮀' -set -g status-right '#[fg=colour245]⮃ %R ⮃ %d %b #[fg=colour254,bg=colour234,nobold]#(rdio-current-track-tmux)⮂#[fg=colour16,bg=colour254,bold] #h ' +set -g status-right "#[fg=colour245]⮃ #(date -u +%%H:%%M) UTC ⮃ %d %b #[fg=colour254,bg=colour234,nobold]#(rdio-current-track-tmux)⮂#[fg=colour16,bg=colour254,bold] #h " set -g window-status-format "#[fg=white,bg=colour234] #I #W " set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour16,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" diff -r e69d43b76d14 -r 4afc39b82de4 vim/after/ftplugin/timl.tim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/after/ftplugin/timl.tim Tue Apr 01 20:06:13 2014 -0400 @@ -0,0 +1,26 @@ +; These are all out here in the middle of goddamned nowhere because the TimL +; ftplugin won't you disable mappings like any other plugin. Also this has to +; be a .tim file because the order of loading goes like this: +; +; ftplugin/*.vim +; after/ftplugin/*.vim +; ftplugin/*.tim +; after/ftplugin/*.tim +; +; Kill me. + +(execute "silent! nunmap cp") +(execute "silent! nunmap cpp") +(execute "silent! nunmap K") + +; Eval fuck only knows what. Toplevel/current form? +(execute "nnoremap e :set opfunc=timl#interactive#eval_opfuncg@") + +; Eval buffer +(execute "nnoremap b :w:source %") + +; Man +(execute "nnoremap M :execute 'help' ftplugin#timl#cursor_keyword()") + +; R[E]PL +(execute "nnoremap E :TLrepl") diff -r e69d43b76d14 -r 4afc39b82de4 vim/custom-dictionary.utf-8.add --- a/vim/custom-dictionary.utf-8.add Tue Apr 01 20:06:03 2014 -0400 +++ b/vim/custom-dictionary.utf-8.add Tue Apr 01 20:06:13 2014 -0400 @@ -159,3 +159,5 @@ GPG TLS Reykjavík +meatspace +scrollback diff -r e69d43b76d14 -r 4afc39b82de4 vim/vimrc --- a/vim/vimrc Tue Apr 01 20:06:03 2014 -0400 +++ b/vim/vimrc Tue Apr 01 20:06:13 2014 -0400 @@ -265,7 +265,6 @@ iabbrev vrcf `~/.vimrc` file iabbrev pcf Participatory Culture Foundation -inoremap l* " }}} " Convenience mappings ---------------------------------------------------- {{{ @@ -387,6 +386,12 @@ " Keep the cursor in place while joining lines nnoremap J mzJ`z +" Join an entire paragraph. +" +" Useful for writing GitHub comments in actual Markdown and then translating it +" to their bastardized version of Markdown. +nnoremap J mzvipJ`z + " Split line (sister to [J]oin lines) " The normal use of S is covered by cc, so don't worry about shadowing it. nnoremap S i^mwgk:silent! s/\v +$//:noh`w @@ -459,10 +464,15 @@ " This should preserve your last yank/delete as well. nnoremap zl :let @z=@"x$p:let @"=@z +" Ranger +nnoremap r :silent !ranger %:h:redraw! +nnoremap R :silent !ranger:redraw! + " Insert Mode Completion {{{ inoremap inoremap +inoremap " }}} @@ -475,6 +485,7 @@ nnoremap ed :vsplit ~/.vim/custom-dictionary.utf-8.add nnoremap eo :vsplit ~/Dropbox/Org4j nnoremap eh :vsplit ~/.hgrc +nnoremap eg :vsplit ~/.gitconfig nnoremap ep :vsplit ~/.pentadactylrc nnoremap em :vsplit ~/.mutt/muttrc nnoremap ez :vsplit ~/lib/dotfiles/zsh4j @@ -730,8 +741,8 @@ au! au BufNewFile,BufRead *.edn set filetype=clojure - au BufNewFile,BufRead riemann.config set filetype=clojure + au FileType clojure silent! call TurnOnClojureFolding() au FileType clojure compiler clojure au FileType clojure setlocal report=100000 @@ -1028,6 +1039,11 @@ " Make { insert a pair of brackets in such a way that the cursor is correctly " positioned inside of them AND the following code doesn't get unfolded. au Filetype javascript inoremap { {}.kA + " } + + " Prettify a hunk of JSON with p + au FileType javascript nnoremap p ^vg_:!python -m json.tool + au FileType javascript vnoremap p :!python -m json.tool augroup END " }}} @@ -1251,6 +1267,57 @@ augroup END " }}} +" TimL {{{ + +" let g:timl_fold_extra = [ +" \ 'defgauge', +" \ 'defmeter', +" \ 'defhistogram', +" \ 'defcounter', +" \ 'deftimer' +" \ ] + +" let g:timl_highlight_extra_defs = [ +" \ 'defparser', +" \ 'deftest', +" \ 'match', +" \ +" \ 'defroutes' +" \ ] + + +augroup ft_timl + au! + + au FileType timl silent! call TurnOnClojureFolding() + + " Things that should be indented 2-spaced + " au FileType clojure setlocal lispwords+=when-found,defform,when-valid + + au FileType timl RainbowParenthesesActivate + au syntax timl RainbowParenthesesLoadRound + au syntax timl RainbowParenthesesLoadSquare + au syntax timl RainbowParenthesesLoadBraces + + " Friendlier Paredit mappings. + au FileType timl noremap () :call PareditWrap("(", ")") + au FileType timl noremap )( :call PareditSplice() + au FileType timl noremap (( :call PareditMoveLeft() + au FileType timl noremap )) :call PareditMoveRight() + au FileType timl noremap (j :call PareditJoin() + au FileType timl noremap (s :call PareditSplit() + au FileType timl noremap [ :call PareditSmartJumpOpening(0) + au FileType timl noremap ] :call PareditSmartJumpClosing(0) + " ))) + + au FileType timl call PareditInitBuffer() + + " Indent top-level form. + au FileType timl nmap = mz99[(v%='z + " ]) +augroup END + +" }}} " Vagrant {{{ augroup ft_vagrant @@ -1816,16 +1883,26 @@ xnoremap iN :call NumberTextObject(1) function! s:NumberTextObject(whole) - normal! v - - while getline('.')[col('.')] =~# '\v[0-9]' + let num = '\v[0-9]' + + " If the current char isn't a number, walk forward. + while getline('.')[col('.') - 1] !~# num normal! l endwhile + " Now that we're on a number, start selecting it. + normal! v + + " If the char after the cursor is a number, select it. + while getline('.')[col('.')] =~# num + normal! l + endwhile + + " If we want an entire word, flip the select point and walk. if a:whole normal! o - while col('.') > 1 && getline('.')[col('.') - 2] =~# '\v[0-9]' + while col('.') > 1 && getline('.')[col('.') - 2] =~# num normal! h endwhile endif