Add initial nvchad config
This commit is contained in:
39
nvim/lua/chadrc.lua
Normal file
39
nvim/lua/chadrc.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
||||
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "onedark",
|
||||
|
||||
-- hl_override = {
|
||||
-- Comment = { italic = true },
|
||||
-- ["@comment"] = { italic = true },
|
||||
-- },
|
||||
}
|
||||
|
||||
|
||||
M.ui = {
|
||||
statusline = {
|
||||
theme = "vscode_colored",
|
||||
},
|
||||
|
||||
nvdash = {
|
||||
load_on_startup = true,
|
||||
header = {
|
||||
" ▄▄ ▄ ▄▄▄▄▄▄▄ ",
|
||||
"▄▀███▄ ▄██ █████▀ ",
|
||||
"██▄▀███▄ ███ ",
|
||||
"███ ▀███▄ ███ ",
|
||||
"███ ▀██ ███ ",
|
||||
"███ ▀ ███ ",
|
||||
"▀██ █████▄▀█▀▄██████▄ ",
|
||||
" ▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return M
|
||||
15
nvim/lua/configs/conform.lua
Normal file
15
nvim/lua/configs/conform.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
return options
|
||||
24
nvim/lua/configs/default-lsp.lua
Normal file
24
nvim/lua/configs/default-lsp.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
ensure_installed = {
|
||||
"lua-language-server",
|
||||
"luacheck",
|
||||
|
||||
"misspell",
|
||||
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"bash-language-server",
|
||||
|
||||
"rust-analyzer",
|
||||
"taplo",
|
||||
|
||||
"jdtls",
|
||||
|
||||
"clangd",
|
||||
|
||||
"pyright",
|
||||
"ruff",
|
||||
|
||||
"dockerfile-language-server",
|
||||
},
|
||||
}
|
||||
14
nvim/lua/configs/default-ts.lua
Normal file
14
nvim/lua/configs/default-ts.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"rust",
|
||||
"java",
|
||||
"c",
|
||||
"cpp",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"comment",
|
||||
"toml",
|
||||
},
|
||||
}
|
||||
47
nvim/lua/configs/lazy.lua
Normal file
47
nvim/lua/configs/lazy.lua
Normal file
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
24
nvim/lua/configs/lspconfig.lua
Normal file
24
nvim/lua/configs/lspconfig.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- load defaults i.e lua_lsp
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
-- EXAMPLE
|
||||
local servers = { "html", "cssls" }
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.tsserver.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
9
nvim/lua/configs/nvim-tree.lua
Normal file
9
nvim/lua/configs/nvim-tree.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
renderer = {
|
||||
icons = {
|
||||
show = {
|
||||
git = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
21
nvim/lua/mappings.lua
Normal file
21
nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
require "nvchad.mappings"
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
-- Group names
|
||||
map("n", "<leader>d", "", { desc = "test" })
|
||||
|
||||
-- General
|
||||
map("n", "<leader>q", "<Cmd>confirm q<CR>", { desc = "test" })
|
||||
|
||||
-- Lsp
|
||||
map(
|
||||
"n",
|
||||
"<leader>lf",
|
||||
"<CMD> lua require('conform').format { lsp_fallback = true }<CR>",
|
||||
{ desc = "General Format file" }
|
||||
)
|
||||
8
nvim/lua/options.lua
Normal file
8
nvim/lua/options.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
22
nvim/lua/plugins/crates.lua
Normal file
22
nvim/lua/plugins/crates.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"saecki/crates.nvim",
|
||||
tag = "stable",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
config = function()
|
||||
require("crates").setup{
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
completion = {
|
||||
crates = {
|
||||
enabled = true,
|
||||
max_results = 10,
|
||||
min_chars = 3,
|
||||
},
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
7
nvim/lua/plugins/endhints.lua
Normal file
7
nvim/lua/plugins/endhints.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"chrisgrieser/nvim-lsp-endhints",
|
||||
event = "LspAttach",
|
||||
opts = {icons = {
|
||||
type = " ",
|
||||
},},}
|
||||
|
||||
36
nvim/lua/plugins/init.lua
Normal file
36
nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
-- event = 'BufWritePre', -- uncomment for format on save
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"Pocco81/auto-save.nvim",
|
||||
config = function()
|
||||
require("auto-save").setup()
|
||||
end,
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = require "configs.default-ts",
|
||||
},
|
||||
{
|
||||
"hiphish/rainbow-delimiters.nvim",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = require "configs.nvim-tree",
|
||||
},
|
||||
}
|
||||
7
nvim/lua/plugins/mason-tool-installer.lua
Normal file
7
nvim/lua/plugins/mason-tool-installer.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("mason-tool-installer").setup(require "configs.default-lsp")
|
||||
end,
|
||||
}
|
||||
19
nvim/lua/plugins/onedarker.lua
Normal file
19
nvim/lua/plugins/onedarker.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"navarasu/onedark.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("onedark").setup {
|
||||
style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
|
||||
toggle_style_key = "<leader>ss",
|
||||
transparent = false, -- Show/hide background
|
||||
|
||||
code_style = {
|
||||
comments = "italic",
|
||||
keywords = "italic,",
|
||||
functions = "bold",
|
||||
strings = "none",
|
||||
variables = "none",
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
12
nvim/lua/plugins/project.lua
Normal file
12
nvim/lua/plugins/project.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"ahmedkhalf/project.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("telescope").load_extension "projects"
|
||||
require("project_nvim").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
end,
|
||||
}
|
||||
14
nvim/lua/plugins/rustaceanvim.lua
Normal file
14
nvim/lua/plugins/rustaceanvim.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5", -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
config = function()
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
float_win_config = {
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user