# HG changeset patch # User Steve Losh # Date 1440950029 0 # Node ID 876ef61763020274350cdd835f6ebab9192f978b # Parent 48fa93b0dc64170356f5e499bcaff19aa375f6f9 Moar lisp diff -r 48fa93b0dc64 -r 876ef6176302 vim/custom-dictionary.utf-8.add --- a/vim/custom-dictionary.utf-8.add Fri Aug 28 21:22:08 2015 +0000 +++ b/vim/custom-dictionary.utf-8.add Sun Aug 30 15:53:49 2015 +0000 @@ -172,3 +172,4 @@ carabiner monopod gmail +inline diff -r 48fa93b0dc64 -r 876ef6176302 vim/vimrc --- a/vim/vimrc Fri Aug 28 21:22:08 2015 +0000 +++ b/vim/vimrc Sun Aug 30 15:53:49 2015 +0000 @@ -826,7 +826,7 @@ " }}} " Common Lisp {{{ -function! OpenLispRepl() +function! OpenLispRepl() "{{{ NeoRepl lisp set syntax=lisp syn match replPrompt /\v^\*/ @@ -834,10 +834,8 @@ syn match replResult /\v^#\<[^>]+\>$/ hi def link replResult Debug - -endfunction - -function! SetLispWords() +endfunction "}}} +function! SetLispWords() "{{{ if exists("g:did_set_lisp_words") return endif @@ -847,18 +845,16 @@ set lispwords+=switch set lispwords+=cswitch set lispwords+=eswitch -endfunction - -function! SendLispForm() +endfunction "}}} +function! SendLispForm() "{{{ let view = winsaveview() execute "normal! vab\" call NeoReplSendSelection() call winrestview(view) -endfunction - -function! SendToplevelLispForm() +endfunction "}}} +function! SendToplevelLispForm() "{{{ let view = winsaveview() " If we're on the first char of the form, calling PareditFindDefunBck will @@ -871,16 +867,26 @@ call NeoReplSendSelection() call winrestview(view) -endfunction - -function! SendLispBuffer() +endfunction "}}} +function! SendLispBuffer() "{{{ let view = winsaveview() execute "normal! ggVG\" call NeoReplSendSelection() call winrestview(view) -endfunction +endfunction "}}} +function! DescribeLispSymbol() "{{{ + let old_z = @z + + normal! "zyiw + call NeoReplSendRaw("(describe '" . @z . ")\n") + + let @z = old_z +endfunction "}}} +function! DescribeLispPrompt() "{{{ + call NeoReplSendRaw("(describe '" . input("? ") . ")\n") +endfunction "}}} augroup ft_commonlisp au! @@ -893,13 +899,15 @@ " swank/neovim yak. " " key desc mnemonic - " \l - connect neorepl [l]isp + " \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 - - au FileType lisp nnoremap l :call OpenLispRepl() + " \d - describe symbol [d]escribe + " \D - describe prompt [d]escribe + + au FileType lisp nnoremap o :call OpenLispRepl() " Send the current form to the REPL au FileType lisp nnoremap f :call SendLispForm() @@ -913,6 +921,12 @@ " Clear the REPL au FileType lisp nnoremap c :call NeoReplSendRaw(" ") + " Describe symbol under the cursor + au FileType lisp nnoremap d :call DescribeLispSymbol() + + " Describe prompt + au FileType lisp nnoremap D :call DescribeLispPrompt() + au FileType lisp RainbowParenthesesActivate au syntax lisp RainbowParenthesesLoadRound au syntax lisp RainbowParenthesesLoadSquare @@ -1330,8 +1344,9 @@ " Set up some basic neorepl mappings. " " key desc mnemonic - " \p - connect neorepl [o]pen repl + " \o - connect neorepl [o]pen repl " \l - send current line [l]ine + " \p - send current paragraph [p]aragraph " \e - send top-level hunk [e]val " \e - send selected hunk [e]val " \r - send entire file [r]eload file