feat: add neovim config w/ nvchad v2.0
This commit is contained in:
parent
8a5ee43828
commit
e573ccda4b
9 changed files with 256 additions and 0 deletions
3
home/private_dot_config/nvim/lua/custom/README.md
Normal file
3
home/private_dot_config/nvim/lua/custom/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Example_config
|
||||
|
||||
This can be used as an example custom config for NvChad, this branch is a minimal one. Do check the feature_full branch if you need all the ease in your config.
|
39
home/private_dot_config/nvim/lua/custom/chadrc.lua
Normal file
39
home/private_dot_config/nvim/lua/custom/chadrc.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
-- Path to overriding theme and highlights files
|
||||
local highlights = require "custom.highlights"
|
||||
|
||||
local is_darkmode = vim.system({"darkman","get"}, { text = true }, on_exit)
|
||||
if is_darkmode == "dark" then
|
||||
local c_theme = "nord"
|
||||
else
|
||||
local c_theme = "onenord_light"
|
||||
end
|
||||
|
||||
M.ui = {
|
||||
theme = c_theme,
|
||||
theme_toggle = { "nord", "onenord_light" },
|
||||
|
||||
hl_override = highlights.override,
|
||||
hl_add = highlights.add,
|
||||
|
||||
nvdash = {
|
||||
load_on_startup = true,
|
||||
-- generated with https://patorjk.com/software/taag/#
|
||||
header = {
|
||||
"▗▖ ▗▖▗▄▄▄▖ ▗▄▖ ▗▖ ▗▖▗▄▄▄▖▗▖ ▗▖",
|
||||
"▐▛▚▖▐▌▐▌ ▐▌ ▐▌▐▌ ▐▌ █ ▐▛▚▞▜▌",
|
||||
"▐▌ ▝▜▌▐▛▀▀▘▐▌ ▐▌▐▌ ▐▌ █ ▐▌ ▐▌",
|
||||
"▐▌ ▐▌▐▙▄▄▖▝▚▄▞▘ ▝▚▞▘ ▗▄█▄▖▐▌ ▐▌",
|
||||
" ",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.plugins = "custom.plugins"
|
||||
|
||||
-- check core.mappings for table structure
|
||||
M.mappings = require "custom.mappings"
|
||||
|
||||
return M
|
|
@ -0,0 +1,17 @@
|
|||
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" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
--
|
||||
-- lspconfig.pyright.setup { blabla}
|
21
home/private_dot_config/nvim/lua/custom/configs/null-ls.lua
Normal file
21
home/private_dot_config/nvim/lua/custom/configs/null-ls.lua
Normal file
|
@ -0,0 +1,21 @@
|
|||
local null_ls = require "null-ls"
|
||||
|
||||
local b = null_ls.builtins
|
||||
|
||||
local sources = {
|
||||
|
||||
-- webdev stuff
|
||||
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
|
||||
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
|
||||
|
||||
-- Lua
|
||||
b.formatting.stylua,
|
||||
|
||||
-- cpp
|
||||
b.formatting.clang_format,
|
||||
}
|
||||
|
||||
null_ls.setup {
|
||||
debug = true,
|
||||
sources = sources,
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
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",
|
||||
|
||||
-- python
|
||||
"python-lsp-server"
|
||||
},
|
||||
}
|
||||
|
||||
-- git support in nvimtree
|
||||
M.nvimtree = {
|
||||
git = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
renderer = {
|
||||
highlight_git = true,
|
||||
icons = {
|
||||
show = {
|
||||
git = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
19
home/private_dot_config/nvim/lua/custom/highlights.lua
Normal file
19
home/private_dot_config/nvim/lua/custom/highlights.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
-- 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
|
7
home/private_dot_config/nvim/lua/custom/init.lua
Normal file
7
home/private_dot_config/nvim/lua/custom/init.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
-- local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- Auto resize panes when resizing nvim window
|
||||
-- autocmd("VimResized", {
|
||||
-- pattern = "*",
|
||||
-- command = "tabdo wincmd =",
|
||||
-- })
|
12
home/private_dot_config/nvim/lua/custom/mappings.lua
Normal file
12
home/private_dot_config/nvim/lua/custom/mappings.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
---@type MappingsTable
|
||||
local M = {}
|
||||
|
||||
M.general = {
|
||||
n = {
|
||||
[";"] = { ":", "enter command mode", opts = { nowait = true } },
|
||||
},
|
||||
}
|
||||
|
||||
-- more keybinds!
|
||||
|
||||
return M
|
76
home/private_dot_config/nvim/lua/custom/plugins.lua
Normal file
76
home/private_dot_config/nvim/lua/custom/plugins.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
local overrides = require("custom.configs.overrides")
|
||||
|
||||
---@type NvPluginSpec[]
|
||||
local plugins = {
|
||||
|
||||
-- Override plugin definition options
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- format & linting
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
require "custom.configs.null-ls"
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
end, -- Override to setup mason-lspconfig
|
||||
},
|
||||
|
||||
-- override plugin configs
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = overrides.mason,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = overrides.treesitter,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = overrides.nvimtree,
|
||||
},
|
||||
|
||||
-- Install a plugin
|
||||
{
|
||||
"max397574/better-escape.nvim",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("better_escape").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
{ 'wakatime/vim-wakatime', lazy = false }
|
||||
|
||||
-- To make a plugin not be loaded
|
||||
-- {
|
||||
-- "NvChad/nvim-colorizer.lua",
|
||||
-- enabled = false
|
||||
-- },
|
||||
|
||||
-- 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
|
Loading…
Add table
Add a link
Reference in a new issue