summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-05-21 16:48:47 +0200
committerGitHub <[email protected]>2022-05-21 16:48:47 +0200
commit23df368b00bda0ed4a01fac92f7ad80998c1d34a (patch)
tree2362ff18ac68eab313380e814238fa15c1237934 /utils
parenta2454310b6c0b5b530521a77b9b8eb290274e040 (diff)
refactor: load the default options once (#2592)
BREAKING CHANGE: modifying the default options for keymaps and autocmds is now done by overwriting them, since they won't be loaded into the global `lvim` table anymore * refactor: use the lua-commands api * refactor!: use the lua-autocmds api * fix(settings): let neovim handle spellfile * feat: add log:set_log_level() * chore: update examples * chore: add deprecation notice for custom_groups
Diffstat (limited to 'utils')
-rw-r--r--utils/installer/config.example.lua21
-rw-r--r--utils/installer/config_win.example.lua21
2 files changed, 30 insertions, 12 deletions
diff --git a/utils/installer/config.example.lua b/utils/installer/config.example.lua
index 562d4060..120cd783 100644
--- a/utils/installer/config.example.lua
+++ b/utils/installer/config.example.lua
@@ -20,9 +20,9 @@ lvim.leader = "space"
-- add your own keymapping
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
-- unmap a default keymapping
--- lvim.keys.normal_mode["<C-Up>"] = false
--- edit a default keymapping
--- lvim.keys.normal_mode["<C-q>"] = ":q<cr>"
+-- vim.keymap.del("n", "<C-Up>")
+-- override a default keymapping
+-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" -- or vim.keymap.set("n", "<C-q>", ":q<cr>" )
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
-- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
@@ -153,6 +153,15 @@ lvim.builtin.treesitter.highlight.enabled = true
-- }
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
--- lvim.autocommands.custom_groups = {
--- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
--- }
+-- vim.api.nvim_create_autocmd("BufEnter", {
+-- pattern = { "*.json", "*.jsonc" },
+-- -- enable wrap mode for json files only
+-- command = "setlocal wrap",
+-- })
+-- vim.api.nvim_create_autocmd("FileType", {
+-- pattern = "zsh",
+-- callback = function()
+-- -- let treesitter use bash highlight for zsh files as well
+-- require("nvim-treesitter.highlight").attach(0, "bash")
+-- end,
+-- })
diff --git a/utils/installer/config_win.example.lua b/utils/installer/config_win.example.lua
index b659263a..78468194 100644
--- a/utils/installer/config_win.example.lua
+++ b/utils/installer/config_win.example.lua
@@ -37,9 +37,9 @@ lvim.leader = "space"
-- add your own keymapping
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
-- unmap a default keymapping
--- lvim.keys.normal_mode["<C-Up>"] = false
--- edit a default keymapping
--- lvim.keys.normal_mode["<C-q>"] = ":q<cr>"
+-- vim.keymap.del("n", "<C-Up>")
+-- override a default keymapping
+-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" -- or vim.keymap.set("n", "<C-q>", ":q<cr>" )
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
-- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
@@ -168,6 +168,15 @@ lvim.builtin.treesitter.highlight.enabled = true
-- }
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
--- lvim.autocommands.custom_groups = {
--- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
--- }
+-- vim.api.nvim_create_autocmd("BufEnter", {
+-- pattern = { "*.json", "*.jsonc" },
+-- -- enable wrap mode for json files only
+-- command = "setlocal wrap",
+-- })
+-- vim.api.nvim_create_autocmd("FileType", {
+-- pattern = "zsh",
+-- callback = function()
+-- -- let treesitter use bash highlight for zsh files as well
+-- require("nvim-treesitter.highlight").attach(0, "bash")
+-- end,
+-- })