...
This commit is contained in:
commit
c3f3c33668
19 changed files with 441 additions and 0 deletions
6
.stylua.toml
Normal file
6
.stylua.toml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
column_width = 120
|
||||||
|
line_endings = "Unix"
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
quote_style = "AutoPreferDouble"
|
||||||
|
call_parentheses = "None"
|
24
LICENSE
Normal file
24
LICENSE
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <https://unlicense.org>
|
9
README.md
Normal file
9
README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
**This repo is supposed to used as config by NvChad users!**
|
||||||
|
|
||||||
|
- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo.
|
||||||
|
- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"`
|
||||||
|
- So you can delete the .git from this repo ( when you clone it locally ) or fork it :)
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
|
||||||
|
1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier!
|
37
init.lua
Normal file
37
init.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-- bootstrap lazy and all plugins
|
||||||
|
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
|
if not vim.uv.fs_stat(lazypath) then
|
||||||
|
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
local lazy_config = require "configs.lazy"
|
||||||
|
|
||||||
|
-- load plugins
|
||||||
|
require("lazy").setup({
|
||||||
|
{
|
||||||
|
"NvChad/NvChad",
|
||||||
|
lazy = false,
|
||||||
|
branch = "v2.5",
|
||||||
|
import = "nvchad.plugins",
|
||||||
|
},
|
||||||
|
|
||||||
|
{ import = "plugins" },
|
||||||
|
}, lazy_config)
|
||||||
|
|
||||||
|
-- load theme
|
||||||
|
dofile(vim.g.base46_cache .. "defaults")
|
||||||
|
dofile(vim.g.base46_cache .. "statusline")
|
||||||
|
|
||||||
|
require "options"
|
||||||
|
require "nvchad.autocmds"
|
||||||
|
|
||||||
|
vim.schedule(function()
|
||||||
|
require "mappings"
|
||||||
|
end)
|
29
lazy-lock.json
Normal file
29
lazy-lock.json
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
||||||
|
"NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" },
|
||||||
|
"base46": { "branch": "v2.5", "commit": "40943fc668bf8f1caa4cc45f71c784cf0d3cc34f" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
|
"menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" },
|
||||||
|
"minty": { "branch": "main", "commit": "6dce9f097667862537823d515a0250ce58faab05" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "ae8a01bb40848490548e5d07b97ed972ed43c2f9" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "f7b76cd1a75615c8d6254fc58bedd2a7304eb7d8" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "5cf3434c694a94fccfca79588654e57053a68572" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "1736cb81bdc42e1ee206081a161bdb2af68fb7a1" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
|
||||||
|
"ui": { "branch": "v3.0", "commit": "ed09fb24023a34bcf01c021737f8475905f6cf96" },
|
||||||
|
"volt": { "branch": "main", "commit": "0cdfa1dfbbfc8fda340054915991fda188db8d8e" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }
|
||||||
|
}
|
23
lua/chadrc.lua
Normal file
23
lua/chadrc.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
-- This file needs to have same structure as nvconfig.lua
|
||||||
|
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
||||||
|
-- Please read that file to know all available options :(
|
||||||
|
|
||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.base46 = {
|
||||||
|
theme = "catppuccin",
|
||||||
|
transparency = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
M.nvdash = {
|
||||||
|
load_on_startup = true,
|
||||||
|
buttons = {
|
||||||
|
{ txt = " Find File", keys = "Spc f f", cmd = "Telescope find_files" },
|
||||||
|
{ txt = " Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" },
|
||||||
|
{ txt = " Find Word", keys = "Spc f w", cmd = "Telescope live_grep" },
|
||||||
|
{ txt = " Themes", keys = "Spc t h", cmd = ":lua require('nvchad.themes').open()" },
|
||||||
|
{ txt = " Mappings", keys = "Spc c h", cmd = "NvCheatsheet" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return M
|
15
lua/configs/conform.lua
Normal file
15
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
|
47
lua/configs/lazy.lua
Normal file
47
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
lua/configs/lspconfig.lua
Normal file
24
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.ts_ls.setup {
|
||||||
|
-- on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
-- capabilities = nvlsp.capabilities,
|
||||||
|
-- }
|
23
lua/lua/chadrc.lua
Normal file
23
lua/lua/chadrc.lua
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
-- This file needs to have same structure as nvconfig.lua
|
||||||
|
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
||||||
|
-- Please read that file to know all available options :(
|
||||||
|
|
||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.base46 = {
|
||||||
|
theme = "rosepine",
|
||||||
|
transparency = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
M.nvdash = {
|
||||||
|
load_on_startup = true,
|
||||||
|
buttons = {
|
||||||
|
{ txt = " Find File", keys = "Spc f f", cmd = "Telescope find_files" },
|
||||||
|
{ txt = " Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" },
|
||||||
|
{ txt = " Find Word", keys = "Spc f w", cmd = "Telescope live_grep" },
|
||||||
|
{ txt = " Themes", keys = "Spc t h", cmd = ":lua require('nvchad.themes').open()" },
|
||||||
|
{ txt = " Mappings", keys = "Spc c h", cmd = "NvCheatsheet" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return M
|
18
lua/lua/configs/conform.lua
Normal file
18
lua/lua/configs/conform.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
local options = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
css = { "prettier" },
|
||||||
|
html = { "prettier" },
|
||||||
|
c = { "clangd" },
|
||||||
|
cpp = { "clangd" },
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
-- format_on_save = {
|
||||||
|
-- These options will be passed to conform.format()
|
||||||
|
-- timeout_ms = 500,
|
||||||
|
-- lsp_fallback = true,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
47
lua/lua/configs/lazy.lua
Normal file
47
lua/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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
30
lua/lua/configs/lspconfig.lua
Normal file
30
lua/lua/configs/lspconfig.lua
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
-- load defaults i.e lua_lsp
|
||||||
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
|
|
||||||
|
local lspconfig = require "lspconfig"
|
||||||
|
|
||||||
|
-- EXAMPLE
|
||||||
|
local servers = {
|
||||||
|
"html",
|
||||||
|
"cssls",
|
||||||
|
"clangd",
|
||||||
|
"zls",
|
||||||
|
"nixd",
|
||||||
|
}
|
||||||
|
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.ts_ls.setup {
|
||||||
|
-- on_attach = nvlsp.on_attach,
|
||||||
|
-- on_init = nvlsp.on_init,
|
||||||
|
-- capabilities = nvlsp.capabilities,
|
||||||
|
-- }
|
10
lua/lua/mappings.lua
Normal file
10
lua/lua/mappings.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require "nvchad.mappings"
|
||||||
|
|
||||||
|
-- add yours here
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
|
map("i", "jk", "<ESC>")
|
||||||
|
|
||||||
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
6
lua/lua/options.lua
Normal file
6
lua/lua/options.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
require "nvchad.options"
|
||||||
|
|
||||||
|
-- add yours here!
|
||||||
|
|
||||||
|
-- local o = vim.o
|
||||||
|
-- o.cursorlineopt ='both' -- to enable cursorline!
|
52
lua/lua/plugins/init.lua
Normal file
52
lua/lua/plugins/init.lua
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
"vimdoc",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"bash",
|
||||||
|
"c",
|
||||||
|
"cpp",
|
||||||
|
"rust",
|
||||||
|
"zig",
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"lua-language-server",
|
||||||
|
"stylua",
|
||||||
|
"clangd",
|
||||||
|
"clang-format",
|
||||||
|
"zls",
|
||||||
|
"prettier",
|
||||||
|
"deno",
|
||||||
|
"shfmt",
|
||||||
|
"rust-analyzer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
10
lua/mappings.lua
Normal file
10
lua/mappings.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require "nvchad.mappings"
|
||||||
|
|
||||||
|
-- add yours here
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
|
map("i", "jk", "<ESC>")
|
||||||
|
|
||||||
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
6
lua/options.lua
Normal file
6
lua/options.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
require "nvchad.options"
|
||||||
|
|
||||||
|
-- add yours here!
|
||||||
|
|
||||||
|
-- local o = vim.o
|
||||||
|
-- o.cursorlineopt ='both' -- to enable cursorline!
|
25
lua/plugins/init.lua
Normal file
25
lua/plugins/init.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "nvim-treesitter/nvim-treesitter",
|
||||||
|
-- opts = {
|
||||||
|
-- ensure_installed = {
|
||||||
|
-- "vim", "lua", "vimdoc",
|
||||||
|
-- "html", "css"
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
}
|
Loading…
Reference in a new issue