Vim and Lisp

331 views
Skip to first unread message

Danny Gratzer

unread,
Oct 14, 2012, 5:02:15 PM10/14/12
to vim...@googlegroups.com

Hello,

I have just started learning some scheme and was wondering if anyone would mind sharing their plugins/setup for working with Lisp in Vim.

I know Emacs has good support, but I really would prefer to stick with Vim if possible.

Marc Weber

unread,
Oct 16, 2012, 11:10:19 AM10/16/12
to vim_use
Excerpts from Danny Gratzer's message of Sun Oct 14 23:02:15 +0200 2012:
> I know Emacs has good support, but I really would prefer to stick with Vim
> if possible.
There is evil for emacs providing Vim modal editing for Emacs.
Because Emacs is written is Lisp its support is likely to be better.

You can still use general purpose plugins such as matchit, TToC etc.

vim-addon-async provides "REPL" support (not tested with lisp yet) and
references similar plugins in its README which could be adopted.

How to find plugins? Search on github and www.vim.org/search.php
Don't forget the Vim Wiki.

I know that there are some people using vim for writing Lisp - so wait
some more days for replies

Marc Weber

Aleksey Tsalolikhin

unread,
Oct 18, 2012, 8:29:42 PM10/18/12
to vim...@googlegroups.com
Check out section 6.8 (commands for editing LISP) in
http://docs.freebsd.org/44doc/usd/12.vi/paper.html (Bill Joy's paper
introducing vi).

Best,
-at

Danny Gratzer

unread,
Oct 18, 2012, 11:09:47 PM10/18/12
to vim...@googlegroups.com
Oh nice! Im finding some useful stuff!


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



--
Danny Gratzer

Bill Sun

unread,
Oct 18, 2012, 11:57:53 PM10/18/12
to vim...@googlegroups.com
Maybe you can try slimv [1].

[1]: https://bitbucket.org/kovisoft/slimv

Regards.

Andy Wokula

unread,
Oct 19, 2012, 5:06:11 AM10/19/12
to vim...@googlegroups.com
Am 19.10.2012 02:29, schrieb Aleksey Tsalolikhin:
> Check out section 6.8 (commands for editing LISP) in
> http://docs.freebsd.org/44doc/usd/12.vi/paper.html (Bill Joy's paper
> introducing vi).

:set lisp
makes Vi modify the motions (, ), {, }, [[ and ]], whereas Vim only
considers lisp-indent.

Vim doesn't even mention this in the help.

--
Andy

Marc Jessome

unread,
Oct 19, 2012, 9:55:27 AM10/19/12
to vim...@googlegroups.com
Although not a necessity, and really up to personal preference, I really
found rainbow parentheses to be really helpful when editing scheme.

https://github.com/kien/rainbow_parentheses.vim

Which I then configured as follows in my vimrc:

au Syntax * RainbowParenthesesLoadRound
map <leader>r :RainbowParenthesesToggleAll<CR>
au FileType lisp,scheme :RainbowParenthesesToggleAll<CR>

Charles Campbell

unread,
Oct 19, 2012, 10:34:03 AM10/19/12
to vim...@googlegroups.com
http://www.drchip.org/astronaut/vim/index.html#RAINBOW supports rainbow
highlighting for Lisp parentheses. It can be turned on with :Rainbow
and off with :Rainbow! .
Actually, the plugin supports several other languages, too (C, Lisp,
Matlab, and Latex).

Regards,
C Campbell

Brett Stahlman

unread,
Jul 12, 2016, 10:12:39 AM7/12/16
to vim_use, danny....@gmail.com

Is anyone working on a Lisp/REPL implementation that will take advantage of the asynchronous IO and other features added in Vim 8?

Thanks,
Brett S.

Marc Weber

unread,
Jul 12, 2016, 10:32:40 AM7/12/16
to vim_use
> Is anyone working on a Lisp/REPL implementation that will take
> advantage of the asynchronous IO and other features added in Vim 8?
Hi Brett,

even without "new features" you can get close by eg using
vim-addon-async. See its README.txt for alternative similar
implementations.

So I've been using ruby repl within a vim buffer for quite a while by
piping from to stdin/out via a helper process calling back into vim via
client-server feature.

Marc Weber

Brett Stahlman

unread,
Jul 12, 2016, 10:38:48 AM7/12/16
to vim...@googlegroups.com
Hey Marc,
Thanks. I haven't looked into the async addon, but will do so. In the
past, I've tried other solutions (e.g., one using screen that worked
fairly well and had the advantage of being fairly simple), but nothing
felt quite as seamless as emacs' support. Would you say the async
addon gives an experience comparable to emacs, or does it still feel
relatively kludgy?

Thanks,
Brett S.
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/URCm1lJtBBk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Marc Weber

unread,
Jul 12, 2016, 10:46:09 AM7/12/16
to vim_use
THere is
* old patch for vim implementing terminal
* newer patch for neovim implementing terminal

No idea how the emacs thing feels like - a terminal emulation does not
cope that well with copy/paste vim style and vim templates engines and
whatnot which is why I chose to use a simple buffer, get back stdout and
just display it at the bottom of the buffer.
You can send stdin by typing text, selecting it and hitting <cr> or by
<space><cr> or such, see README.

Moreover some completion was implemented for ruby and others ..
No idea about emacs.

Vim / async has some troubles such as "is it in command window mode" I
had to try working around.

Why not just install and use such command to get your repl?
Replace sh by your interpreter

command! AsyncSh call async_porcelaine#LogToBuffer({'cmd':'/bin/sh -i', 'move_last':1, 'prompt': '^.*\$[$] '})

completion typically works by sending some chars to the intpreter and
intercepting the result bevor it gets shown to the user - see samples.

Marc Weber

Brett Stahlman

unread,
Jul 12, 2016, 10:56:04 AM7/12/16
to vim...@googlegroups.com
Thanks Marc. I'll definitely look into the async capabilities, though
I'm still thinking that Vim 8 may open up significant opportunities in
this area...
Sincerely,
Brett S.
Reply all
Reply to author
Forward
0 new messages