diff --git a/states/neovim/templates/init.lua.j2 b/states/neovim/templates/init.lua.j2 index 7d0eac2..9bab2a2 100644 --- a/states/neovim/templates/init.lua.j2 +++ b/states/neovim/templates/init.lua.j2 @@ -9,10 +9,10 @@ vim.cmd.syntax('on') {%- endif %} {% macro cfg(command, settings) -%} -{% if command == "globals" %}{% set t = "g" %}{% end %} -{% if command == "options" %}{% set t = "o" %}{% end %} +{% if command == "globals" %}{% set t = "g" %}{% endif %} +{% if command == "options" %}{% set t = "o" %}{% endif %} {% for k, v in settings.items() %} -vim.{{ t }}["{{ v.name }}"]{% if v.value is defined %}={% if v.value.integer() or v.value.boolean() %}{{ v.value }}{% else %}"{{ v.value }}"{% endif %} +vim.{{ t }}["{{ k }}"]{% if v is defined %}={% if v is integer or v is boolean %}{{ v }}{% else %}"{{ v }}"{% endif %}{% endif %} {%- endfor %} {% endmacro -%} @@ -22,11 +22,10 @@ vim.{{ t }}["{{ v.name }}"]{% if v.value is defined %}={% if v.value.integer() o -- NeoVIM options {{- cfg("options", neovim.config.options) }} -{% if "nvim-tree" in neovim.plugins.keys %} +{% if "nvim-tree" in neovim.plugins.keys() %} vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 --- optionally enable 24-bit colour vim.opt.termguicolors = true require("nvim-tree").setup({