nvchad 2.5 config migration

master
Elias Almqvist 4 months ago
parent 6a021b8a8c
commit 7049151967
No known key found for this signature in database
GPG Key ID: E31A99CE3E75A158
  1. 11
      nvchad/.config/nvim/lua/chadrc.lua
  2. 0
      nvchad/.config/nvim/lua/configs/conform.lua
  3. 47
      nvchad/.config/nvim/lua/configs/lazy.lua
  4. 22
      nvchad/.config/nvim/lua/configs/lspconfig.lua
  5. 18
      nvchad/.config/nvim/lua/custom/configs/lspconfig.lua
  6. 66
      nvchad/.config/nvim/lua/custom/configs/overrides.lua
  7. 12
      nvchad/.config/nvim/lua/custom/init.lua
  8. 0
      nvchad/.config/nvim/lua/highlights.lua
  9. 0
      nvchad/.config/nvim/lua/mappings.lua
  10. 6
      nvchad/.config/nvim/lua/options.lua
  11. 68
      nvchad/.config/nvim/lua/plugins/init.lua

@ -1,8 +1,11 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
---@type ChadrcConfig ---@type ChadrcConfig
local M = {} local M = {}
-- Path to overriding theme and highlights files -- Path to overriding theme and highlights files
local highlights = require "custom.highlights" local highlights = require "highlights"
M.ui = { M.ui = {
theme = "gruvchad", theme = "gruvchad",
@ -12,11 +15,9 @@ M.ui = {
hl_add = highlights.add, hl_add = highlights.add,
} }
M.plugins = "custom.plugins" M.plugins = "plugins"
-- check core.mappings for table structure -- check core.mappings for table structure
M.mappings = require "custom.mappings" M.mappings = require "mappings"
return M return M

@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

@ -0,0 +1,22 @@
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "tsserver", "clangd", "ghdl_ls", "hls", "tailwindcss", "pyright", "julials" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}

@ -1,18 +0,0 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require("lspconfig")
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "ghdl_ls", "hls", "tailwindcss", "pyright", "julials" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
on_attach = on_attach,
capabilities = capabilities,
})
end
--
-- lspconfig.pyright.setup { blabla}
--

@ -1,66 +0,0 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"markdown",
"markdown_inline",
"prisma",
"haskell",
"python",
"zig",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
}
M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
-- Fun/joke langs
"hls",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

@ -1,12 +0,0 @@
-- local autocmd = vim.api.nvim_create_autocmd
-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })
vim.filetype.add({
extension = {
mdx = 'mdx'
}
})

@ -0,0 +1,6 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

@ -1,5 +1,3 @@
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[] ---@type NvPluginSpec[]
local plugins = { local plugins = {
@ -8,15 +6,35 @@ local plugins = {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
config = function() config = function()
require("plugins.configs.lspconfig") -- require "plugins.configs.lspconfig"
require("custom.configs.lspconfig") require "configs.lspconfig"
end, -- Override to setup mason-lspconfig end, -- Override to setup mason-lspconfig
}, },
-- override plugin configs -- override plugin configs
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = overrides.mason, opts = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
-- Fun/joke langs
"hls",
},
},
}, },
-- { -- {
@ -24,7 +42,20 @@ local plugins = {
-- opts = overrides.treesitter, }, -- opts = overrides.treesitter, },
{ {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree, opts = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
},
}, },
-- Install a plugin -- Install a plugin
@ -63,7 +94,30 @@ local plugins = {
dependencies = { dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
}, },
opts = overrides.treesitter, opts = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"markdown",
"markdown_inline",
"prisma",
"haskell",
"python",
"zig",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
},
-- config = function(_, opts) -- config = function(_, opts)
-- dofile(vim.g.base46_cache .. "syntax") -- dofile(vim.g.base46_cache .. "syntax")
-- require("nvim-treesitter.configs").setup(opts) -- require("nvim-treesitter.configs").setup(opts)
Loading…
Cancel
Save