I am trying to extract only the function name from a function declaration using vim script. For testing purposes I am using this simple example:
int func(int a);
In vim script I am extracting the function name by this:
:let a = substitute(getline(line('.')), ".*\(func\).*", "\1", "")
But the backreference is not working. When I echo the variable a with
:echo a
it displays the whole line, i.e. int func(int a);
How to extract only the function name with bacreference or any other method?
Thanks in advance!