mirror of
https://github.com/eRgo35/nix-config.git
synced 2026-02-04 11:26:12 +01:00
apparently there has been nvchad update
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
# NVChad Config
|
|
||||||
|
|
||||||
Currently, it's nvchad example config + my minor additons to ease my with my C++/Rust/Web development
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
---@type ChadrcConfig
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
-- Path to overriding theme and highlights files
|
|
||||||
local highlights = require "custom.highlights"
|
|
||||||
|
|
||||||
M.ui = {
|
|
||||||
theme = "gruvbox",
|
|
||||||
theme_toggle = { "gruvbox", "everforest_light" },
|
|
||||||
|
|
||||||
hl_override = highlights.override,
|
|
||||||
hl_add = highlights.add,
|
|
||||||
|
|
||||||
-- nvdash (dashboard)
|
|
||||||
nvdash = {
|
|
||||||
load_on_startup = true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
M.plugins = "custom.plugins"
|
|
||||||
|
|
||||||
-- check core.mappings for table structure
|
|
||||||
M.mappings = require "custom.mappings"
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
--type conform.options
|
|
||||||
local options = {
|
|
||||||
lsp_fallback = true,
|
|
||||||
|
|
||||||
formatters_by_ft = {
|
|
||||||
lua = { "stylua" },
|
|
||||||
|
|
||||||
javascript = { "prettier" },
|
|
||||||
css = { "prettier" },
|
|
||||||
html = { "prettier" },
|
|
||||||
|
|
||||||
sh = { "shfmt" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- adding same formatter for multiple filetypes can look too much work for some
|
|
||||||
-- instead of the above code you could just use a loop! the config is just a table after all!
|
|
||||||
|
|
||||||
-- format_on_save = {
|
|
||||||
-- -- These options will be passed to conform.format()
|
|
||||||
-- timeout_ms = 500,
|
|
||||||
-- lsp_fallback = true,
|
|
||||||
-- },
|
|
||||||
}
|
|
||||||
|
|
||||||
require("conform").setup(options)
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
local on_attach = require("plugins.configs.lspconfig").on_attach
|
|
||||||
local capabilities = require("plugins.configs.lspconfig").capabilities
|
|
||||||
|
|
||||||
local lspconfig = require "lspconfig"
|
|
||||||
local util = require "lspconfig/util"
|
|
||||||
|
|
||||||
-- if you just want default config for the servers then put them in a table
|
|
||||||
local servers = { "html", "cssls", "tsserver", "clangd" }
|
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
lspconfig.svelte.setup {}
|
|
||||||
|
|
||||||
lspconfig.clangd.setup {
|
|
||||||
on_attach = function (client, bufnr)
|
|
||||||
client.server_capabilities.signatureHelpProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
end,
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
|
|
||||||
lspconfig.rust_analyzer.setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
filetypes = {"rust"},
|
|
||||||
root_dir = util.root_pattern("Cargo.toml"),
|
|
||||||
settings = {
|
|
||||||
['rust_analyzer'] = {
|
|
||||||
cargo = {
|
|
||||||
allFeatures = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
--
|
|
||||||
-- lspconfig.pyright.setup { blabla}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
|
|
||||||
local opts = {
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.formatting.clang_format,
|
|
||||||
},
|
|
||||||
on_attach = function (client, bufnr)
|
|
||||||
if client.supports_method("textDocument/formatting") then
|
|
||||||
vim.api.nvim_clear_autocmds({
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format({ bufnr = bufnr })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
return opts
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
M.treesitter = {
|
|
||||||
ensure_installed = {
|
|
||||||
"vim",
|
|
||||||
"lua",
|
|
||||||
"html",
|
|
||||||
"css",
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"tsx",
|
|
||||||
"c",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
},
|
|
||||||
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",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- git support in nvimtree
|
|
||||||
M.nvimtree = {
|
|
||||||
git = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
renderer = {
|
|
||||||
highlight_git = true,
|
|
||||||
icons = {
|
|
||||||
show = {
|
|
||||||
git = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
-- To find any highlight groups: "<cmd> Telescope highlights"
|
|
||||||
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
|
|
||||||
-- base30 variable names can also be used as colors
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
---@type Base46HLGroupsList
|
|
||||||
M.override = {
|
|
||||||
Comment = {
|
|
||||||
italic = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
---@type HLTable
|
|
||||||
M.add = {
|
|
||||||
NvimTreeOpenedFolderName = { fg = "green", bold = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
-- local autocmd = vim.api.nvim_create_autocmd
|
|
||||||
|
|
||||||
-- Auto resize panes when resizing nvim window
|
|
||||||
-- autocmd("VimResized", {
|
|
||||||
-- pattern = "*",
|
|
||||||
-- command = "tabdo wincmd =",
|
|
||||||
-- })
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
---@type MappingsTable
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
M.general = {
|
|
||||||
n = {
|
|
||||||
[";"] = { ":", "enter command mode", opts = { nowait = true } },
|
|
||||||
|
|
||||||
-- format with conform
|
|
||||||
["<leader>fm"] = {
|
|
||||||
function()
|
|
||||||
require("conform").format()
|
|
||||||
end,
|
|
||||||
"formatting",
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
v = {
|
|
||||||
[">"] = { ">gv", "indent"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
M.dap = {
|
|
||||||
plugin = true,
|
|
||||||
n = {
|
|
||||||
["<leader>db"] = {
|
|
||||||
"<cmd> DapToggleBreakpoint <CR>",
|
|
||||||
"Add breakpoint at line",
|
|
||||||
},
|
|
||||||
["<leader>dr"] = {
|
|
||||||
"<cmd> DapContinue <CR>",
|
|
||||||
"Start or continue the debugger",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- more keybinds!
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
local overrides = require("custom.configs.overrides")
|
|
||||||
|
|
||||||
---@type NvPluginSpec[]
|
|
||||||
local plugins = {
|
|
||||||
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
require "plugins.configs.lspconfig"
|
|
||||||
require "custom.configs.lspconfig"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
opts = {
|
|
||||||
ensure_installed = {
|
|
||||||
"rust-analyzer",
|
|
||||||
"clangd",
|
|
||||||
"clang-format",
|
|
||||||
"codelldb",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
opts = overrides.treesitter,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
opts = overrides.nvimtree,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = function()
|
|
||||||
return require "custom.configs.null-ls"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = "mfussenegger/nvim-dap",
|
|
||||||
config = function()
|
|
||||||
local dap = require("dap")
|
|
||||||
local dapui = require("dapui")
|
|
||||||
dapui.setup()
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.after.event_terminated["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.after.event_exited["dapui_config"] = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
handlers = {}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
config = function(_, _)
|
|
||||||
require("core.utils").load_mappings("dap")
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"rust-lang/rust.vim",
|
|
||||||
ft = "rust",
|
|
||||||
init = function ()
|
|
||||||
vim.g.rustfmt_autosave = 1
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"saecki/crates.nvim",
|
|
||||||
ft = {"rust", "toml"},
|
|
||||||
config = function(_, opts)
|
|
||||||
local crates = require('crates')
|
|
||||||
crates.setup(opts)
|
|
||||||
crates.show()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
opts = function()
|
|
||||||
local M = require "plugins.configs.cmp"
|
|
||||||
table.insert(M.sources, {name = "crates"})
|
|
||||||
return M
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"nanotee/zoxide.vim",
|
|
||||||
lazy = false,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"othree/html5.vim",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"pangloss/vim-javascript",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"evanleck/vim-svelte",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"max397574/better-escape.nvim",
|
|
||||||
event = "InsertEnter",
|
|
||||||
config = function()
|
|
||||||
require("better_escape").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
config = function()
|
|
||||||
require "custom.configs.conform"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- All NvChad plugins are lazy-loaded by default
|
|
||||||
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
|
|
||||||
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
|
|
||||||
-- {
|
|
||||||
-- "mg979/vim-visual-multi",
|
|
||||||
-- lazy = false,
|
|
||||||
-- }
|
|
||||||
}
|
|
||||||
|
|
||||||
return plugins
|
|
||||||
Reference in New Issue
Block a user