[slim-vim] Question about FFI priorities

Brad Beveridge brad.beveridge at gmail.com
Mon Jun 26 10:46:38 CDT 2006


On 26/06/06, Larry Clapp <larry at theclapp.org> wrote:
> On Mon, Jun 26, 2006 at 07:42:07AM -0700, Brad Beveridge wrote:
> > On 26/06/06, Larry Clapp <larry at theclapp.org> wrote:
> > > What Vim functions / operations / commands do you use most, or
> > > would most like to see implemented in Lisp?
> > I think the text and buffer manipulation functions are probably the
> > most useful to me personally, though it would be nice if we could
> > script the whole interface in Lisp - which would require things like
> > key mapping functions.
> > The more functions the better really, because there is sometimes a
> > disconnect with what you ought to use.  For example I recently
> > wanted to get the word under the cursor and went looking for a Vim
> > function (iw, I think) - but it was easier to get the whole current
> > line (get-line), then trim the string down to the word around the
> > cursor.
>
> Try
>
>   expand("<cword>")
>
> or its Lisp equivalent
>
>   (vim:funcall "expand" "<cword>")
>
> > I'd also like a function to get the text of the current visual
> > selection :)
>
>   (defun vim::current-visual-selection ()
>     (vim:with-options (("@a" ""))
>       (vim:normal "gv\"ay")
>       (vim:var "@a")))
>
> To see it in action, run this map
>
>   map ,g :<c-u>ecl (print (vim::current-visual-selection))<cr>
>
> highlight some text, and type ",g".
>

Ah, thanks.  I may be in a unique situation here, I'm trying to do
some Vim scripting in Lisp without having done any Vim scripting
before.  These kind of utility functions would really strengthen the
Vim FFI, IMHO.  I'm really liking the Lisp functions that you've
provided, I think their use is generally pretty obvious just from the
name and argument names.  For example, the flag names in VIM:SEARCH
are way more obvious than what Vim provides with ":help search"

Cheers
Brad


More information about the slim-vim mailing list