[slimpl] vim+ecl documentation

Larry Clapp larry at theclapp.org
Fri Mar 10 12:27:53 CST 2006


On Fri, Mar 10, 2006 at 01:57:50PM +0100, Eirik A. Nygaard wrote:
> On Fri, Mar 10, 2006 at 10:58:12AM +0000, Jim Bailey wrote:
> > I have pulled your changes, and will check for updates regularly.
> > It would be nice to maintain a list of repositories as my one is
> > likely to fall behind soon as I will be travelling for a few
> > months and internet access might be a problem. Maybe this could be
> > added to the wiki?
> 
> Having a wiki page showing all the repos and a little descrption of
> them would be a nice idea.
> 
> I have made a quick page, linked from Perl_interface_to_SLIME. Can
> be found here: http://wiki.alu.org/Slim-Vim-Repos

Cool, thanks.  I glanced at your help file; it looks pretty good so
far.  One nitpick: instead if ecl.txt, you should name your file
if_ecl.txt.

One non-nitpick: you said

  (expr string)		Evaluates string as a lisp expression,
	                returning the result as a string.

EXPR evaluates the string as a VIM expression.  :)  E.g.,

  :ecl (print (vim:expr "&cpoptions"))
  "aABceFs"
  :let my_variable = "foo"
  :ecl (print (vim:expr "my_variable"))
  "foo"
  :let b:my_buffer_variable = "bar"
  :ecl (print (vim:expr "b:my_buffer_variable"))
  "bar"
  :ecl (print (vim:expr "1+2"))
  "3"

vim:expr can also call functions and so on.

Note to others: I, for one, would prefer NOT to see vim:expr and
vim:command scattered all over the place, so I would recommend (and
request) that we use vim:expr and vim:command strictly as "ffi" around
which we wrap Lisp functions or symbol-macros as appropriate.
Something like 

  (vim:defvar cpoptions)
  
would define CPOPTIONS as a symbol-macro that expands to 

  (vim:expr "&cpoptions") 
  
and also defines a SETF form such that 

  (setf cpoptions "val") 
  
expands to

  (vim:command "let &cpoptions = \"val\"")

Once we get a "Vim FFI" going, we can either include it directly in
the repository, post it on the wiki, or at Vim.org.

Hehe ... "post it at Vim.org" ... that'd be a hoot.  "Oh, by the way,
this requires the ECL patch, available at <url>."  That'd be one way
to build legitimacy (or at least visibility) in the Vim community!  :)

-- Larry



More information about the slimpl mailing list