From 98f8a77819670ce6012216e01885c135a6d3a289 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Sat, 24 Jul 2021 21:17:11 -0400 Subject: New contract (#1080) Changes to the global config object O is now lvim user_plugins is now plugins user_autocommands is now autocommands No more lang specific plugins Null-ls has replaced both formatter.nvim and nvim-lint --- init.lua | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 2e3a5d32..73f0a325 100644 --- a/init.lua +++ b/init.lua @@ -7,10 +7,12 @@ vim.cmd [[ set runtimepath-=~/.config/nvim set runtimepath-=~/.config/nvim/after - set runtimepath^=~/.config/lvim + set runtimepath+=~/.config/lvim + set runtimepath^=~/.local/share/lunarvim/lvim/after ]] -- vim.opt.rtp:append() instead of vim.cmd ? require "default-config" +require "settings" local status_ok, error = pcall(vim.cmd, "luafile ~/.config/lvim/lv-config.lua") if not status_ok then print "something is wrong with your lv-config" @@ -21,17 +23,30 @@ require "keymappings" local plugins = require "plugins" local plugin_loader = require("plugin-loader").init() -plugin_loader:load { plugins, O.user_plugins } -vim.g.colors_name = O.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs. -vim.cmd("colorscheme " .. O.colorscheme) +plugin_loader:load { plugins, lvim.plugins } +vim.g.colors_name = lvim.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs. +vim.cmd("colorscheme " .. lvim.colorscheme) -require "settings" -require "lv-utils" +local utils = require "lv-utils" +utils.toggle_autoformat() +require("lsp").setup_handlers() + +local null_status_ok, null_ls = pcall(require, "null-ls") +if null_status_ok then + null_ls.config {} + require("lspconfig")["null-ls"].setup {} +end + +local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings") +if lsp_settings_status_ok then + lsp_settings.setup { + config_home = os.getenv "HOME" .. "/.config/lvim/lsp-settings", + } +end -- TODO: these guys need to be in language files --- require "lsp" --- if O.lang.emmet.active then +-- if lvim.lang.emmet.active then -- require "lsp.emmet-ls" -- end --- if O.lang.tailwindcss.active then +-- if lvim.lang.tailwindcss.active then -- require "lsp.tailwind -- cgit v1.2.3