[slim-vim] Question about FFI priorities
Larry Clapp
larry at theclapp.org
Mon Jun 26 10:41:22 CDT 2006
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".
-- Larry
More information about the slim-vim
mailing list