init.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. require("lsp").setup_default_bindings()
  24. local plugins = require "plugins"
  25. local plugin_loader = require("plugin-loader").init()
  26. plugin_loader:load { plugins, lvim.plugins }
  27. vim.g.colors_name = lvim.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs.
  28. vim.cmd("colorscheme " .. lvim.colorscheme)
  29. local utils = require "utils"
  30. utils.toggle_autoformat()
  31. local commands = require "core.commands"
  32. commands.load(commands.defaults)
  33. require("lsp").setup_handlers()
  34. local null_status_ok, null_ls = pcall(require, "null-ls")
  35. if null_status_ok then
  36. null_ls.config {}
  37. require("lspconfig")["null-ls"].setup {}
  38. end
  39. local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings")
  40. if lsp_settings_status_ok then
  41. lsp_settings.setup {
  42. config_home = os.getenv "HOME" .. "/.config/lvim/lsp-settings",
  43. }
  44. end
  45. -- TODO: these guys need to be in language files
  46. -- if lvim.lang.emmet.active then
  47. -- require "lsp.emmet-ls"
  48. -- end
  49. -- if lvim.lang.tailwindcss.active then
  50. -- require "lsp.tailwind