diff --git a/nvim/init.lua b/nvim/init.lua index 40197c9..093de34 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -14,38 +14,6 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require("lazy").setup("plugins") +require("settings").setup() require("lsp-user-config").setup() - -vim.g["mapleader"] = " " -vim.g["maplocalleader"] = "," -vim.g["syntax"] = true - --- Editor configuration -vim.opt.completeopt = "menuone,noselect" -vim.opt.termguicolors = true -vim.opt.encoding = "utf-8" -vim.opt.number = true -vim.opt.relativenumber = true -vim.opt.cursorline = true -vim.opt.expandtab = true -vim.opt.shiftwidth = 4 -vim.opt.tabstop = 4 -vim.opt.conceallevel = 1 -vim.opt.list = true -vim.opt.listchars = { tab = " ", trail = "·" } -vim.opt_local.spell = true -vim.opt.smartindent = true - --- I have yet to solve how to do the following in Lua, lmao -vim.cmd("highlight clear SpellBad") -vim.cmd("highlight clear SpellLocal") -vim.cmd("highlight clear SpellCap") -vim.cmd("highlight clear SpellRare") -vim.cmd("highlight Visual term=reverse cterm=reverse") -vim.cmd("colorscheme fds-theme") - --- Keybindings -vim.keymap.set("n", "bd", ":bd", {}) -vim.keymap.set("i", "jk", "", {}) -vim.keymap.set("n", "hr", "source $MYVIMRC", {}) +require("lazy").setup("plugins") diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua new file mode 100644 index 0000000..0ae9891 --- /dev/null +++ b/nvim/lua/settings.lua @@ -0,0 +1,38 @@ +local module = {} + +function module.setup() + vim.g["mapleader"] = " " + vim.g["maplocalleader"] = "," + vim.g["syntax"] = true + + -- Editor configuration + vim.opt.completeopt = { "menuone", "noselect" } + vim.opt.termguicolors = true + vim.opt.encoding = "utf-8" + vim.opt.number = true + vim.opt.relativenumber = true + vim.opt.cursorline = true + vim.opt.expandtab = true + vim.opt.shiftwidth = 4 + vim.opt.tabstop = 4 + vim.opt.conceallevel = 1 + vim.opt.list = true + vim.opt.listchars = { tab = " ", trail = "·" } + vim.opt_local.spell = true + vim.opt.smartindent = true + + -- I have yet to solve how to do the following in Lua, lmao + vim.cmd("highlight clear SpellBad") + vim.cmd("highlight clear SpellLocal") + vim.cmd("highlight clear SpellCap") + vim.cmd("highlight clear SpellRare") + vim.cmd("highlight Visual term=reverse cterm=reverse") + vim.cmd("colorscheme fds-theme") + + -- Keybindings + vim.keymap.set("n", "bd", ":bd", {}) + vim.keymap.set("i", "jk", "", {}) + vim.keymap.set("n", "hr", "source $MYVIMRC", {}) +end + +return module