# HG changeset patch # User Steve Losh # Date 1456835464 0 # Node ID 9062792cfda39b28973b81bd12673a40cf31c93c # Parent 99e032674ddd2d60239fc4e4bf9eb11c63b73024 More diff -r 99e032674ddd -r 9062792cfda3 bin/scheme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/scheme Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +rlwrap mit-scheme "$@" diff -r 99e032674ddd -r 9062792cfda3 tmux/tmux.conf --- a/tmux/tmux.conf Sun Feb 21 16:37:29 2016 +0000 +++ b/tmux/tmux.conf Tue Mar 01 12:31:04 2016 +0000 @@ -102,7 +102,7 @@ setw -g automatic-rename on # Better name management -bind c new-window +bind c new-window -a bind , command-prompt "rename-window '%%'" bind > run-shell "tmux rename-window `basename #{pane_current_path}`" diff -r 99e032674ddd -r 9062792cfda3 vim/after/plugin/paredit.vim --- a/vim/after/plugin/paredit.vim Sun Feb 21 16:37:29 2016 +0000 +++ b/vim/after/plugin/paredit.vim Tue Mar 01 12:31:04 2016 +0000 @@ -2,8 +2,12 @@ au! " Quit fucking with my split-line mapping, paredit. - au Filetype lisp,clojure,gdl nnoremap S i^mwgk:silent! s/\v +$//:noh`w + au Filetype lisp,clojure,gdl,scheme nnoremap S i^mwgk:silent! s/\v +$//:noh`w " Also quit fucking with my save file mapping. - au FileType lisp,clojure,gdl nunmap s + au FileType lisp,clojure,gdl,scheme nunmap s + + " Oh my god will you fuck off already + au FileType lisp,clojure,gdl,scheme nnoremap dp :diffput + au FileType lisp,clojure,gdl,scheme nnoremap do :diffobtain augroup END diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/ftdetect/ccs.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/ftdetect/ccs.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,1 @@ +au BufNewFile,BufRead *.ccs setfiletype ccs diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/ftdetect/mu.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/ftdetect/mu.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,1 @@ +au BufNewFile,BufRead *.mu setfiletype mu diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/ftplugin/ccs.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/ftplugin/ccs.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,2 @@ +setlocal commentstring=*\ %s +setlocal iskeyword+=-,?,! diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/ftplugin/mu.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/ftplugin/mu.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,1 @@ +setlocal commentstring=*\ %s diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/syntax/ccs.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/syntax/ccs.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,24 @@ +if exists("b:current_syntax") + finish +endif + +syntax region ccsComment start=+*+ end=+$+ +syntax keyword ccsKeyword proc agent prop set checkprop +syntax keyword ccsKeyword min max tau eps +syntax keyword ccsConstant nil +syntax match ccsOperator '\v\.' +syntax match ccsOperator '\v\+' +syntax match ccsOutput '\v\'\k+' + +" non very magic because I dunno how to make vim use the fuckin \< pattern +" with very magic, whatever idc +syntax match ccsInput '\<[a-z]\k\+' + +highlight default link ccsComment Comment +highlight default link ccsConstant Constant +highlight default link ccsKeyword Keyword +highlight default link ccsOperator Operator +highlight default link ccsOutput Macro +highlight default link ccsInput Function + +let b:current_syntax = "ccs" diff -r 99e032674ddd -r 9062792cfda3 vim/bundle/ccs/syntax/mu.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/ccs/syntax/mu.vim Tue Mar 01 12:31:04 2016 +0000 @@ -0,0 +1,17 @@ +if exists("b:current_syntax") + finish +endif + +syntax region ccsComment start=+*+ end=+$+ +syntax keyword ccsKeyword prop +syntax keyword ccsConstant tt ff +syntax match ccsAll '\v\[\k+\]' +syntax match ccsExists '\v\<\k+\>' + +highlight default link ccsComment Comment +highlight default link ccsConstant Constant +highlight default link ccsKeyword Keyword +highlight default link ccsAll Macro +highlight default link ccsExists Function + +let b:current_syntax = "mu" diff -r 99e032674ddd -r 9062792cfda3 vim/vimrc --- a/vim/vimrc Sun Feb 21 16:37:29 2016 +0000 +++ b/vim/vimrc Tue Mar 01 12:31:04 2016 +0000 @@ -1691,6 +1691,123 @@ augroup END " }}} +" Scheme {{{ + +function! OpenSchemeRepl() "{{{ + NeoRepl scheme + set syntax=scheme + syn match replPrompt /\v^\*/ + syn match replPrompt /\v^[-_a-zA-Z]+\>/ + + syn match replResult /\v^#\<[^>]+\>$/ + hi def link replResult Debug +endfunction "}}} +function! SendSchemeForm() "{{{ + let view = winsaveview() + + execute "normal! vab\" + call NeoReplSendSelection() + + call winrestview(view) +endfunction "}}} +function! SendToplevelSchemeForm() "{{{ + let view = winsaveview() + + " If we're on the first char of the form, calling PareditFindDefunBck will + " move us to the previous form, which we don't want. So instead we'll just + " always move a char to the right. + silent! normal! l + + call PareditFindDefunBck() + execute "normal! vab\" + call NeoReplSendSelection() + + call winrestview(view) +endfunction "}}} +function! SendSchemeBuffer() "{{{ + call NeoReplSendRaw('(load "'. expand("%:p") . '")' . "\n") +endfunction "}}} +function! DescribeSchemeSymbol() "{{{ + let old_z = @z + + normal! "zyiw + call NeoReplSendRaw("(describe '" . @z . ")\n") + + let @z = old_z +endfunction "}}} +function! DescribeSchemePrompt() "{{{ + call NeoReplSendRaw("(describe '" . input("? ") . ")\n") +endfunction "}}} + +augroup ft_commonlisp + au! + + " key desc mnemonic + " \o - connect neorepl [o]pen scheme + " \f - send current form [f]orm + " \e - send top-level form [e]val + " \r - send entire file [r]eload file + " \c - send ctrl-l [c]lear + " \d - describe symbol [d]escribe + " \D - describe prompt [d]escribe + + au FileType scheme nnoremap o :call OpenSchemeRepl() + + " Send the current form to the REPL + au FileType scheme nnoremap f :call SendSchemeForm() + + " Send the current top-level form to the REPL + au FileType scheme nnoremap e :call SendToplevelSchemeForm() + + " Send the entire buffer to the REPL ([r]eload) + au FileType scheme nnoremap r :call SendSchemeBuffer() + + " Clear the REPL + au FileType scheme nnoremap c :call NeoReplSendRaw(" ") + + " Describe symbol under the cursor + au FileType scheme nnoremap d :call DescribeSchemeSymbol() + + " Describe the last thing we typed + au FileType scheme inoremap mzb:call DescribeSchemeSymbol()`za + + " Describe prompt + au FileType scheme nnoremap D :call DescribeSchemePrompt() + + au FileType scheme RainbowParenthesesActivate + au syntax scheme RainbowParenthesesLoadRound + au syntax scheme RainbowParenthesesLoadSquare + au syntax scheme RainbowParenthesesLoadBraces + + au FileType scheme silent! call TurnOnLispFolding() + + au FileType scheme noremap () :call PareditWrap("(", ")") + au FileType scheme noremap )( :call PareditSplice() + au FileType scheme noremap (( :call PareditMoveLeft() + au FileType scheme noremap )) :call PareditMoveRight() + au FileType scheme noremap (j :call PareditJoin() + au FileType scheme noremap (s :call PareditSplit() + au FileType scheme noremap )j :call PareditJoin() + au FileType scheme noremap )s :call PareditSplit() + au FileType scheme noremap [[ :call PareditSmartJumpOpening(0) + au FileType scheme noremap ]] :call PareditSmartJumpClosing(0) + " )) + + " Indent top-level form. + au FileType scheme nmap gi mz:silent normal99[(v%='z + " ]) + + " au FileType lisp setlocal equalprg=LISP=sbcl\ lispindent + + " Navigate trees of sexps with arrows + au FileType scheme call s:vim_sexp_mappings() + au FileType scheme noremap :call SexpBack() + au FileType scheme noremap :call SexpForward() + au FileType scheme noremap :call SexpUp() + au FileType scheme noremap :call SexpDown() +augroup END + +" }}} " Shell {{{ function! OpenShellRepl() "{{{