Hi all
I'm sure I've asked this before but for the life of me can't find the
answer. I'm trying to write a plugin and I'm stumped with how to get a
substring from the current line. What I'm trying to do:
get the current line - tick
if the word 'function' is on the line - tick
get the next word after function - Nope!
eg
public function Foo
I'm trying to put the word 'Foo' into a variable.
fun! s:MyCom()
let s:line = getline(".")
if stridx(s:line,"function") >= 0
s:funcname = matchstr(s:line,"function \zs\w\+")
^^^^^^^^^^^
thanks,
--
Mark