I am trying to install a fork of the colorizer plugin. It has minimal requirements, awk being one. But I seem to run in a bunch of errors.
line 31:
E492: Not an editor command: const s:RXFLT = '%(\d*\.)?\d '
line 34:
E492: Not an editor command: const s:RXPCT = '%(\d*\.)?\d \%'
line 37:
E492: Not an editor command: const s:RXPCTORFLT = '%(\d*\.)?\d \%?'
line 40:
E492: Not an editor command: const s:CMMA = '\s*,\s*'
line 554:
E492: Not an editor command: const s:CLRZR_AWK_SCRIPT_PATH = expand('<sfile>:p:h') . '/clrzr.awk'
Error detected while processing function clrzr#Enable:
line 22:
E121: Undefined variable: s:CLRZR_AWK_SCRIPT_PATH
E116: Invalid arguments for function job_start( ['awk', '-f', s:CLRZR_AWK_SCRIPT_PATH], job_opts)
line 27:
E121: Undefined variable: s:awk_job
E116: Invalid arguments for function job_getchannel(s:awk_job)
line 28:
E121: Undefined variable: s:awk_chan
E116: Invalid arguments for function string(s:awk_chan) == 'channel fail'
line 86:
E216: No such group or event: SafeState * call s:SafeStateUpdate()
The plugin can be accessed here: https://github.com/BourgeoisBear/clrzr
Additionally, I am attaching the raw file that errors out: https://raw.githubusercontent.com/BourgeoisBear/clrzr/master/autoload/clrzr.vim
CodePudding user response:
:help :const
was introduced in patch 8.1.1539. If your Vim doesn't recognize it, then it means that it is too old for that plugin.
You can either…
- use the original version of the plugin, which doesn't seem to be using too many new features,
- or make your own backward-compatible fork of that fork,
- or upgrade Vim to a more recent version.
I would go with the third option.
Additionally, you might want to ask the author of that fork to clearly state the plugin's requirements.