diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 16d9189..b103932 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -2,6 +2,8 @@ -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here +local map = LazyVim.safe_keymap_set + function ToggleBackground() if vim.opt.background:get() == "dark" then vim.opt.background = "light" @@ -10,9 +12,4 @@ function ToggleBackground() end end -vim.keymap.set( - "n", - "", - "lua ToggleBackground()", - { desc = "Switch between dark and light themes", noremap = true } -) +map("n", "", "lua ToggleBackground()", { desc = "Switch between dark and light themes", noremap = true })