[slim-vim] Patch for Vim FFI, searching

Larry Clapp larry at theclapp.org
Wed Jun 21 07:44:06 CDT 2006


On Mon, Jun 19, 2006 at 01:43:19PM -0700, Brad Beveridge wrote:
> On 19/06/06, Larry Clapp <larry at theclapp.org> wrote:
> > Agree.  So:
> >
> >   (defun search (pattern &key flags stopline)
> >     ...)
> >
> >   usage example:
> >
> >   (search "pattern" :flags '(:backward) :stopline (vim:line "w0"))
> 
> I like it, ship it! :)

Patch committed at theclapp.org.  Changelog:

> Wed Jun 21 08:27:50 EDT 2006  Larry Clapp <larry at theclapp.org>
>   * add FFI for search()
>   
>   Usage: search pattern &key :flags flags :stopline stopline
>   
>   pattern is a string
>   flags is a list of keywords
>   stopline is a line number
>   
>   Allowable keywords in flags, and their translation into Vim search() flags:
>   
>     :backward         or :b  => "b"
>     :match-at-cursor  or :c  => "c"
>     :move-to-end      or :e  => "e"
>     :do-not-move      or :n  => "n"
>     :move                    => ""
>     :count-submatches or :p  => "p"
>     :set-tic          or :s  => "s"
>     :wrap             or :wl => "w"
>     :no-wrap          or :wu => "W"
>   
>   Just like with Vim's search(), if you don't give any of the wrap-related
>   flags, the wrap setting defaults to the setting of 'wrapscan'.

Share and enjoy.

-- Larry



More information about the slim-vim mailing list