mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-05 20:56:33 +05:30
update nvchad to 2.5.0
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
{pkgs, ...}: {
|
||||
# fix nvchad
|
||||
# xdg.configFile."nvim" = {
|
||||
# source = "${pkgs.nvchad}";
|
||||
# };
|
||||
xdg.configFile."nvim" = {
|
||||
source = "${pkgs.nvchad}";
|
||||
};
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
|
@ -1,49 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.nvterm = {
|
||||
t = {
|
||||
["<F7>"] = {
|
||||
function()
|
||||
require("nvterm.terminal").toggle("float")
|
||||
end,
|
||||
"Toggle floating term",
|
||||
},
|
||||
},
|
||||
n = {
|
||||
["<F7>"] = {
|
||||
function()
|
||||
require("nvterm.terminal").toggle("float")
|
||||
end,
|
||||
"Toggle floating term",
|
||||
},
|
||||
["<leader>Sl"] = { "<cmd>SessionManager! load_last_session<cr>", desc = "Load last session" },
|
||||
["<leader>Ss"] = { "<cmd>SessionManager! save_current_session<cr>", desc = "Save this session" },
|
||||
["<leader>Sd"] = { "<cmd>SessionManager! delete_session<cr>", desc = "Delete session" },
|
||||
["<leader>Sf"] = { "<cmd>SessionManager! load_session<cr>", desc = "Search sessions" },
|
||||
["<leader>S."] = {
|
||||
"<cmd>SessionManager! load_current_dir_session<cr>",
|
||||
desc = "Load current directory session",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if vim.g.neovide then
|
||||
M.neovide = {
|
||||
n = {
|
||||
["<C-=>"] = {
|
||||
function()
|
||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1
|
||||
end,
|
||||
desc = "Zoom In (Neovide)",
|
||||
},
|
||||
["<C-->"] = {
|
||||
function()
|
||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1
|
||||
end,
|
||||
desc = "Zoom Out (Neovide)",
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
@ -1,26 +1,16 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
custom = ./custom;
|
||||
nvim = ./nvim;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "nvchad";
|
||||
version = "2.0.0";
|
||||
version = "2.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "NvChad";
|
||||
repo = "NvChad";
|
||||
rev = "refs/heads/v2.0";
|
||||
sha256 = "sha256-tKMvKdB3jPSvcyewaOe8oak3pXhjAcLyyxgGMiMeqeU=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r * "$out/"
|
||||
mkdir -p "$out/lua/custom"
|
||||
cp -r ${custom}/* "$out/lua/custom/"
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cp -r ${nvim}/* "$out/"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
39
pkgs/nvchad/nvim/init.lua
Normal file
39
pkgs/nvchad/nvim/init.lua
Normal file
@ -0,0 +1,39 @@
|
||||
vim.g.base46_cache = vim.fn.stdpath("data") .. "/nvchad/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
|
||||
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)
|
@ -1,7 +1,7 @@
|
||||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "oxocarbon",
|
||||
theme = "poimandres",
|
||||
transparency = true,
|
||||
nvdash = {
|
||||
load_on_startup = true,
|
||||
@ -16,7 +16,4 @@ M.ui = {
|
||||
},
|
||||
}
|
||||
|
||||
M.mappings = require("custom.mappings")
|
||||
M.plugins = "custom.plugins"
|
||||
|
||||
return M
|
47
pkgs/nvchad/nvim/lua/configs/lazy.lua
Normal file
47
pkgs/nvchad/nvim/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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
local configs = require("plugins.configs.lspconfig")
|
||||
local configs = require("nvchad.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
@ -39,23 +39,6 @@ M.mason = {
|
||||
},
|
||||
}
|
||||
|
||||
M.nvterm = {
|
||||
terminals = {
|
||||
shell = vim.o.shell,
|
||||
list = {},
|
||||
type_opts = {
|
||||
float = {
|
||||
relative = "editor",
|
||||
row = 0.23,
|
||||
col = 0.15,
|
||||
width = 0.7,
|
||||
height = 0.5,
|
||||
border = "single",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
M.telescope = {
|
||||
defaults = {
|
||||
winblend = 40,
|
42
pkgs/nvchad/nvim/lua/mappings.lua
Normal file
42
pkgs/nvchad/nvim/lua/mappings.lua
Normal file
@ -0,0 +1,42 @@
|
||||
require("nvchad.mappings")
|
||||
|
||||
local map = vim.keymap.set
|
||||
local g = vim.g
|
||||
|
||||
local float_opts = {
|
||||
relative = "editor",
|
||||
row = 0.13,
|
||||
col = 0.14,
|
||||
width = 0.7,
|
||||
height = 0.7,
|
||||
border = "single",
|
||||
}
|
||||
|
||||
local toggleTerm = function()
|
||||
require("nvchad.term").toggle({ pos = "float", id = "float", float_opts = float_opts })
|
||||
end
|
||||
|
||||
local toggleLazygit = function()
|
||||
require("nvchad.term").toggle({ pos = "float", id = "lazygit", float_opts = float_opts, cmd = "lazygit" })
|
||||
end
|
||||
|
||||
local zoomInNeovide = function()
|
||||
g.neovide_scale_factor = g.neovide_scale_factor + 0.1
|
||||
end
|
||||
|
||||
local zoomOutNeovide = function()
|
||||
g.neovide_scale_factor = g.neovide_scale_factor - 0.1
|
||||
end
|
||||
|
||||
map({ "n", "t" }, "<F7>", toggleTerm, { desc = "Toggle Floating Terminal" })
|
||||
map({ "n", "t" }, "<F8>", toggleLazygit, { desc = "Toggle Lazygit" })
|
||||
map("n", "<leader>Sl", "<cmd>SessionManager! load_last_session<cr>", { desc = "Load last session" })
|
||||
map("n", "<leader>Ss", "<cmd>SessionManager! save_current_session<cr>", { desc = "Save this session" })
|
||||
map("n", "<leader>Sd", "<cmd>SessionManager! delete_session<cr>", { desc = "Delete session" })
|
||||
map("n", "<leader>Sf", "<cmd>SessionManager! load_session<cr>", { desc = "Search sessions" })
|
||||
map("n", "<leader>S.", "<cmd>SessionManager! load_current_dir_session<cr>", { desc = "Load current directory session" })
|
||||
|
||||
if g.neovide then
|
||||
map("n", "<C-=>", zoomInNeovide, { desc = "Zoom In (Neovide)" })
|
||||
map("n", "<C-->", zoomOutNeovide, { desc = "Zoom Out (Neovide)" })
|
||||
end
|
@ -1,3 +1,5 @@
|
||||
require "nvchad.options"
|
||||
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
@ -8,3 +10,4 @@ opt.guifont = "FiraCode Nerd Font:h12"
|
||||
-- neovide stuff
|
||||
g.neovide_scale_factor = 0.7
|
||||
-- g.neovide_transparency = 0.8
|
||||
|
@ -1,6 +1,12 @@
|
||||
local overrides = require("custom.configs.overrides")
|
||||
local overrides = require("configs.overrides")
|
||||
|
||||
local plugins = {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require "configs.conform"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = overrides.treesitter,
|
||||
@ -9,35 +15,11 @@ local plugins = {
|
||||
"williamboman/mason.nvim",
|
||||
opts = overrides.mason,
|
||||
},
|
||||
{
|
||||
"NvChad/nvterm",
|
||||
opts = overrides.nvterm,
|
||||
},
|
||||
-- {
|
||||
-- "telescope.nvim",
|
||||
-- opts = overrides.telescope,
|
||||
-- },
|
||||
-- Need to setup properly
|
||||
-- {
|
||||
-- "stevearc/conform.nvim",
|
||||
-- event = "BufWritePre",
|
||||
-- config = function()
|
||||
-- require("custom.configs.conform")
|
||||
-- end,
|
||||
-- },
|
||||
-- {
|
||||
-- "mfussenegger/nvim-lint",
|
||||
-- lazy = true,
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- config = function()
|
||||
-- require("custom.configs.nvim-lint")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"David-Kunz/gen.nvim",
|
||||
lazy = false,
|
||||
opts = function()
|
||||
return require("custom.configs.gen")
|
||||
return require("configs.gen")
|
||||
end,
|
||||
},
|
||||
{
|
||||
@ -57,21 +39,21 @@ local plugins = {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
opts = function()
|
||||
return require("custom.configs.noice")
|
||||
return require("configs.noice")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("plugins.configs.lspconfig")
|
||||
require("custom.configs.lspconfig")
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
require("configs.lspconfig")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return require("custom.configs.null-ls")
|
||||
return require("configs.null-ls")
|
||||
end,
|
||||
},
|
||||
{
|
Reference in New Issue
Block a user