8ce6e1e14b22

Fix a few lisp things
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 26 Mar 2016 12:14:16 +0000
parents af9026179cd3
children 7d16f9d89280
branches/tags (none)
files bin/nrepl vim/vimrc

Changes

--- a/bin/nrepl	Fri Mar 25 21:41:27 2016 +0000
+++ b/bin/nrepl	Sat Mar 26 12:14:16 2016 +0000
@@ -2,4 +2,4 @@
 
 set -e
 
-lisp --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
+rlwrap sbcl --eval "(ql:quickload 'nrepl)" --eval "(nrepl:start-server)" "$@"
--- a/vim/vimrc	Fri Mar 25 21:41:27 2016 +0000
+++ b/vim/vimrc	Sat Mar 26 12:14:16 2016 +0000
@@ -890,6 +890,7 @@
 " }}}
 " Common Lisp {{{
 
+" (Neo)REPL Functions {{{
 function! HighlightLispRepl() "{{{
     " set syntax=lisp
     syn match replPrompt /\v^[-._a-zA-Z]+\>/
@@ -983,6 +984,7 @@
 function! MacroexpandLispPrompt() "{{{
     call NeoReplSendRaw("(macroexpand-1 '" . input("? ") . ")\n")
 endfunction "}}}
+" }}}
 
 augroup ft_commonlisp
     au!
@@ -991,56 +993,12 @@
 
     au FileType lisp call SetLispWords()
 
-    " Set up some basic neorepl mappings until I shave the fuckin
-    " swank/neovim yak.
-    "
-    " key  desc                   mnemonic
-    " \o - connect neorepl        [o]pen lisp
-    " \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
-    " \m - macroexpand form       [m]acroexpand
-    " \M - macroexpand prompt     [m]acroexpand
-
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>o :call OpenLispRepl()<cr>
-
-    " " Send the current form to the REPL
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>f :call SendLispForm()<cr>
-
-    " " Send the current top-level form to the REPL
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>e :call SendToplevelLispForm()<cr>
-
-    " " Send the entire buffer to the REPL ([r]eload)
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>r :call SendLispBuffer()<cr>
-
-    " " Clear the REPL
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>c :call NeoReplSendRaw("")<cr>
-
-    " " Describe symbol under the cursor
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>d :call DescribeLispSymbol()<cr>
-
-    " " Describe the last thing we typed
-    " au FileType lisp inoremap <buffer> <silent> <c-d> <esc>mzb:call DescribeLispSymbol()<cr>`za
-
-    " " Describe prompt
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>D :call DescribeLispPrompt()<cr>
-
-    " " Macroexpand form
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>m :call MacroexpandLispForm()<cr>
-
-    " " Macroexpand prompt
-    " au FileType lisp nnoremap <buffer> <silent> <localleader>M :call MacroexpandLispPrompt()<cr>
-
     au FileType lisp RainbowParenthesesActivate
     au syntax lisp RainbowParenthesesLoadRound
-    au syntax lisp RainbowParenthesesLoadSquare
-    au syntax lisp RainbowParenthesesLoadBraces
 
     au FileType lisp silent! call TurnOnLispFolding()
 
+    " Paredit mappings
     au FileType lisp noremap <buffer> () :<c-u>call PareditWrap("(", ")")<cr>
     au FileType lisp noremap <buffer> )( :<c-u>call PareditSplice()<cr>
     au FileType lisp noremap <buffer> (( :<c-u>call PareditMoveLeft()<cr>
@@ -1054,24 +1012,29 @@
     " ))
 
     " Indent top-level form.
-    " au FileType lisp nmap <buffer> <localleader>= mz:silent normal99[(<cr>v%='z
     au FileType lisp nmap <buffer> gi mz:silent normal99[(<cr>v%='z
     " ])
 
     au FileType lisp setlocal equalprg=lispindentclean
 
     " s/it/happening/
+    "
+    " Map the Ooze keys, then add a few extra on top to work with the REPL.
+    "
+    " [o]pen repl
+    " [s]end to repl
+    " [c]lear repl
     au FileType lisp silent! call OozeMapKeys()
     au FileType lisp nnoremap <buffer> <silent> <localleader>o :call OpenLispRepl()<cr>
-    au FileType lisp nnoremap <buffer> <silent> <localleader>p :call SendToplevelLispForm()<cr>
-    au FileType lisp nnoremap <buffer> <silent> <localleader>c :call NeoReplSendRaw("nil\n")<cr>
+    au FileType lisp nnoremap <buffer> <silent> <localleader>s :call SendToplevelLispForm()<cr>
+    au FileType lisp nnoremap <buffer> <silent> <localleader>c :call NeoReplSendRaw("nil\n")<cr>:sleep 20m<cr>:call NeoReplSendRaw("")<cr>
 
     " Navigate trees of sexps with arrows
     au FileType lisp call s:vim_sexp_mappings()
-    au FileType lisp noremap <buffer> <left> :<c-u>call SexpBack()<cr>
+    au FileType lisp noremap <buffer> <left>  :<c-u>call SexpBack()<cr>
     au FileType lisp noremap <buffer> <right> :<c-u>call SexpForward()<cr>
-    au FileType lisp noremap <buffer> <up> :<c-u>call SexpUp()<cr>
-    au FileType lisp noremap <buffer> <down> :<c-u>call SexpDown()<cr>
+    au FileType lisp noremap <buffer> <up>    :<c-u>call SexpUp()<cr>
+    au FileType lisp noremap <buffer> <down>  :<c-u>call SexpDown()<cr>
 augroup END
 
 " }}}