You are not logged in.

#1 2007-06-02 15:44:04

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Vim avoiding function recursion

Waddup with thee, brethren (*waves to attract phrakture's attention*)

As part of a function I want to define in .vimrc, I need a structure like this:

inoremap $string :call myFunc($string)  " (obviously $string is a string literal in reality...)

...

function myFunc(string)
  exe "normal i" . a:string
endfunction

How can I insert the literal $string from within my function without causing the mapping to fire? At the moment, myFunc calls itself everytime it attempts to insert $string, since $string is mapped to myFunc...

TY smile

- Dave

P.S. I read the help page for mappings, of course, but couldn't find an answer wink

Last edited by KomodoDave (2007-06-02 16:36:57)

Offline

Board footer

Powered by FluxBB