7

The simple way is if get(g:, 'myplugin_enable_feature', defaultvalue) do whatever you want endif Now when I need to check a setting in more than one place, I usually prefer to have a dedicated getter in my plugin to be sure I have the same default value everywhere function! s:enable_feature() abort return get(g:, 'myplugin_enable_feature', ...


4

Usually it suffices to use get() function. Like that if get(g:, 'myplugin_enable_feature') " do something endif If the feature should be enabled by default you can change it to get(g:, 'myplugin_enable_feature', 1).


3

Try this: :call feedkeys(':e ' . expand('%')) See :help feedkeys() for more details.


1

Patch 8.0.1445 introduced :h CmdlineChanged , you can use it together with :h input() to get what you want. Here is a simple example i wrote to update last line of current buffer to cmdline while typing in cmdline. function! s:on_input_change() call setline('$', getcmdline()) redraw endfunction function! s:dynamic_input() augroup input_test au! ...


1

I looked at the source and I don't see any user-facing way to disable the bell limit. You'd have to build your own version as you mentioned. Think twice about that, though... Rather than being a killjoy "feature" this apparently was implemented for the sake of Vim stability. I saw a couple comments indicating that rapid bell sequences can hang Vim. Here's ...


Only top voted, non community-wiki answers of a minimum length are eligible