From 0917ab8bfa4a36034ea76acd097415e9e1b451db Mon Sep 17 00:00:00 2001 From: abux Date: Sun, 26 Jul 2026 13:02:30 +0100 Subject: [PATCH] first commit --- .stylua.toml | 6 +++ LICENSE | 24 ++++++++++ README.md | 9 ++++ init.lua | 37 ++++++++++++++++ lazy-lock.json | 35 +++++++++++++++ lua/autocmds.lua | 1 + lua/chadrc.lua | 32 ++++++++++++++ lua/configs/conform.lua | 15 +++++++ lua/configs/lazy.lua | 47 ++++++++++++++++++++ lua/configs/lspconfig.lua | 21 +++++++++ lua/mappings.lua | 11 +++++ lua/options.lua | 6 +++ lua/plugins/init.lua | 93 +++++++++++++++++++++++++++++++++++++++ 13 files changed, 337 insertions(+) create mode 100644 .stylua.toml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lua/autocmds.lua create mode 100644 lua/chadrc.lua create mode 100644 lua/configs/conform.lua create mode 100644 lua/configs/lazy.lua create mode 100644 lua/configs/lspconfig.lua create mode 100644 lua/mappings.lua create mode 100644 lua/options.lua create mode 100644 lua/plugins/init.lua diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..ecb6dca --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..769fbdf --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +**This repo is supposed to be 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! diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..e861b68 --- /dev/null +++ b/init.lua @@ -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 "autocmds" + +vim.schedule(function() + require "mappings" +end) diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..67cb5c8 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,35 @@ +{ + "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, + "NvChad": { "branch": "v2.5", "commit": "add44b952d631981614bbb8cfc6f7002f296dfe6" }, + "base46": { "branch": "v3.0", "commit": "a972909f1d7ba798b93b56631bc2cd5e96ea40da" }, + "cmp-async-path": { "branch": "main", "commit": "98185a91d49ff5dd249aebf2f7456e18063fa2a0" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "markdown-plus.nvim": { "branch": "main", "commit": "59075587b4540abd5fac68232c39d5a46db6d44c" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, + "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, + "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-lspconfig": { "branch": "master", "commit": "d224a1920728ba129880efc700d4a0180ac4ecbb" }, + "nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" }, + "nvim-tree.lua": { "branch": "master", "commit": "a797d5e20133fc031fba4aa7d1272f5b1d950a1c" }, + "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, + "nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" }, + "oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, + "outline.nvim": { "branch": "main", "commit": "2a132953b944561d45b52e4541ebfff71934a742" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "runner.nvim": { "branch": "main", "commit": "6b9d00e6c3c13d510d59d2f93fe34e93ff785f71" }, + "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "ui": { "branch": "v3.0", "commit": "5cfd3c8f2c3e6603d52d8f6c0b715743bbb5270d" }, + "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/lua/autocmds.lua b/lua/autocmds.lua new file mode 100644 index 0000000..d2db0bb --- /dev/null +++ b/lua/autocmds.lua @@ -0,0 +1 @@ +require "nvchad.autocmds" diff --git a/lua/chadrc.lua b/lua/chadrc.lua new file mode 100644 index 0000000..48ef76a --- /dev/null +++ b/lua/chadrc.lua @@ -0,0 +1,32 @@ +-- This file needs to have same structure as nvconfig.lua +-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua +-- Please read that file to know all available options :( + +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "mountain", + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, +} + +M.nvdash = { load_on_startup = true } +M.ui = { + tabufline = { + lazyload = false + }, + statusline = { + theme = "vscode_colored" + }, + cmp = { + icons = true, + icons_left = true, + style = "atom_colored", + }, +} + +return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua new file mode 100644 index 0000000..4459375 --- /dev/null +++ b/lua/configs/conform.lua @@ -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 diff --git a/lua/configs/lazy.lua b/lua/configs/lazy.lua new file mode 100644 index 0000000..cd170bd --- /dev/null +++ b/lua/configs/lazy.lua @@ -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", + }, + }, + }, +} diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua new file mode 100644 index 0000000..7065a8f --- /dev/null +++ b/lua/configs/lspconfig.lua @@ -0,0 +1,21 @@ +require("nvchad.configs.lspconfig").defaults() + +local lsp_dir = vim.fn.stdpath("data") .. "/lazy/nvim-lspconfig/lsp" +local ok, files = pcall(vim.fn.readdir, lsp_dir) +if not ok then + return +end + +for _, file in ipairs(files) do + local name = file:match("^(.+)%.lua$") + if name then + local cfg_ok, cfg = pcall(dofile, lsp_dir .. "/" .. file) + if cfg_ok and type(cfg) == "table" and type(cfg.cmd) == "table" then + local cmd = cfg.cmd[1] + if type(cmd) == "string" and vim.fn.executable(cmd) == 1 then + vim.lsp.config(name, cfg) + vim.lsp.enable(name) + end + end + end +end diff --git a/lua/mappings.lua b/lua/mappings.lua new file mode 100644 index 0000000..f4bc985 --- /dev/null +++ b/lua/mappings.lua @@ -0,0 +1,11 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") +map("n", "-", "Oil", { desc = "Open parent directory" }) + +-- map({ "n", "i", "v" }, "", " w ") diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..e89228e --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,6 @@ +require "nvchad.options" + +local o = vim.o +o.number = true +o.relativenumber = true +o.winborder = "rounded" diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..c76dc4d --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,93 @@ +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, + }, + + { + "ojroques/nvim-osc52", + opts = {} + }, + + { + "folke/todo-comments.nvim", + event = "BufRead", + config = function() + require("todo-comments").setup {} + end, + }, + + { + "MarcHamamji/runner.nvim", + event = "BufRead", + dependencies = { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + config = function() + require("runner").setup {} + end, + }, + + { + "hedyhli/outline.nvim", + keys = { { "cs", "Outline", desc = "Toggle Outline" } }, + cmd = "Outline", + opts = function() + local defaults = require("outline.config").defaults + local opts = { + symbols = { + icons = {}, + -- filter = vim.deepcopy(LazyVim.config.kind_filter), + }, + keymaps = { + up_and_jump = "", + down_and_jump = "", + }, + } + + for kind, symbol in pairs(defaults.symbols.icons) do + opts.symbols.icons[kind] = { + -- icon = LazyVim.config.icons.kinds[kind] or symbol.icon, + hl = symbol.hl, + } + end + return opts + end, + }, + + { + "stevearc/oil.nvim", + opts = {}, + -- dependencies = { { "nvim-mini/mini.icons", opts = {} } }, + lazy = false, + }, + + { + "yousefhadder/markdown-plus.nvim", + ft = "markdown", + opts = {}, + }, + + -- test new blink + -- { import = "nvchad.blink.lazyspec" }, + + -- { + -- "nvim-treesitter/nvim-treesitter", + -- opts = { + -- ensure_installed = { + -- "vim", "lua", "vimdoc", + -- "html", "css" + -- }, + -- }, + -- }, +}