From a3690ed8ca90823787fbaddb72f0a1874f1e999d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 17 Nov 2021 22:24:43 +0100 Subject: Add lunarvim update to lsp/general --- .config/nvim/lua/config/defaults.lua | 7 ++++++- .config/nvim/lua/config/init.lua | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to '.config/nvim/lua/config') diff --git a/.config/nvim/lua/config/defaults.lua b/.config/nvim/lua/config/defaults.lua index a4b1140..87ef57a 100644 --- a/.config/nvim/lua/config/defaults.lua +++ b/.config/nvim/lua/config/defaults.lua @@ -3,7 +3,12 @@ return { colorscheme = "dark", line_wrap_cursor_movement = true, transparent_window = false, - format_on_save = true, + format_on_save = { + ---@usage pattern string pattern used for the autocommand (Default: '*') + pattern = "*", + ---@usage timeout number timeout in ms for the format request (Default: 1000) + timeout = 1000, + }, keys = {}, builtin = {}, diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua index f40e30e..63f4d0f 100644 --- a/.config/nvim/lua/config/init.lua +++ b/.config/nvim/lua/config/init.lua @@ -20,7 +20,7 @@ end -- Define options global variable function M:init() if vim.tbl_isempty(nvim or {}) then - options = require "config.defaults" + options = vim.deepcopy(require "config.defaults") local home_dir = vim.loop.os_homedir() options.vsnip_dir = utils.join_paths(home_dir, ".config", "snippets") options.database = { @@ -112,7 +112,8 @@ function M:reload() M:load() local plugins = require "plugins" - utils.toggle_autoformat() + local autocmds = require "core.autocmds" + autocmds.configure_format_on_save() local plugin_loader = require "plugin-loader" plugin_loader.cache_clear() plugin_loader.load { plugins, options.plugins } -- cgit v1.2.3-70-g09d2