Since sbcl doesn't come with an editable REPL by default, I'm
wondering what the easiest way is to get one? As indicated in the
subject line, I'm looking for vi-mode, which I've been using since
"set -o vi" was introduced in ksh, and not emacs mode.
I looked for sb-readline, but the CLiki link is broken. I found
linedit, and successfully installed it, but I can't find any doc to
indicate if it supports a vi mode or how to activate it.
Not interested in recommendations to use SLIME or ILISP or anything
like that. For one thing, I don't much care for emacs. For another,
I'm not looking for an IDE; all my actual Lisp coding will be done in
vim. I'm just looking for an easy way to go back and make small
changes as I try stuff out at the REPL.
Other suggestions welcome. Thanks.
On Feb 10, 3:27 am, Mark Reed <·········@gmail.com> wrote:
> Not interested in recommendations to use SLIME or ILISP or anything
> like that. For one thing, I don't much care for emacs. For another,
> I'm not looking for an IDE; all my actual Lisp coding will be done in
> vim. I'm just looking for an easy way to go back and make small
> changes as I try stuff out at the REPL.
Whoo, a friend! :)
> Other suggestions welcome. Thanks.
You can use 'rlwrap' with Vi bindings.
No symbol completion here, though.
I just use the Emacs bindings right now, since I only use the REPL
for trying out very short things and inspecting data.
Leslie
On Feb 10, 4:20 am, "Leslie P. Polzer" <·············@gmx.net> wrote:
> Whoo, a friend! :)
Wait, you mean I'm not the only person on the planet who uses Lisp
without Emacs? Huh!
> You can use 'rlwrap' with Vi bindings.
That's what I'm doing now - since I have "set editing-mode vi" in my
~/.inputrc, anything that uses GNU readline automatically switches
itself to vi mode.
> No symbol completion here, though.
Yeah, kind of a bummer, since I don't know my way around the
dictionary too well yet, and the names aren't known for consistency.
Thanks for the advice!
On Feb 11, 12:05 am, Mark Reed <·········@gmail.com> wrote:
> On Feb 10, 4:20 am, "Leslie P. Polzer" <·············@gmx.net> wrote:
>
> > Whoo, a friend! :)
>
> Wait, you mean I'm not the only person on the planet who uses Lisp
> without Emacs? Huh!
>
> > You can use 'rlwrap' with Vi bindings.
>
> That's what I'm doing now - since I have "set editing-mode vi" in my
> ~/.inputrc, anything that uses GNU readline automatically switches
> itself to vi mode.
>
> > No symbol completion here, though.
>
> Yeah, kind of a bummer, since I don't know my way around the
> dictionary too well yet, and the names aren't known for consistency.
>
> Thanks for the advice!
You could find everything you need for completion already done by
looking in the code for swank, the server side code that runs on SBCL
when using slime. (package cl-swank in Ubuntu...) I haven't looked
through in depth, but it looks like you just need to get ahold of the
currently input characters, and then it can do the rest. Let us know
if you do it. I'm currently using viper mode for emacs and slime,
which is not a bad setup once you get it configured, but a real vim
setup would be great too.
-Jeff
On Sun, 10 Feb 2008 15:05:23 -0800 (PST), Mark Reed <·········@gmail.com> wrote:
>> No symbol completion here, though.
>
> Yeah, kind of a bummer, since I don't know my way around the
> dictionary too well yet, and the names aren't known for consistency.
You can have "static" symbol completion if you want:
http://weitz.de/completions.html
It's not the same as real symbol completion with an Emacs-like IDE,
but it's probably better than nothing.
Edi.
--
European Common Lisp Meeting, Amsterdam, April 19/20, 2008
http://weitz.de/eclm2008/
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
Mark Reed <·········@gmail.com> writes:
> Since sbcl doesn't come with an editable REPL by default, I'm
> wondering what the easiest way is to get one? As indicated in the
> subject line, I'm looking for vi-mode, which I've been using since
> "set -o vi" was introduced in ksh, and not emacs mode.
>
> I looked for sb-readline, but the CLiki link is broken. I found
> linedit, and successfully installed it, but I can't find any doc to
> indicate if it supports a vi mode or how to activate it.
>
> Not interested in recommendations to use SLIME or ILISP or anything
> like that. For one thing, I don't much care for emacs. For another,
> I'm not looking for an IDE; all my actual Lisp coding will be done in
> vim. I'm just looking for an easy way to go back and make small
> changes as I try stuff out at the REPL.
>
> Other suggestions welcome. Thanks.
Of course, you could implement your own line (or multi-line) vi-like
edit directly in SBCL. I don't know if there's an sbcl-specific
facility to get raw keyboard input, you'll probably have to use FFI to
get it. Once you can read raw (unbuffered) characters, you can
implement whatever line-edit you want.
In clisp, you'd just use (EXT:WITH-KEYBOARD
(let ((kc (READ-CHAR-NO-HANG EXT:*KEYBOARD-INPUT*)))
(let ((modifiers (EXT:CHAR-BITS kc))
(ch (EXT:CHAR-KEY kc)))
(values ch modifiers))))
(and possibly in combination with the SCREEN package for the output).
--
__Pascal Bourguignon__ http://www.informatimago.com/
CONSUMER NOTICE: Because of the "uncertainty principle," it is
impossible for the consumer to simultaneously know both the precise
location and velocity of this product.
On Feb 10, 4:27 am, Mark Reed <·········@gmail.com> wrote:
> Since sbcl doesn't come with an editable REPL by default, I'm
> wondering what the easiest way is to get one? As indicated in the
> subject line, I'm looking for vi-mode, which I've been using since
> "set -o vi" was introduced in ksh, and not emacs mode.
>
> I looked for sb-readline, but the CLiki link is broken. I found
> linedit, and successfully installed it, but I can't find any doc to
> indicate if it supports a vi mode or how to activate it.
No, Linedit does not support a vi-mode. The keybindings it provides
are emacs-like, and there is no support for different modes at all.
Adding support for modes (alternate sets of keybindings) would be
easy, but a vi-mode supporting modal editing might be a bit trickier.
Cheers,
-- Nikodemus