From 0b8b647f059bcc645b0d492869796fab026989cf Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Sat, 8 Nov 2025 01:40:27 +0800 Subject: [PATCH] feat: Move nvchad config to `ulic-youthlic/nvchad-starter` --- flake.lock | 13 +++-- flake.nix | 4 +- nvchad/init.lua | 37 ------------ nvchad/lua/autocmds.lua | 1 - nvchad/lua/chadrc.lua | 31 ---------- nvchad/lua/configs/conform.lua | 18 ------ nvchad/lua/configs/idris2.lua | 8 --- nvchad/lua/configs/lazy.lua | 45 --------------- nvchad/lua/configs/lspconfig.lua | 23 -------- nvchad/lua/mappings.lua | 32 ----------- nvchad/lua/options.lua | 99 -------------------------------- nvchad/lua/plugins/init.lua | 56 ------------------ 12 files changed, 11 insertions(+), 356 deletions(-) delete mode 100644 nvchad/init.lua delete mode 100644 nvchad/lua/autocmds.lua delete mode 100644 nvchad/lua/chadrc.lua delete mode 100644 nvchad/lua/configs/conform.lua delete mode 100644 nvchad/lua/configs/idris2.lua delete mode 100644 nvchad/lua/configs/lazy.lua delete mode 100644 nvchad/lua/configs/lspconfig.lua delete mode 100644 nvchad/lua/mappings.lua delete mode 100644 nvchad/lua/options.lua delete mode 100644 nvchad/lua/plugins/init.lua diff --git a/flake.lock b/flake.lock index daea469..d80729b 100644 --- a/flake.lock +++ b/flake.lock @@ -1260,14 +1260,17 @@ "nvchad-starter": { "flake": false, "locked": { - "lastModified": 1, + "lastModified": 1762537390, "narHash": "sha256-Y6UCxZkTMCxnteIRtuvl49ceQNSu+EIH2PbjOGvvp/I=", - "path": "./nvchad", - "type": "path" + "owner": "ulic-youthlic", + "repo": "nvchad-starter", + "rev": "b713ab7064a8aac684e724f82a253e753754d396", + "type": "github" }, "original": { - "path": "./nvchad", - "type": "path" + "owner": "ulic-youthlic", + "repo": "nvchad-starter", + "type": "github" } }, "pre-commit-hooks-nix": { diff --git a/flake.nix b/flake.nix index 50ab6f7..7ca5cae 100644 --- a/flake.nix +++ b/flake.nix @@ -186,7 +186,9 @@ repo = "neovim-nightly-overlay"; }; nvchad-starter = { - url = "path:./nvchad"; + type = "github"; + owner = "ulic-youthlic"; + repo = "nvchad-starter"; flake = false; }; nix4nvchad = { diff --git a/nvchad/init.lua b/nvchad/init.lua deleted file mode 100644 index e861b68..0000000 --- a/nvchad/init.lua +++ /dev/null @@ -1,37 +0,0 @@ -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/nvchad/lua/autocmds.lua b/nvchad/lua/autocmds.lua deleted file mode 100644 index d2db0bb..0000000 --- a/nvchad/lua/autocmds.lua +++ /dev/null @@ -1 +0,0 @@ -require "nvchad.autocmds" diff --git a/nvchad/lua/chadrc.lua b/nvchad/lua/chadrc.lua deleted file mode 100644 index bd014be..0000000 --- a/nvchad/lua/chadrc.lua +++ /dev/null @@ -1,31 +0,0 @@ --- 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 = "solarized_light", - - -- hl_override = { - -- Comment = { italic = true }, - -- ["@comment"] = { italic = true }, - -- }, -} - -M.nvdash = { load_on_startup = true } -M.ui = { - cmp = { - style = "atom_colored", - }, - tabufline = { - -- lazyload = true, - enabled = false, - }, - statusline = { - enabled = true, - separator_style = "arrow", - theme = "default", - }, -} - -return M diff --git a/nvchad/lua/configs/conform.lua b/nvchad/lua/configs/conform.lua deleted file mode 100644 index dd5af91..0000000 --- a/nvchad/lua/configs/conform.lua +++ /dev/null @@ -1,18 +0,0 @@ -local options = { - formatters_by_ft = { - lua = { "stylua" }, - -- css = { "prettier" }, - -- html = { "prettier" }, - nix = { - "nixfmt", - lsp_format = "fallback", - }, - }, - format_on_save = { - -- These options will be passed to conform.format() - timeout_ms = 500, - lsp_fallback = true, - }, -} - -return options diff --git a/nvchad/lua/configs/idris2.lua b/nvchad/lua/configs/idris2.lua deleted file mode 100644 index 8504e40..0000000 --- a/nvchad/lua/configs/idris2.lua +++ /dev/null @@ -1,8 +0,0 @@ -local options = {} - -options = { - default_regexp_syntax = true, - use_default_semantic_hl_groups = true -} - -return options diff --git a/nvchad/lua/configs/lazy.lua b/nvchad/lua/configs/lazy.lua deleted file mode 100644 index e3b15c2..0000000 --- a/nvchad/lua/configs/lazy.lua +++ /dev/null @@ -1,45 +0,0 @@ -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/nvchad/lua/configs/lspconfig.lua b/nvchad/lua/configs/lspconfig.lua deleted file mode 100644 index d8d5552..0000000 --- a/nvchad/lua/configs/lspconfig.lua +++ /dev/null @@ -1,23 +0,0 @@ -require("nvchad.configs.lspconfig").defaults() - -vim.diagnostic.config({ - virtual_lines = { - current_line = true, - source = "if_many" - }, - virtual_text = false -}) - -local servers = { - "nixd", - "nil_ls", - "lua_ls", - "jsonls", - "taplo" -} -vim.lsp.enable(servers, true) - -local lua_ls_libraries = vim.deepcopy(vim.lsp.config.lua_ls.settings.Lua.workspace.library) -table.insert(lua_ls_libraries, - #lua_ls_libraries, vim.fn.stdpath "data" .. "/lazy/NvChad/lua/nvchad") -vim.lsp.config.lua_ls.settings.Lua.workspace.library = lua_ls_libraries diff --git a/nvchad/lua/mappings.lua b/nvchad/lua/mappings.lua deleted file mode 100644 index b561611..0000000 --- a/nvchad/lua/mappings.lua +++ /dev/null @@ -1,32 +0,0 @@ -require "nvchad.mappings" - -local map = vim.keymap.set - -map("n", "", ":", { desc = "CMD enter command mode" }) -map("n", "ti", function() - local is_enabled = vim.lsp.inlay_hint.is_enabled() - if is_enabled then - vim.lsp.inlay_hint.enable(false) - else - vim.lsp.inlay_hint.enable(true) - end -end, { desc = "Toggle lsp inlay hint" }) - -map({ "n", "v" }, "j", "gj") -map({ "n", "v" }, "k", "gk") -map({ "n", "v" }, "gj", "j") -map({ "n", "v" }, "gk", "k") -map({ "n", "v" }, "", "Telescope help_tags", { desc = "telescope help page" }) -map("i", "", "", { desc = "backspace" }) -map({ "n", "v" }, "tm", function() - local image_api = require("image") - local is_enabled = image_api.is_enabled() - if is_enabled then - image_api.disable() - else - image_api.enable() - end -end, { desc = "Toggle image.nvim" }) -map("n", "gh", "0") -map("n", "gl", "$") -map("n", "gs", "^") diff --git a/nvchad/lua/options.lua b/nvchad/lua/options.lua deleted file mode 100644 index 200ea2f..0000000 --- a/nvchad/lua/options.lua +++ /dev/null @@ -1,99 +0,0 @@ -local opt = vim.opt - -local options = { - autoindent = true, - autoread = true, - backspace = { - "indent", - "eol", - "start", - }, - backup = false, - breakindent = true, - breakindentopt = { "sbr" }, - showbreak = "↪", - cdhome = true, - cmdheight = 1, - completeopt = { - "fuzzy", - "menuone", - "noselect", - "popup", - }, - concealcursor = { ["v"] = true }, - confirm = true, - cursorline = true, - cursorlineopt = { "number", "screenline" }, - diffopt = { - "algorithm:minimal", - "closeoff", - "context:20", - "followwrap", - "internal", - "linematch:40", - }, - errorbells = true, - expandtab = true, - exrc = true, - foldcolumn = "auto", - fsync = true, - gdefault = false, - helplang = { - "zh", - "en", - }, - history = 10000, - hlsearch = true, - ignorecase = true, - smartcase = true, - inccommand = "split", - list = true, - listchars = { - tab = "--→", - trail = "·", - multispace = " ", - nbsp = "⍽", - space = "·", - }, - magic = true, - more = true, - mouse = "a", - number = true, - numberwidth = 4, - relativenumber = true, - scrollback = 100000, - scrolloff = 5, - shiftround = true, - shiftwidth = 2, - showmode = false, - signcolumn = "yes", - smoothscroll = true, - splitbelow = true, - splitright = true, - startofline = true, - swapfile = false, - tabclose = { - "uselast", - }, - tabstop = 2, - termguicolors = true, - undofile = true, - undolevels = 100000, - virtualedit = { - "block", - "onemore", - }, - whichwrap = { b = true, s = true, ["<"] = true, [">"] = true }, - wildmenu = true, - wildmode = { "full" }, - wildoptions = { - "fuzzy", - "pum", - }, - winborder = "solid", - wrap = true -} - -for key, value in pairs(options) do - opt[key] = value -end diff --git a/nvchad/lua/plugins/init.lua b/nvchad/lua/plugins/init.lua deleted file mode 100644 index 60c51b2..0000000 --- a/nvchad/lua/plugins/init.lua +++ /dev/null @@ -1,56 +0,0 @@ -return { - { - "stevearc/conform.nvim", - event = "BufWritePre", -- uncomment for format on save - opts = require "configs.conform", - }, - { - "neovim/nvim-lspconfig", - config = function() - require "configs.lspconfig" - end, - }, - { import = "nvchad.blink.lazyspec" }, - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "markdown", - "typst", - "lua", - "toml", - "yaml", - "json", - "rust" - }, - }, - }, - { - "idris-community/idris2-nvim", - dependencies = { - "neovim/nvim-lspconfig", - "MunifTanjim/nui.nvim" - }, - main = "idris2", - opts = require("configs.idris2"), - ft = { "idris2", "ipkg", "lidris2" } - }, - { - "3rd/image.nvim", - opts = { - processor = "magick_cli", - integrations = { - markdown = { - only_render_image_at_cursor = true, - only_render_image_at_cursor_mode = "popup", - }, - } - }, - ft = { "markdown", "typst" } - }, - { - "mrcjkb/rustaceanvim", - version = "^6", - lazy = false, - }, -}