summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/config
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-17 22:24:43 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-17 22:24:43 +0100
commita3690ed8ca90823787fbaddb72f0a1874f1e999d (patch)
tree1b79521fdf10c133aa643e6b2e46522ab6b79097 /.config/nvim/lua/config
parente953e2ee53503dcf070a7763743e4a76abb4518d (diff)
Add lunarvim update to lsp/general
Diffstat (limited to '.config/nvim/lua/config')
-rw-r--r--.config/nvim/lua/config/defaults.lua7
-rw-r--r--.config/nvim/lua/config/init.lua5
2 files changed, 9 insertions, 3 deletions
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 }