init.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. vim.cmd [[
  2. set packpath-=~/.config/nvim
  3. set packpath-=~/.config/nvim/after
  4. set packpath-=~/.local/share/nvim/site
  5. set packpath^=~/.local/share/lunarvim/site
  6. set packpath^=~/.config/lvim
  7. set runtimepath-=~/.config/nvim
  8. set runtimepath-=~/.config/nvim/after
  9. set runtimepath+=~/.config/lvim
  10. set runtimepath^=~/.local/share/lunarvim/lvim/after
  11. ]]
  12. -- vim.opt.rtp:append() instead of vim.cmd ?
  13. require "default-config"
  14. require("settings").load_options()
  15. local status_ok, error = pcall(vim.cmd, "luafile ~/.config/lvim/lv-config.lua")
  16. if not status_ok then
  17. print "something is wrong with your lv-config"
  18. print(error)
  19. end
  20. require("settings").load_commands()
  21. require("core.autocmds").define_augroups(lvim.autocommands)
  22. require "keymappings"
  23. local plugins = require "plugins"
  24. local plugin_loader = require("plugin-loader").init()
  25. plugin_loader:load { plugins, lvim.plugins }
  26. vim.g.colors_name = lvim.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs.
  27. vim.cmd("colorscheme " .. lvim.colorscheme)
  28. local utils = require "utils"
  29. utils.toggle_autoformat()
  30. local commands = require "core.commands"
  31. commands.load(commands.defaults)
  32. require("lsp").setup_handlers()
  33. local null_status_ok, null_ls = pcall(require, "null-ls")
  34. if null_status_ok then
  35. null_ls.config {}
  36. require("lspconfig")["null-ls"].setup {}
  37. end
  38. local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings")
  39. if lsp_settings_status_ok then
  40. lsp_settings.setup {
  41. config_home = os.getenv "HOME" .. "/.config/lvim/lsp-settings",
  42. }
  43. end
  44. -- TODO: these guys need to be in language files
  45. -- if lvim.lang.emmet.active then
  46. -- require "lsp.emmet-ls"
  47. -- end
  48. -- if lvim.lang.tailwindcss.active then
  49. -- require "lsp.tailwind