Code Comments
Programming Forum and web based access to our favorite programming groups.From previous threads it looks like one can be a functional language guy and a VImer at the same time. Could you please tell me how do you send your selections/buffers from your favorite VI clone to the interpreter? -- Thanks, Karel Miklav
Post Follow-up to this messageKarel Miklav wrote: > From previous threads it looks like one can be a functional language guy > and a VImer at the same time. Could you please tell me how do you send > your selections/buffers from your favorite VI clone to the interpreter? I've given up and use XEmacs for that (I'm a 10+ years heavy vi user otherwise but have been using emacs on and off over the time aswell so it hasn't really been alien to me). However, in that regard, emacs is hardly optimal and only a small step up from what the vi clones offer, in functionality. One of the major drawbacks, apart from the all-permeating horror that is Emacs, is that you can only have one Lisp/Scheme buffer running and have to start other Schemes in xterms (or ordinary shell buffers) if you need more (which I usually do). But for the vi camp... basically, if you have gvim (GUI version), it's quite comfortable; just use ordinary cut&paste. Works pretty well (double-clicking on parens selects them and the enclosed text, also available via keybindings). Also, vim's Lisp/Scheme indentation is quite well working (with the exception of parens in comments, which can throw the matcher off track) and you can configure it a bit (via the "lispwords" variable). Original vi's also got a Lisp mode but it's very primitive and not configurable and probably only of historical interest. Some vi workalikes such as nvi or vile don't have a Lisp mode implemented and are therefore only for those hardcore people who consider automatically indented s-expressions licentious decadence. Interacting with an interpreter in a terminal-only vi is painful, if the stuff you paste is longer than a page, or if you cannot paste at all, so I recommend using the gui version, if possible. <rant>Unfortunately, gvim can open only one (1) gui window, which I find pretty limited. I never understood why they didn't give it the possibility of opening multiple gui windows, like (X)Emacs, or virtually any other GUI editor out there. It's not that they're feature-averse, quite the contrary, vim is a monstrous feature dump but apparently it's either not easily doable within vim's architecture, or their brains are simply ticking differently from mine and they don't consider it important enough.</rant> mkb.
Post Follow-up to this messageMatthias Buelow <mkb@incubus.de> writes: > One of the major drawbacks, apart from the all-permeating horror > that is Emacs, is that you can only have one Lisp/Scheme buffer > running and have to start other Schemes in xterms (or ordinary shell > buffers) if you need more (which I usually do). Nope, use M-x rename-buffer, rename the scheme buffer, then start a new one with M-x run-scheme. Good luck with Emacs! Sunnan -- .i mi'e snan .i mi rodo roda fraxu
Post Follow-up to this messageKarel Miklav wrote: > From previous threads it looks like one can be a functional language > guy and a VImer at the same time. Could you please tell me how do you > send your selections/buffers from your favorite VI clone to the > interpreter? I think with "!" you can send several lines from the buffer to a program. That program could for instance pipe its stuff to the interpreter, via a named pipe etc. (so you would run scheme as "scheme < named-pipe"). Well, then there's that input problem again, so maybe you need another program inbetween that reads from both stdin and the pipe... Happy C coding ;) -- Don't let school interfere with your education. -- Mark Twain
Post Follow-up to this messageKarel Miklav wrote: > From previous threads it looks like one can be a functional language=20 > guy and a VImer at the same time. Could you please tell me how do you=20 > send your selections/buffers from your favorite VI clone to the=20 > interpreter? I haven't tried it, but this version of VI might be interesting: <http://iamphet.nm.ru/scheme/> --=20 Jens Axel S=F8gaard
Post Follow-up to this messageKarel Miklav <karel@lovetemple.adbloccker.net> wrote: > From previous threads it looks like one can be a functional language > guy and a VImer at the same time. Could you please tell me how do you > send your selections/buffers from your favorite VI clone to the interpreter?[/colo r] Use two xterms: one for editing in vi, one running the Scheme interpreter. To run your code, save, switch windows, load the file into the interpreter and run. To evaluate a single expression, use '!%interpreter' and 'u'. '!%' sends everything between two matching parens to 'interpreter'. The 'u' undoes the previous command. Nils -- Nils M Holm <nmh@despammed.com> http://www.holm-und-jeschag.de/nils/ Symbolic Computing - an Introduction to Pure LISP: http://www.t3x.org/scipl/
Post Follow-up to this messageMatthias Buelow wrote: > <rant>Unfortunately, gvim can open only one (1) gui window, which I find > pretty limited. I never understood why they didn't give it the > possibility of opening multiple gui windows, like (X)Emacs, or virtually > any other GUI editor out there. I remember using the Project + Minibufexpl scripts at the same - real window managing nightmare. Maybe that's what bothers you?
Post Follow-up to this messageUlrich Hobelmann wrote: > I think with "!" you can send several lines from the buffer to a > program. That program could for instance pipe its stuff to the > interpreter, via a named pipe etc. There are named pipes? Wow, that gives my I/O redirection fiddlings a new dimension :) Anyway, I'm glad I asked, lots of interesting replies. Thanks Ulrich, thanks people. Karel Miklav
Post Follow-up to this messageKarel Miklav wrote: > From previous threads it looks like one can be a functional language guy > and a VImer at the same time. Could you please tell me how do you send > your selections/buffers from your favorite VI clone to the interpreter? > > -- > > Thanks, > Karel Miklav Hi, In most cases the following command fits your needs (works with vim, don't know other implementations). :w !myschemeinterpreter This works for guile at least: :w !guile It passes the content of the current buffer via stdout into the interpreter myschemeinterpreter. (Attention, there is a space in front of the !) :w !! repeats the last :w !app command (This does not save your work though, so be sure to save your files) Alternatively, you can run normal shell commands: :!myschemeinterpreter interpreter-params :!! repeats the last :!... command so regularly, I use :!guile -s myfile.scm Holger
Post Follow-up to this messageOn Thu, 19 May 2005 01:04:31 +0200, Matthias Buelow wrote: > Karel Miklav wrote: > > > I've given up and use XEmacs for that (I'm a 10+ years heavy vi user > otherwise but have been using emacs on and off over the time aswell so > it hasn't really been alien to me). However, in that regard, emacs is > hardly optimal and only a small step up from what the vi clones offer, > in functionality. One of the major drawbacks, apart from the > all-permeating horror that is Emacs, is that you can only have one > Lisp/Scheme buffer running and have to start other Schemes in xterms (or > ordinary shell buffers) if you need more (which I usually do). ??? Where did you get _this_ from? I'm currently running emacs with SLIME and have several Lisp buffers open (to 3 different Lisp at the same time). I don't know about quack.el capabilites but i don't see where emacs should limit the number of buffers. Ralf Mattes
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.