From 84d2e3c61cb8b631d81461137b0d0db392b0f907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sun, 5 Jan 2025 18:48:43 +0100 Subject: [PATCH] Merge with upstream --- init.lua | 8 +++----- lua/chadrc.lua | 15 ++++++++++----- lua/configs/conform.lua | 2 +- lua/configs/lspconfig.lua | 2 ++ lua/mappings.lua | 10 ++++++++-- lua/plugins/init.lua | 9 +++------ 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/init.lua b/init.lua index a11f713..d6ddbe7 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,10 @@ -vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +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.loop.fs_stat(lazypath) then +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 @@ -20,9 +20,6 @@ require("lazy").setup({ lazy = false, branch = "v2.5", import = "nvchad.plugins", - config = function() - require "options" - end, }, { import = "plugins" }, @@ -32,6 +29,7 @@ require("lazy").setup({ dofile(vim.g.base46_cache .. "defaults") dofile(vim.g.base46_cache .. "statusline") +require "options" require "nvchad.autocmds" vim.schedule(function() diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 2ca9a30..1130825 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -1,12 +1,17 @@ +-- 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 = "nightowl" + theme = "nightowl" + + -- hl_override = { + -- Comment = { italic = true }, + -- ["@comment"] = { italic = true }, + -- }, } --- M.plugins = "plugins" --- M.mappings = require "mappings" - - return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index a000447..35ba6cf 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -12,4 +12,4 @@ local options = { -- }, } -require("conform").setup(options) +return options diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index 2821a45..bbf9638 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -1,3 +1,5 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() local lspconfig = require("lspconfig") lspconfig.pylsp.setup{ diff --git a/lua/mappings.lua b/lua/mappings.lua index 3d79bb2..4c49ac9 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -1,11 +1,17 @@ require "nvchad.mappings" + +-- add yours here + local map = vim.keymap.set --- +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") + +-- map({ "n", "i", "v" }, "", " w ") + -- restore shift-y line copy map('n', 'Y', 'Y') --- -- Copilot mappings map('i', '', 'copilot#Accept("\\")', { expr = true, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 44bc78f..e0c3e84 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -6,9 +6,7 @@ return { { "stevearc/conform.nvim", -- event = 'BufWritePre', -- uncomment for format on save - config = function() - require "configs.conform" - end, + opts = require "configs.conform", }, { "williamboman/mason.nvim", @@ -24,10 +22,9 @@ return { }, { "neovim/nvim-lspconfig", - config = function () - require "nvchad.configs.lspconfig" + config = function() require "configs.lspconfig" - end + end, }, { "stevearc/vim-arduino",