From 5afcf67b82015eb06c7907063d716bf0f7b3c3a6 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 3 Dec 2024 01:03:45 +0300 Subject: [PATCH] modules/neovim: avoid interpolating strings for `vim.preventJunkFiles` --- modules/neovim/init/basic.nix | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index ef899cf..f91ea9a 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -95,78 +95,78 @@ in { # and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the # luaConfigRC section below. options = pushDownDefault { + # Options that are always set, with a lower priority encoding = "utf-8"; hidden = true; expandtab = true; + + # Junkfile Behaviour + swapfile = !cfg.preventJunkFiles; + backup = !cfg.preventJunkFiles; + writebackup = !cfg.preventJunkFiles; }; # Options that are more difficult to set through 'vim.options'. Fear not, though # as the Lua DAG is still as powerful as it could be. luaConfigRC.basic = entryAfter ["globalsScript"] '' - -- Settings that are set for everything - vim.opt.shortmess:append("c") + -- Settings that are set for everything + vim.opt.shortmess:append("c") - ${optionalString cfg.undoFile.enable '' + ${optionalString cfg.undoFile.enable '' vim.o.undofile = true vim.o.undodir = ${toLuaObject cfg.undoFile.path} ''} - ${optionalString cfg.preventJunkFiles '' - vim.o.swapfile = false - vim.o.backup = false - vim.o.writebackup = false - ''} - - ${optionalString (cfg.bell == "none") '' + ${optionalString (cfg.bell == "none") '' vim.o.errorbells = false vim.o.visualbell = false ''} - ${optionalString (cfg.bell == "on") '' + ${optionalString (cfg.bell == "on") '' vim.o.visualbell = false ''} - ${optionalString (cfg.bell == "visual") '' + ${optionalString (cfg.bell == "visual") '' vim.o.errorbells = false ''} - ${optionalString (cfg.lineNumberMode == "relative") '' + ${optionalString (cfg.lineNumberMode == "relative") '' vim.o.relativenumber = true ''} - ${optionalString (cfg.lineNumberMode == "number") '' + ${optionalString (cfg.lineNumberMode == "number") '' vim.o.number = true ''} - ${optionalString (cfg.lineNumberMode == "relNumber") '' + ${optionalString (cfg.lineNumberMode == "relNumber") '' vim.o.number = true vim.o.relativenumber = true ''} - ${optionalString cfg.useSystemClipboard '' + ${optionalString cfg.useSystemClipboard '' vim.opt.clipboard:append("unnamedplus") ''} - ${optionalString cfg.syntaxHighlighting '' + ${optionalString cfg.syntaxHighlighting '' vim.cmd("syntax on") ''} - ${optionalString cfg.hideSearchHighlight '' + ${optionalString cfg.hideSearchHighlight '' vim.o.hlsearch = false vim.o.incsearch = true ''} - ${optionalString (cfg.searchCase == "ignore") '' + ${optionalString (cfg.searchCase == "ignore") '' vim.o.smartcase = false vim.o.ignorecase = true ''} - ${optionalString (cfg.searchCase == "smart") '' + ${optionalString (cfg.searchCase == "smart") '' vim.o.smartcase = true vim.o.ignorecase = true ''} - ${optionalString (cfg.searchCase == "sensitive") '' + ${optionalString (cfg.searchCase == "sensitive") '' vim.o.smartcase = false vim.o.ignorecase = false ''}