(n)vim and !secret

Hi everybody,

I am sure that some of you use vim or nvim to edit their yamls. Do you know if it is possible for the editor not to mark a line that contains !secret <abc> as containing an error?

As you can see, all lines with !secret are marked; when the cursor is on one of those lines, it will display unknown tag <!secret>.

I know that there are tons of options to customize (n)vim, so perhaps there is a plugin that even checks the secrets.yaml whether or not one of those entries exists…? Example

influxdb:
  host: !secret influxdb_ohst ## this would throw an error, as "influxdb_host" is misspelled
  port: !secret influxdb_port ## this would NOT throw an error, as "influxdb_port" does exist in secrets.yaml

Unfortunately, I have quite a bunch of plugins and am not sure which one is responsible for displaying this error, thus I cannot check that particular plugin’s documentation.

Those of you using vim/nvim, do you have some tips on how to improve working with yaml files, especially regarding Home Assistant?

Thank you for your ideas :slight_smile:

1 Like