Commits

Steve Losh committed 758d680

MOAR

  • Participants
  • Parent commits 15fb2a3

Comments (0)

Files changed (9)

 fish/generated_completions/
 weechat/python/autoload/local.py
 weechat/script/plugins.xml.gz
+fish/local.fish
 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
 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
 # 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 {
 
     local retval=0
     if [[ $# -eq 0 ]]; then
-        printf 'mykill: Too few arguments: %d\nmykill: Usage: mykill <PIDs...>\n' $#
+        printf 'murder: Too few arguments: %d\nmurder: Usage: murder <PIDs...>\n' $#
         retval=1
     else
         for pid in $@; do
             # 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
             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

File fish/config.fish

 
 # }}}
 
-if test -s $HOME/.config/fish/local.fish
-    . $HOME/.config/fish/local.fish
+if test -f $HOME/.local.fish
+    . $HOME/.local.fish
 end
 
 true

File fish/functions/irclogs.fish

+function irclogs -d "Open the IRC logs dir in vim"
+    cd ~/.weechat/logs/
+    vim .
+    cd -
+end

File fish/functions/trademark.fish

+function trademark
+    echo -n ™ | pbcopy
+end

File vim/after/ftplugin/timl.tim

+; 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 <buffer> cp")
+(execute "silent! nunmap <buffer> cpp")
+(execute "silent! nunmap <buffer> K")
+
+; Eval fuck only knows what.  Toplevel/current form?
+(execute "nnoremap <silent><buffer> <localleader>e :set opfunc=timl#interactive#eval_opfunc<CR>g@")
+
+; Eval buffer
+(execute "nnoremap <buffer> <localleader>b :w<cr>:source %<cr>")
+
+; Man
+(execute "nnoremap <buffer> M :execute 'help' ftplugin#timl#cursor_keyword()<CR>")
+
+; R[E]PL
+(execute "nnoremap <buffer> <localleader>E :TLrepl<CR>")
     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
     " Make {<cr> 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 <buffer> {<cr> {}<left><cr><space><space><space><space>.<cr><esc>kA<bs>
+    " }
+
+    " Prettify a hunk of JSON with <localleader>p
+    au FileType javascript nnoremap <buffer> <localleader>p ^vg_:!python -m json.tool<cr>
+    au FileType javascript vnoremap <buffer> <localleader>p :!python -m json.tool<cr>
 augroup END
 
 " }}}
 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 <buffer> () :<c-u>call PareditWrap("(", ")")<cr>
+    au FileType timl noremap <buffer> )( :<c-u>call PareditSplice()<cr>
+    au FileType timl noremap <buffer> (( :<c-u>call PareditMoveLeft()<cr>
+    au FileType timl noremap <buffer> )) :<c-u>call PareditMoveRight()<cr>
+    au FileType timl noremap <buffer> (j :<c-u>call PareditJoin()<cr>
+    au FileType timl noremap <buffer> (s :<c-u>call PareditSplit()<cr>
+    au FileType timl noremap <buffer> [ :<c-u>call PareditSmartJumpOpening(0)<cr>
+    au FileType timl noremap <buffer> ] :<c-u>call PareditSmartJumpClosing(0)<cr>
+    " )))
+
+    au FileType timl call PareditInitBuffer()
+
+    " Indent top-level form.
+    au FileType timl nmap <buffer> <localleader>= mz99[(v%='z
+    " ])
+augroup END
+
+" }}}
 " Vagrant {{{
 
 augroup ft_vagrant