From 8eb8d54d93ebe8cd511f634d2d069c7e556169c7 Mon Sep 17 00:00:00 2001 From: materus Date: Wed, 25 Mar 2026 20:16:21 +0100 Subject: [PATCH] Update system. Changes in neovim config --- config/editor/neovim/init.lua | 72 +----------- config/editor/neovim/lua/materus/init.lua | 103 ++++++++++++++++++ flake.lock | 48 ++++---- .../host/materusPC/home-manager/materus.nix | 1 + nix-config/shared/nvim.nix | 16 ++- 5 files changed, 144 insertions(+), 96 deletions(-) create mode 100644 config/editor/neovim/lua/materus/init.lua diff --git a/config/editor/neovim/init.lua b/config/editor/neovim/init.lua index f8e3e0e..af30f4c 100644 --- a/config/editor/neovim/init.lua +++ b/config/editor/neovim/init.lua @@ -1,70 +1,2 @@ -vim.opt.number = true -vim.opt.expandtab = true -vim.opt.shiftwidth = 2 -vim.opt.softtabstop = 2 -vim.opt.tabstop = 2 -vim.opt.clipboard:append { 'unnamed', 'unnamedplus' } - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if vim.fn.executable("git") == 1 then - if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) - end - vim.opt.rtp:prepend(lazypath) - - local opts = {} - local plugins = { - { - "Mofiqul/dracula.nvim", - lazy = false, - priority = 1000, - opts = {} - }, - { - "romgrk/barbar.nvim", - init = function() vim.g.barbar_auto_setup = false end, - dependencies = {"nvim-tree/nvim-web-devicons","lewis6991/gitsigns.nvim"} - }, - - { - 'nvim-telescope/telescope.nvim', version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - } - }, - - { - 'nvim-treesitter/nvim-treesitter', - lazy = false, - build = ':TSUpdate' - }, - { - 'lambdalisue/vim-suda' - }, - --[[ - { - "kevinhwang91/nvim-ufo", - dependencies = {"kevinhwang91/promise-async"}, - opts = {} - }]] - } - - require("lazy").setup(plugins, opts) - if vim.fn.executable("tree-sitter") == 1 then - require('nvim-treesitter').setup { - -- Directory to install parsers and queries to (prepended to `runtimepath` to have priority) - install_dir = vim.fn.stdpath('data') .. '/site', - highlight = {enable = true}, - indent = { enable = true}, - } - require('nvim-treesitter').install { 'lua' } - end - vim.cmd [[colorscheme dracula]] -end +MATERUS = {} +require("materus") \ No newline at end of file diff --git a/config/editor/neovim/lua/materus/init.lua b/config/editor/neovim/lua/materus/init.lua new file mode 100644 index 0000000..0c93679 --- /dev/null +++ b/config/editor/neovim/lua/materus/init.lua @@ -0,0 +1,103 @@ +vim.opt.number = true +vim.opt.expandtab = true +vim.opt.cursorline = true +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 +vim.opt.tabstop = 2 +vim.opt.clipboard:append { 'unnamed', 'unnamedplus' } + + +--vim.g.cord_defer_startup = true + + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if vim.fn.executable("git") == 1 then + if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) + end + vim.opt.rtp:prepend(lazypath) + + local opts = {} + local plugins = { + { + "Mofiqul/dracula.nvim", + lazy = false, + priority = 1000, + opts = {} + }, + { + "romgrk/barbar.nvim", + init = function() vim.g.barbar_auto_setup = false end, + dependencies = { "nvim-tree/nvim-web-devicons", "lewis6991/gitsigns.nvim" } + }, + { + 'lewis6991/gitsigns.nvim' + }, + { + 'nvim-telescope/telescope.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + } + }, + { + 'lambdalisue/vim-suda' + }, + { + 'vyfor/cord.nvim' + }, + { + "dstein64/nvim-scrollview" + }, + { + "Isrothy/neominimap.nvim", + version = "v3.x.x", + lazy = false, + init = function() + vim.opt.wrap = true + vim.opt.sidescrolloff = 36 + vim.g.neominimap = { + auto_enable = false, + layout = "float", + click = { + enabled = true, + auto_switch_focus = false, + }, + } + end, + }, + --[[ + { + "kevinhwang91/nvim-ufo", + dependencies = {"kevinhwang91/promise-async"}, + opts = {} + }]] + } + + require("lazy").setup(plugins, opts) + if vim.fn.executable("tree-sitter") == 1 and MATERUS.NIXOS ~= 1 then + table.insert(plugins, { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate' + }) + end + + if vim.fn.executable("tree-sitter") == 1 and MATERUS.NIXOS ~= 1 then + require('nvim-treesitter').setup { + -- Directory to install parsers and queries to (prepended to `runtimepath` to have priority) + install_dir = vim.fn.stdpath('data') .. '/site', + highlight = { enable = true }, + indent = { enable = true }, + } + require('nvim-treesitter').install { 'lua' } + end + vim.cmd [[colorscheme dracula]] +end diff --git a/flake.lock b/flake.lock index e78930c..bb35a16 100644 --- a/flake.lock +++ b/flake.lock @@ -92,11 +92,11 @@ ] }, "locked": { - "lastModified": 1773264488, - "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", + "lastModified": 1774274588, + "narHash": "sha256-dnHvv5EMUgTzGZmA+3diYjQU2O6BEpGLEOgJ1Qe9LaY=", "owner": "nix-community", "repo": "home-manager", - "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", + "rev": "cf9686ba26f5ef788226843bc31fda4cf72e373b", "type": "github" }, "original": { @@ -114,11 +114,11 @@ ] }, "locked": { - "lastModified": 1773422513, - "narHash": "sha256-MPjR48roW7CUMU6lu0+qQGqj92Kuh3paIulMWFZy+NQ=", + "lastModified": 1774368172, + "narHash": "sha256-Vdfo8+2SQhgc7i+TCIkBXzypQCFAvNrWvhUkZQtFGKE=", "owner": "nix-community", "repo": "home-manager", - "rev": "ef12a9a2b0f77c8fa3dda1e7e494fca668909056", + "rev": "5068d0b03e8b2cfae58441775aa849b7028a3d39", "type": "github" }, "original": { @@ -178,11 +178,11 @@ ] }, "locked": { - "lastModified": 1773543606, - "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", + "lastModified": 1774320235, + "narHash": "sha256-tZpmUgKhyxtJo/ZLtUd4p8tC8PCaK1iFigELD/EFZMw=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", + "rev": "d6064384db4f5383f5dc8a5dcba6d43495cffca6", "type": "github" }, "original": { @@ -200,11 +200,11 @@ ] }, "locked": { - "lastModified": 1773543606, - "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", + "lastModified": 1774320235, + "narHash": "sha256-tZpmUgKhyxtJo/ZLtUd4p8tC8PCaK1iFigELD/EFZMw=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", + "rev": "d6064384db4f5383f5dc8a5dcba6d43495cffca6", "type": "github" }, "original": { @@ -286,11 +286,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1773389992, - "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", + "lastModified": 1774106199, + "narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", + "rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655", "type": "github" }, "original": { @@ -318,11 +318,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1773375660, - "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", + "lastModified": 1774244481, + "narHash": "sha256-4XfMXU0DjN83o6HWZoKG9PegCvKvIhNUnRUI19vzTcQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", + "rev": "4590696c8693fea477850fe379a01544293ca4e2", "type": "github" }, "original": { @@ -384,11 +384,11 @@ ] }, "locked": { - "lastModified": 1773550941, - "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", + "lastModified": 1774303811, + "narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", + "rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042", "type": "github" }, "original": { @@ -406,11 +406,11 @@ ] }, "locked": { - "lastModified": 1773550941, - "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", + "lastModified": 1774303811, + "narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", + "rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042", "type": "github" }, "original": { diff --git a/nix-config/host/materusPC/home-manager/materus.nix b/nix-config/host/materusPC/home-manager/materus.nix index 7475336..085568f 100644 --- a/nix-config/host/materusPC/home-manager/materus.nix +++ b/nix-config/host/materusPC/home-manager/materus.nix @@ -27,6 +27,7 @@ packwiz ani-cli mpv + kitty libreoffice-qt6-fresh diff --git a/nix-config/shared/nvim.nix b/nix-config/shared/nvim.nix index 7c73f42..b620a79 100644 --- a/nix-config/shared/nvim.nix +++ b/nix-config/shared/nvim.nix @@ -16,9 +16,21 @@ isHm: if isHm then # Home Manager lib.mkIf config.mkk.neovim.enable { - xdg.configFile."nvim/init.lua".source = "${config.mkk.dir}/config/editor/neovim/init.lua"; + xdg.configFile."nvim/lua/materus".source = "${config.mkk.dir}/config/editor/neovim/lua/materus"; + programs.neovim = { + enable = true; + plugins = [ + pkgs.vimPlugins.nvim-treesitter.withAllGrammars + ]; + + extraLuaConfig = lib.mkAfter '' + MATERUS = { + NIXOS = 1 + } + require("materus") + ''; + }; home.packages = [ - pkgs.neovim pkgs.fd pkgs.ripgrep pkgs.tree-sitter