758d680aa791

MOAR
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 01 Apr 2014 18:21:57 -0400
parents 15fb2a3ae7b6
children af7516f0acd1 4afc39b82de4
branches/tags (none)
files .hgignore .hgsub .hgsubstate bin/murder fish/config.fish fish/functions/irclogs.fish fish/functions/trademark.fish vim/after/ftplugin/timl.tim vim/vimrc

Changes

--- a/.hgignore	Wed Mar 19 11:46:39 2014 -0400
+++ b/.hgignore	Tue Apr 01 18:21:57 2014 -0400
@@ -34,3 +34,4 @@
 fish/generated_completions/
 weechat/python/autoload/local.py
 weechat/script/plugins.xml.gz
+fish/local.fish
--- a/.hgsub	Wed Mar 19 11:46:39 2014 -0400
+++ b/.hgsub	Tue Apr 01 18:21:57 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
--- a/.hgsubstate	Wed Mar 19 11:46:39 2014 -0400
+++ b/.hgsubstate	Tue Apr 01 18:21:57 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
--- a/bin/murder	Wed Mar 19 11:46:39 2014 -0400
+++ b/bin/murder	Tue Apr 01 18:21:57 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 <PIDs...>\n' $#
+        printf 'murder: Too few arguments: %d\nmurder: Usage: murder <PIDs...>\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
--- a/fish/config.fish	Wed Mar 19 11:46:39 2014 -0400
+++ b/fish/config.fish	Tue Apr 01 18:21:57 2014 -0400
@@ -220,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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/functions/irclogs.fish	Tue Apr 01 18:21:57 2014 -0400
@@ -0,0 +1,5 @@
+function irclogs -d "Open the IRC logs dir in vim"
+    cd ~/.weechat/logs/
+    vim .
+    cd -
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fish/functions/trademark.fish	Tue Apr 01 18:21:57 2014 -0400
@@ -0,0 +1,3 @@
+function trademark
+    echo -n ™ | pbcopy
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/after/ftplugin/timl.tim	Tue Apr 01 18:21:57 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 <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>")
--- a/vim/vimrc	Wed Mar 19 11:46:39 2014 -0400
+++ b/vim/vimrc	Tue Apr 01 18:21:57 2014 -0400
@@ -741,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
@@ -1035,6 +1035,11 @@
     " 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
 
 " }}}
@@ -1258,6 +1263,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 <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