init.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. -- Noah's Neovim Configuration (init.lua)
  2. -- 1. Essential Neovim 0.11+ fixes and environment setup
  3. -- Add paths to RTP
  4. local site = vim.fn.expand("~/.local/share/nvim/site/")
  5. local ts_runtime = vim.fn.expand("~/.cache/vim/plugged/nvim-treesitter/runtime/")
  6. vim.opt.runtimepath:prepend(site)
  7. vim.opt.runtimepath:prepend(ts_runtime)
  8. -- Disable built-in LSP mappings
  9. local builtins = { 'grn', 'gra', 'grr', 'gri', 'grt' }
  10. for _, k in ipairs(builtins) do
  11. pcall(vim.keymap.del, 'n', k, { builtin = true })
  12. end
  13. -- Disable built-in commentary
  14. vim.g.loaded_commentary = 1
  15. -- 2. Load basic settings
  16. require('options')
  17. -- 3. Load plugins (Vimscript)
  18. vim.cmd('source $XDG_CONFIG_HOME/nvim/vim-plug/plugins.vim')
  19. -- 4. Load Theme (Important for Treesitter highlight groups)
  20. require('theme')
  21. -- 5. Load Plugin configurations (some are still in vimscript)
  22. local plug_confs = {
  23. 'fern', 'emmet', 'ctrlp', 'sneak', 'airline',
  24. 'startify', 'wilder', 'vcoolor', 'better-whitespace', 'vimspector'
  25. }
  26. for _, conf in ipairs(plug_confs) do
  27. vim.cmd('source $XDG_CONFIG_HOME/nvim/plug-conf/' .. conf .. '.vim')
  28. end
  29. -- 6. Load Lua-specific configurations
  30. require('treesitter')
  31. require('lsp')
  32. require('telescope-conf')
  33. require('refactoring-conf')
  34. require('gitsigns-conf')
  35. require('indent-blankline')
  36. require('whichkey')
  37. require('colorizer').setup()
  38. -- 7. Load keybinds and autocommands
  39. require('keymaps')
  40. require('autocmds')
  41. -- Enable intelligent indentation
  42. vim.cmd('filetype plugin indent on')