9062792cfda3

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 01 Mar 2016 12:31:04 +0000
parents 99e032674ddd
children 97e7e6bce784
branches/tags (none)
files bin/scheme tmux/tmux.conf vim/after/plugin/paredit.vim vim/bundle/ccs/ftdetect/ccs.vim vim/bundle/ccs/ftdetect/mu.vim vim/bundle/ccs/ftplugin/ccs.vim vim/bundle/ccs/ftplugin/mu.vim vim/bundle/ccs/syntax/ccs.vim vim/bundle/ccs/syntax/mu.vim vim/vimrc

Changes

--- /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 "$@"
--- 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}`"
 
--- 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 <buffer> S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
+    au Filetype lisp,clojure,gdl,scheme nnoremap <buffer> S i<cr><esc>^mwgk:silent! s/\v +$//<cr>:noh<cr>`w
 
     " Also quit fucking with my save file mapping.
-    au FileType lisp,clojure,gdl nunmap <buffer> s
+    au FileType lisp,clojure,gdl,scheme nunmap <buffer> s
+
+    " Oh my god will you fuck off already
+    au FileType lisp,clojure,gdl,scheme nnoremap <buffer> dp :diffput<cr>
+    au FileType lisp,clojure,gdl,scheme nnoremap <buffer> do :diffobtain<cr>
 augroup END
--- /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
--- /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
--- /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+=-,?,!
--- /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
--- /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"
--- /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"
--- 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\<esc>"
+    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\<esc>"
+    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 <buffer> <silent> <localleader>o :call OpenSchemeRepl()<cr>
+
+    " Send the current form to the REPL
+    au FileType scheme nnoremap <buffer> <silent> <localleader>f :call SendSchemeForm()<cr>
+
+    " Send the current top-level form to the REPL
+    au FileType scheme nnoremap <buffer> <silent> <localleader>e :call SendToplevelSchemeForm()<cr>
+
+    " Send the entire buffer to the REPL ([r]eload)
+    au FileType scheme nnoremap <buffer> <silent> <localleader>r :call SendSchemeBuffer()<cr>
+
+    " Clear the REPL
+    au FileType scheme nnoremap <buffer> <silent> <localleader>c :call NeoReplSendRaw("")<cr>
+
+    " Describe symbol under the cursor
+    au FileType scheme nnoremap <buffer> <silent> <localleader>d :call DescribeSchemeSymbol()<cr>
+
+    " Describe the last thing we typed
+    au FileType scheme inoremap <buffer> <silent> <c-d> <esc>mzb:call DescribeSchemeSymbol()<cr>`za
+
+    " Describe prompt
+    au FileType scheme nnoremap <buffer> <silent> <localleader>D :call DescribeSchemePrompt()<cr>
+
+    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 <buffer> () :<c-u>call PareditWrap("(", ")")<cr>
+    au FileType scheme noremap <buffer> )( :<c-u>call PareditSplice()<cr>
+    au FileType scheme noremap <buffer> (( :<c-u>call PareditMoveLeft()<cr>
+    au FileType scheme noremap <buffer> )) :<c-u>call PareditMoveRight()<cr>
+    au FileType scheme noremap <buffer> (j :<c-u>call PareditJoin()<cr>
+    au FileType scheme noremap <buffer> (s :<c-u>call PareditSplit()<cr>
+    au FileType scheme noremap <buffer> )j :<c-u>call PareditJoin()<cr>
+    au FileType scheme noremap <buffer> )s :<c-u>call PareditSplit()<cr>
+    au FileType scheme noremap <buffer> [[ :<c-u>call PareditSmartJumpOpening(0)<cr>
+    au FileType scheme noremap <buffer> ]] :<c-u>call PareditSmartJumpClosing(0)<cr>
+    " ))
+
+    " Indent top-level form.
+    au FileType scheme nmap <buffer> gi mz:silent normal99[(<cr>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 <buffer> <left> :<c-u>call SexpBack()<cr>
+    au FileType scheme noremap <buffer> <right> :<c-u>call SexpForward()<cr>
+    au FileType scheme noremap <buffer> <up> :<c-u>call SexpUp()<cr>
+    au FileType scheme noremap <buffer> <down> :<c-u>call SexpDown()<cr>
+augroup END
+
+" }}}
 " Shell {{{
 
 function! OpenShellRepl() "{{{