diff --git a/flake.lock b/flake.lock index e48dca5..af0f5d2 100644 --- a/flake.lock +++ b/flake.lock @@ -21,27 +21,6 @@ "type": "github" } }, - "devshell": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735644329, - "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=", - "owner": "numtide", - "repo": "devshell", - "rev": "f7795ede5b02664b57035b3b757876703e2c3eac", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "disko": { "inputs": { "nixpkgs": [ @@ -95,20 +74,6 @@ "type": "github" } }, - "flake-compat_2": { - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -130,27 +95,6 @@ "type": "github" } }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -169,50 +113,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "nixvim", - "flake-compat" - ], - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735882644, - "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -235,28 +135,6 @@ "type": "github" } }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "nixvim", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -277,55 +155,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1736366465, - "narHash": "sha256-Fo68EF6p/N9GJyHiAUbXtiE7IJlb3IMjK86LuxFMsRU=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "7e00856596891850ba5ad4c5ecd2ed74468c08c5", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "ixx": { - "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], - "nixpkgs": [ - "nixvim", - "nuschtosSearch", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", - "owner": "NuschtOS", - "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "ref": "v0.0.6", - "repo": "ixx", - "type": "github" - } - }, "lanzaboote": { "inputs": { "crane": "crane", @@ -353,27 +182,6 @@ "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1736370755, - "narHash": "sha256-iWcjToBpx4PUd74uqvIGAfqqVfyrvRLRauC/SxEKIF0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "57733bd1dc81900e13438e5b4439239f1b29db0e", - "type": "github" - }, - "original": { - "owner": "lnl7", - "repo": "nix-darwin", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1736012469, @@ -438,57 +246,6 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "devshell": "devshell", - "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts_2", - "git-hooks": "git-hooks", - "home-manager": "home-manager_2", - "nix-darwin": "nix-darwin", - "nixpkgs": [ - "nixpkgs" - ], - "nuschtosSearch": "nuschtosSearch", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1736430661, - "narHash": "sha256-0dabFSGqcPo47WfgPRM5usnVXaGMdYvPlDJ5PeIqjr4=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "67de84848e43ca6a5025e4f8eddc2f6684a51f2b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, - "nuschtosSearch": { - "inputs": { - "flake-utils": "flake-utils_2", - "ixx": "ixx", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735854821, - "narHash": "sha256-Iv59gMDZajNfezTO0Fw6LHE7uKAShxbvMidmZREit7c=", - "owner": "NuschtOS", - "repo": "search", - "rev": "836908e3bddd837ae0f13e215dd48767aee355f0", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "repo": "search", - "type": "github" - } - }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -525,7 +282,6 @@ "nixpkgs": "nixpkgs", "nixpkgs-borg": "nixpkgs-borg", "nixpkgs-btrbk": "nixpkgs-btrbk", - "nixvim": "nixvim", "sops-nix": "sops-nix", "treefmt": "treefmt" } @@ -590,21 +346,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt": { "inputs": { "nixpkgs": [ @@ -624,27 +365,6 @@ "repo": "treefmt-nix", "type": "github" } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1736154270, - "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7d7ad97..4ca2874 100644 --- a/flake.nix +++ b/flake.nix @@ -23,10 +23,6 @@ url = "github:nix-community/lanzaboote/v0.4.1"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs"; - }; nixpkgs-borg.url = "github:cything/nixpkgs/borg"; # unmerged PR nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR @@ -169,7 +165,6 @@ extraSpecialArgs = { inherit inputs outputs; }; modules = [ ./home/yt/ytnix.nix - inputs.nixvim.homeManagerModules.nixvim ]; }; diff --git a/home/nixvim/default.nix b/home/nixvim/default.nix deleted file mode 100644 index 0050777..0000000 --- a/home/nixvim/default.nix +++ /dev/null @@ -1,156 +0,0 @@ -{ pkgs, ...}: -{ - programs.nixvim = { - enable = true; - plugins.lualine.enable = true; - opts = { - number = true; - relativenumber = true; - expandtab = true; - autoindent = true; - shiftwidth = 2; - smartindent = true; - tabstop = 2; - ignorecase = true; - incsearch = true; - smartcase = true; - }; - colorscheme = "iceberg"; - clipboard.register = "unnamedplus"; - - globals = { - mapleader = ","; - }; - - extraPlugins = with pkgs.vimPlugins; [ - iceberg-vim - ]; - - keymaps = [ - { - action = "Neotree toggle"; - key = "s"; - mode = "n"; - options.silent = true; - } - { - # shortcut to command mode - action = ":"; - key = ";"; - mode = ["n" "x"]; - options.silent = true; - } - { - # insert line below without moving cursor - action = "printf('m`%so``', v:count1)"; - key = "o"; - options.expr = true; - mode = "n"; - } - { - # insert line above without moving cursor - action = "printf('m`%sO``', v:count1)"; - key = "O"; - options.expr = true; - mode = "n"; - } - # nice emacs bindings - { - action = ""; - key = ""; - mode = "i"; - } - { - action = ""; - key = ""; - mode = "i"; - } - ]; - - plugins.cmp = { - enable = true; - settings.sources = [ - { name = "nvim_lsp"; } - { name = "luasnip"; } - { name = "buffer"; } - { name = "nvim_lua"; } - { name = "path"; } - ]; - - settings.mappings = { - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = '' - cmp.mapping(function(fallback) - if require("luasnip").expand_or_jumpable() then - require("luasnip").expand_or_jump() - else - fallback() - end - end,{"i","s"}) - ''; - "" = '' - cmp.mapping(function(fallback) - if require("luasnip").jumpable(-1) then - require("luasnip").jump(-1) - else - fallback() - end - end,{"i","s"}) - ''; - }; - }; - plugins.lsp = { - enable = true; - keymaps.lspBuf = { - "K" = "hover"; - "gd" = "definition"; - "gD" = "references"; - "gt" = "type_definition"; - "gi" = "implementation"; - }; - servers = { - bashls.enable = true; - lua_ls.enable = true; - nil_ls.enable = true; - rust_analyzer = { - enable = true; - installRustc = true; - installCargo = true; - }; - }; - }; - plugins.treesitter = { - enable = true; - nixGrammars = true; - settings.indent.enable = true; - }; - plugins.fzf-lua = { - enable = true; - keymaps = { - "ff" = "git_files"; - "fg" = "live_grep"; - }; - }; - - plugins.neo-tree = { - enable = true; - closeIfLastWindow = true; - }; - - plugins.cmp-buffer.enable = true; - plugins.cmp-emoji.enable = true; - plugins.cmp-nvim-lsp.enable = true; - plugins.cmp-path.enable = true; - plugins.cmp_luasnip.enable = true; - plugins.luasnip.enable = true; - plugins.nvim-autopairs.enable = true; - plugins.rainbow-delimiters.enable = true; - plugins.web-devicons.enable = true; - plugins.gitsigns.enable = true; - }; -} diff --git a/home/nvim/init.lua b/home/nvim/init.lua new file mode 100644 index 0000000..b57e106 --- /dev/null +++ b/home/nvim/init.lua @@ -0,0 +1,84 @@ +require("plugin_specs") + +local keymap = vim.keymap +local opt = vim.opt +local api = vim.api + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 +vim.opt.termguicolors = true +require("nvim-tree").setup() + +require("lualine").setup({ + options = { + theme = "auto", + icons_enabled = true, + globalstatus = true, + }, +}) + +require("gitsigns").setup() + +opt.tabstop = 2 +opt.softtabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = true +opt.relativenumber = true +opt.ignorecase = true +opt.smartcase = true +opt.scrolloff = 3 +opt.confirm = true +opt.history = 500 +opt.undofile = true +opt.termguicolors = true +opt.showmode = false +opt.mouse = "" +opt.wrap = false +opt.clipboard:append("unnamedplus") + +vim.cmd.colorscheme("iceberg") + +-- restore terminal cursor on exit +api.nvim_create_autocmd("VimLeave", { + callback = function() + opt.guicursor = "a:ver25-blinkon500-blinkon500" + end, +}) + +-- blinking cursor in insert mode +opt.guicursor = "i-ci-ve:ver25-blinkon500-blinkon500" + +keymap.set("n", "s", require("nvim-tree.api").tree.toggle, { + desc = "toggle nvim-tree", + silent = true, +}) + +-- shortcut to command mode +keymap.set({ "n", "x" }, ";", ":", { silent = true }) + +keymap.set("n", "o", "printf('m`%so``', v:count1)", { + expr = true, + desc = "insert line below without moving cursor", +}) + +keymap.set("n", "O", "printf('m`%sO``', v:count1)", { + expr = true, + desc = "insert line above without moving cursor", +}) + +keymap.set("n", "/", [[/\v]]) + +keymap.set("n", "c", '"_c') +keymap.set("n", "C", '"_C') +keymap.set("n", "cc", '"_cc') +keymap.set("x", "c", '"_c') +keymap.set("x", "p", '"_cp') + +-- Break inserted text into smaller undo units when we insert some punctuation chars. +local undo_ch = { ",", ".", "!", "?", ";", ":" } +for _, ch in ipairs(undo_ch) do + keymap.set("i", ch, ch .. "u") +end + +keymap.set("i", "", "") +keymap.set("i", "", "") diff --git a/home/nvim/lazy-lock.json b/home/nvim/lazy-lock.json new file mode 100644 index 0000000..b35ef9f --- /dev/null +++ b/home/nvim/lazy-lock.json @@ -0,0 +1,24 @@ +{ + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "fzf-lua": { "branch": "main", "commit": "3d7e5db8fa56cfc2b92a38999016a51abe9e1d23" }, + "gitsigns.nvim": { "branch": "main", "commit": "b544bd62623ca1b483d8b9bfb6d65805f112a320" }, + "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, + "iceberg.vim": { "branch": "master", "commit": "23835d5ed696436f716cbfdb56a93a7850fe3b18" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, + "nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" }, + "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, + "nvim-treesitter": { "branch": "master", "commit": "622a4a6ba76d1de52b72a965159213ae655b4ac7" }, + "nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" }, + "tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" }, + "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" } +} diff --git a/home/nvim/lua/config/fzf.lua b/home/nvim/lua/config/fzf.lua new file mode 100644 index 0000000..c96f06d --- /dev/null +++ b/home/nvim/lua/config/fzf.lua @@ -0,0 +1,21 @@ +local keymap = vim.keymap + +local fzf = require("fzf-lua") + +keymap.set("n", "ff", fzf.files, { silent = true }) +keymap.set("n", "fr", fzf.oldfiles, { silent = true }) +keymap.set("n", "fc", fzf.resume, { silent = true }) +keymap.set("n", "fs", fzf.treesitter, { silent = true }) +keymap.set("n", "fg", fzf.grep_project, { silent = true }) + +fzf.setup({ + "fzf-native", + keymap = { + fzf = { + ["ctrl-u"] = "half-page-up", + ["ctrl-d"] = "half-page-down", + ["ctrl-j"] = "preview-page-down", + ["ctrl-k"] = "preview-page-up", + }, + }, +}) diff --git a/home/nvim/lua/config/hop.lua b/home/nvim/lua/config/hop.lua new file mode 100644 index 0000000..3724b9f --- /dev/null +++ b/home/nvim/lua/config/hop.lua @@ -0,0 +1,16 @@ +local hop = require("hop") +local keymap = vim.keymap + +hop.setup({ + case_insensitive = true, + char2_fallback_key = "", + quit_key = "", "", { + silent = true, + noremap = true, + callback = function() + hop.hint_char1() + end, +}) diff --git a/home/nvim/lua/config/lsp.lua b/home/nvim/lua/config/lsp.lua new file mode 100644 index 0000000..149163b --- /dev/null +++ b/home/nvim/lua/config/lsp.lua @@ -0,0 +1,74 @@ +local lsp = vim.lsp +local diagnostic = vim.diagnostic +local keymap = vim.keymap + +keymap.set("n", "gd", lsp.buf.definition) +keymap.set("n", "rn", lsp.buf.rename) +keymap.set("n", "gr", lsp.buf.references) +keymap.set("n", "[d", diagnostic.goto_prev) +keymap.set("n", "]d", diagnostic.goto_next) + +diagnostic.config({ + signs = false, +}) + +local lspconfig = require("lspconfig") +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +lspconfig.pylsp.setup({ capabilities = capabilities }) +lspconfig.clangd.setup({ capabilities = capabilities }) +lspconfig.bashls.setup({ capabilities = capabilities }) +lspconfig.rust_analyzer.setup({ + capabilities = capabilities, +}) + +lspconfig.gopls.setup({ + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + gofumpt = true, + }, + }, + capabilities = capabilities, +}) + +lspconfig.lua_ls.setup({ + capabilities = capabilities, + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc") then + return + end + end + + client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + -- Depending on the usage, you might want to add additional paths here. + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + }, + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + }, + }) + end, + settings = { + Lua = {}, + }, +}) + +lspconfig.nixd.setup({ capabilities = capabilities }) +lspconfig.terraformls.setup({ capabilities = capabilities }) diff --git a/home/nvim/lua/config/nvim-cmp.lua b/home/nvim/lua/config/nvim-cmp.lua new file mode 100644 index 0000000..8cfdedb --- /dev/null +++ b/home/nvim/lua/config/nvim-cmp.lua @@ -0,0 +1,54 @@ +local cmp = require("cmp") +local luasnip = require("luasnip") + +cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + if luasnip.expandable() then + luasnip.expand() + else + cmp.confirm({ + select = true, + }) + end + else + fallback() + end + end), + + [""] = cmp.mapping(function(fallback) + if luasnip.locally_jumpable(1) then + luasnip.jump(1) + elseif cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i", "s" }), + + [""] = cmp.mapping(function(fallback) + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + elseif cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i", "s" }), + }, + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + { name = "path" }, + }), +}) diff --git a/home/nvim/lua/plugin_specs.lua b/home/nvim/lua/plugin_specs.lua new file mode 100644 index 0000000..a51272e --- /dev/null +++ b/home/nvim/lua/plugin_specs.lua @@ -0,0 +1,99 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +vim.g.mapleader = "," + +local plugin_specs = { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = "VeryLazy", + }, + + { + "neovim/nvim-lspconfig", + event = { "BufRead", "BufNewFile" }, + config = function() + require("config.lsp") + end, + }, + + { + "hrsh7th/nvim-cmp", + event = "VeryLazy", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-omni", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + }, + config = function() + require("config.nvim-cmp") + end, + }, + + { + "L3MON4D3/LuaSnip", + version = "v2.*", + build = "make install_jsregexp", + }, + + { "stevearc/dressing.nvim", event = "VeryLazy" }, + + { + "nvim-tree/nvim-tree.lua", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + }, + + { + "ibhagwan/fzf-lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("config.fzf") + end, + }, + + { "windwp/nvim-autopairs", event = "InsertEnter", config = true }, + + { "tpope/vim-commentary", event = "VeryLazy" }, + + { "folke/tokyonight.nvim", lazy = false, priority = 1000 }, + + { "lewis6991/gitsigns.nvim" }, + + { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } }, + + { + "smoka7/hop.nvim", + version = "*", + config = function() + require("config.hop") + end, + }, + + { "cocopon/iceberg.vim" }, +} + +require("lazy").setup({ + spec = plugin_specs, + rocks = { enabled = true }, +}) diff --git a/home/sway/config b/home/sway/config index 7412fc4..a5521db 100644 --- a/home/sway/config +++ b/home/sway/config @@ -26,7 +26,7 @@ floating_modifier $mod normal default_border pixel smart_borders on focus_follows_mouse always -# mouse_warping container +mouse_warping container bindsym $mod+Return exec $term bindsym $mod+Ctrl+q kill diff --git a/home/yt/common.nix b/home/yt/common.nix index b4894d5..f14fc37 100644 --- a/home/yt/common.nix +++ b/home/yt/common.nix @@ -3,13 +3,16 @@ imports = [ ../tmux.nix ../zsh - ../nixvim ]; home.sessionVariables = { "EDITOR" = "nvim"; }; + xdg.configFile = { + nvim.source = ../nvim; + }; + home.packages = with pkgs; [ man-pages man-pages-posix @@ -27,6 +30,7 @@ }; programs.zoxide.enable = true; programs.eza.enable = true; + programs.neovim.enable = true; programs.git = { enable = true; userName = "cy"; diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 543e4e2..b3652ac 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -96,7 +96,7 @@ opentofu terraform-ls gdb - clang + gcc seahorse ]; diff --git a/hosts/chunk/forgejo.nix b/hosts/chunk/forgejo.nix index 41f0278..98706df 100644 --- a/hosts/chunk/forgejo.nix +++ b/hosts/chunk/forgejo.nix @@ -10,7 +10,6 @@ HTTP_PORT = 3000; HTTP_ADDR = "127.0.0.1"; DOMAIN = "git.cy7.sh"; - LANDING_PAGE = "/cy"; }; session.COOKIE_SECURE = true; service.DISABLE_REGISTRATION = true; @@ -19,7 +18,6 @@ DEFAULT_THEME = "gitea-dark"; }; actions.ENABLED = false; - repository.ENABLE_PUSH_CREATE_USER = true; }; database = { type = "postgres";