Guidance in creating a new option

15 views
Skip to first unread message

Enrico Maria De Angelis

unread,
Apr 15, 2026, 10:01:44 AMApr 15
to vim_dev
Hi everybody.

When launching Vim with the -w {scriptout} option, this simple edit allows to dump to the {scriptout} file as Vim runs, rather than only upon exit.

The edit was originally suggested in this answer, but romainl suggested to me, in a comment that I could do a PR with that change, provided I'd create an option under which to hide such a new behavior.

So I started investigating how I can add an option to Vim, and looking at recent history, I stumbled into PR #19739, and eventually I tried to define a new boolean option by mimicking the number option. I thought that this would be a minimal no-op implementation of a new option, but apparently that's not the case.

Indeed, if I build the above change with this commands

$ LDFLAGS="-rdynamic" VIMRUNTIME=/usr/share/vim/vim92/ ./configure --with-features=huge --enable-python3interp --enable-fail-if-missing
$ make -j8

and then start Vim via

VIM=. ./src/vim -Nu NONE

I get these errors:

E685: Internal error: set_string_option_direct()
E340: Internal error; if you can reproduce please report a bug
For option fencs
Press ENTER or type command to continue

Why is that?

And, more generally, is there some collection of tutorials for Vim development, such as "how to add a new option", "how to do such and such"?

Cheers,
Enrico Maria De Angelis
Reply all
Reply to author
Forward
0 new messages