Migrate to NvChad v2.5

This commit is contained in:
Daniele Viganò 2024-09-15 22:20:50 +02:00
parent 83e0df0bb5
commit af2bba4fbd
14 changed files with 227 additions and 88 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*lock.json

6
.stylua.toml Normal file
View 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
View 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>

View File

@ -1,5 +1,7 @@
## Install
**Derived from [NvChad v2.5](https://github.com/NvChad/NvChad/tree/v2.5)**
```bash
git clone https://daniele.vigano.me/git/dani/nvim.git ~/.config/nvim/lua/custom
git clone https://daniele.vigano.me/git/dani/nvim.git ~/.config/nvim
```

View File

@ -1,19 +1,40 @@
local autocmd = vim.api.nvim_create_autocmd
vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
vim.g.mapleader = " "
vim.opt.fillchars = { }
--
-- restore shift-y line copy
vim.keymap.set('n', 'Y', 'Y')
--
-- enable nvim intro
-- vim.opt.shortmess = "filnxtToO"
vim.opt.whichwrap:remove "<>[]hl"
--
-- python max columns
autocmd("FileType", {
pattern = "python",
callback = function()
vim.opt.textwidth = 79
vim.opt.colorcolumn = "80"
end,
})
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.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",
config = function()
require "options"
end,
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require "nvchad.autocmds"
vim.schedule(function()
require "mappings"
end)
require 'myinit'

View File

@ -2,8 +2,8 @@
local M = {}
M.ui = { theme = 'nightowl' }
M.plugins = "custom.plugins"
M.mappings = require "custom.mappings"
-- M.plugins = "plugins"
-- M.mappings = require "mappings"
return M

15
lua/configs/conform.lua Normal file
View 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,
-- },
}
require("conform").setup(options)

47
lua/configs/lazy.lua Normal file
View 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",
},
},
},
}

View File

@ -1,3 +1,4 @@
require "nvchad.mappings"
local M = {}
M.dap = {

19
lua/myinit.lua Normal file
View File

@ -0,0 +1,19 @@
local autocmd = vim.api.nvim_create_autocmd
vim.opt.fillchars = { }
--
-- restore shift-y line copy
vim.keymap.set('n', 'Y', 'Y')
--
-- enable nvim intro
-- vim.opt.shortmess = "filnxtToO"
vim.opt.whichwrap:remove "<>[]hl"
--
-- python max columns
autocmd("FileType", {
pattern = "python",
callback = function()
vim.opt.textwidth = 79
vim.opt.colorcolumn = "80"
end,
})

6
lua/options.lua Normal file
View File

@ -0,0 +1,6 @@
require "nvchad.options"
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!

64
lua/plugins/init.lua Normal file
View File

@ -0,0 +1,64 @@
return {
{
"stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save
config = function()
require "configs.conform"
end,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"python-lsp-server",
"debugpy",
},
},
},
{
"Bekaboo/deadcolumn.nvim",
},
{
"neovim/nvim-lspconfig",
config = function ()
require "nvchad.configs.lspconfig"
require "configs.lspconfig"
end
},
{
"stevearc/vim-arduino",
ft = {"arduino"},
},
{
"tpope/vim-fugitive",
lazy = false,
},
-- These are some examples, uncomment them if you want to see them work!
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- require("nvchad.configs.lspconfig").defaults()
-- require "configs.lspconfig"
-- end,
-- },
--
-- {
-- "williamboman/mason.nvim",
-- opts = {
-- ensure_installed = {
-- "lua-language-server", "stylua",
-- "html-lsp", "css-lsp" , "prettier"
-- },
-- },
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}

View File

@ -1,67 +0,0 @@
local plugins = {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"python-lsp-server",
"debugpy",
},
},
},
{
"Bekaboo/deadcolumn.nvim",
},
{
"neovim/nvim-lspconfig",
config = function ()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end
},
{
"stevearc/vim-arduino",
ft = {"arduino"},
},
{
"rcarriga/nvim-dap-ui",
dependencies = "mfussenegger/nvim-dap",
config = function()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
end
},
{
"mfussenegger/nvim-dap",
config = function(_, opts)
require("core.utils").load_mappings("dap")
end
},
{
"mfussenegger/nvim-dap-python",
ft = "python",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
config = function(_, opts)
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
require("dap-python").setup(path)
require("core.utils").load_mappings("dap_python")
end,
},
{
"tpope/vim-fugitive",
lazy = false,
},
}
return plugins