diff --git a/flake.lock b/flake.lock index 6e383d8..5893e5d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,125 +1,24 @@ { "nodes": { - "custom-neovim": { - "inputs": { - "dressing-nvim": "dressing-nvim", - "flake-parts": "flake-parts", - "friendly-snippets": "friendly-snippets", - "headlines-nvim": "headlines-nvim", - "nixpkgs": "nixpkgs", - "nixvim": "nixvim", - "omnisharp-extended-lsp": "omnisharp-extended-lsp", - "rustaceanvim": "rustaceanvim", - "schemastore-nvim": "schemastore-nvim", - "transparent-nvim": "transparent-nvim" - }, - "locked": { - "lastModified": 1706707047, - "narHash": "sha256-W7jyLIXvcxM0LHVUdNKVFF6k6sVflHhWjU3xK9oTbmA=", - "owner": "wizardlink", - "repo": "neovim", - "rev": "977444de57fdce64a098ee1998b5178c42a09778", - "type": "github" - }, - "original": { - "owner": "wizardlink", - "repo": "neovim", - "type": "github" - } - }, - "dressing-nvim": { + "astronvim": { "flake": false, "locked": { - "lastModified": 1706493651, - "narHash": "sha256-Y+ABLhb3GIaPKOuQzkxsZsTo1WfgURAYVioP/eCSp/Y=", - "owner": "stevearc", - "repo": "dressing.nvim", - "rev": "6f212262061a2120e42da0d1e87326e8a41c0478", + "lastModified": 1707746071, + "narHash": "sha256-ElGVvoV5cjAcHG6CMKAbdwBCfcqnmQ7oLzqUkhkUWRs=", + "owner": "AstroNvim", + "repo": "AstroNvim", + "rev": "f8b94716912ad867998e0659497884d577cd9ec1", "type": "github" }, "original": { - "owner": "stevearc", - "repo": "dressing.nvim", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1706569497, - "narHash": "sha256-oixb0IDb5eZYw6BaVr/R/1pSoMh4rfJHkVnlgeRIeZs=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "60c614008eed1d0383d21daac177a3e036192ed8", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "custom-neovim", - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1704152458, - "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "AstroNvim", + "repo": "AstroNvim", "type": "github" } }, "flake-utils": { "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1694529238, @@ -135,95 +34,18 @@ "type": "github" } }, - "friendly-snippets": { - "flake": false, - "locked": { - "lastModified": 1706528225, - "narHash": "sha256-tIWZGunN4SzFYKvX5hVkIKYcaH7yuJ4rfjNYk+076PI=", - "owner": "rafamadriz", - "repo": "friendly-snippets", - "rev": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53", - "type": "github" - }, - "original": { - "owner": "rafamadriz", - "repo": "friendly-snippets", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "custom-neovim", - "nixvim", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "headlines-nvim": { - "flake": false, - "locked": { - "lastModified": 1699842954, - "narHash": "sha256-Iv5NZxjGTfcbat4Cre0Y4mqlxpxdjA98Jg6fMIr3nak=", - "owner": "lukas-reineke", - "repo": "headlines.nvim", - "rev": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2", - "type": "github" - }, - "original": { - "owner": "lukas-reineke", - "repo": "headlines.nvim", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ - "custom-neovim", - "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1704498488, - "narHash": "sha256-yINKdShHrtjdiJhov+q0s3Y3B830ujRoSbHduUNyKag=", + "lastModified": 1707683400, + "narHash": "sha256-Zc+J3UO1Xpx+NL8UB6woPHyttEy9cXXtm+0uWwzuYDc=", "owner": "nix-community", "repo": "home-manager", - "rev": "51e44a13acea71b36245e8bd8c7db53e0a3e61ee", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1707114923, - "narHash": "sha256-LDYPWa+BgxHSNEye93SyIPgz5u3RAfh78P9KyO+rQzI=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "afcedcf2c8e424d0465e823cf833eb3adebe1db7", + "rev": "21b078306a2ab68748abf72650db313d646cf2ca", "type": "github" }, "original": { @@ -238,16 +60,16 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2", + "systems": "systems", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1707098342, - "narHash": "sha256-dU5m6Cd4+WQZal2ICDVf1kww/dNzo1YUWRxWeCctEig=", + "lastModified": 1707847639, + "narHash": "sha256-mBmt1lFImpIK8VwHkJIenzVS95wD67dsfH1oRk2RiEg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "84ab8d11e8951a6551d1e1bf87796a8589da6d47", + "rev": "2a3429d4cfdc01794b9d6fc1b49be1da019b5606", "type": "github" }, "original": { @@ -324,28 +146,6 @@ "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "custom-neovim", - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1704277720, - "narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4", - "type": "github" - }, - "original": { - "owner": "lnl7", - "repo": "nix-darwin", - "type": "github" - } - }, "nix-filter": { "locked": { "lastModified": 1694857738, @@ -363,11 +163,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706371002, - "narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=", + "lastModified": 1707689078, + "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c002c6aa977ad22c60398daaa9be52f2203d0006", + "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", "type": "github" }, "original": { @@ -377,147 +177,13 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1704538339, - "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1706913249, - "narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e92b6015881907e698782c77641aa49298330223", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1701174899, - "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts_2", - "home-manager": "home-manager", - "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1705333192, - "narHash": "sha256-Cxxx2VrfTMdSzPPGVFe857TENmk9Qhg6UNWm1HcqRcU=", - "owner": "wizardlink", - "repo": "nixvim", - "rev": "228ba9b804ffa2ce5f57483ac64a2fc7ce336d2a", - "type": "github" - }, - "original": { - "owner": "wizardlink", - "repo": "nixvim", - "type": "github" - } - }, - "omnisharp-extended-lsp": { - "flake": false, - "locked": { - "lastModified": 1703496723, - "narHash": "sha256-vn3LExMNCBYTgR9q0Gy2hvUoJcMFsBMvjaeBcMv369c=", - "owner": "Hoffs", - "repo": "omnisharp-extended-lsp.nvim", - "rev": "4be2e8689067494ed7e5a4f1221adc31d1a07783", - "type": "github" - }, - "original": { - "owner": "Hoffs", - "repo": "omnisharp-extended-lsp.nvim", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "gitignore": "gitignore", - "nixpkgs": [ - "custom-neovim", - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "custom-neovim", - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1704668415, - "narHash": "sha256-BMzNHFod53iiU4lkR5WHwqQCFmaCLq85sUCskXneXlA=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "44493e2b3c3ebcd39a9947e9ed9f2c2af164ec4c", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { - "custom-neovim": "custom-neovim", - "home-manager": "home-manager_2", + "astronvim": "astronvim", + "home-manager": "home-manager", "hyprland": "hyprland", "hyprland-hyprfocus": "hyprland-hyprfocus", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs", "yazi": "yazi" } }, @@ -546,54 +212,7 @@ "type": "github" } }, - "rustaceanvim": { - "flake": false, - "locked": { - "lastModified": 1706631621, - "narHash": "sha256-nFDfeM1FJmPIR5ait+JwFmzGHhkfTSAdIOrU/AUDDOA=", - "owner": "mrcjkb", - "repo": "rustaceanvim", - "rev": "13d4e81629f9a92a18c05208110ea7e7f8a6f58c", - "type": "github" - }, - "original": { - "owner": "mrcjkb", - "repo": "rustaceanvim", - "type": "github" - } - }, - "schemastore-nvim": { - "flake": false, - "locked": { - "lastModified": 1706475642, - "narHash": "sha256-qCaJrsQIkMqSDU4LPU1PdXnLWIpn7s5GheR4LbEazQA=", - "owner": "b0o", - "repo": "SchemaStore.nvim", - "rev": "11d661ae5e08f19b5256661a6491a66fa26cdcfc", - "type": "github" - }, - "original": { - "owner": "b0o", - "repo": "SchemaStore.nvim", - "type": "github" - } - }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -608,7 +227,7 @@ "type": "github" } }, - "systems_3": { + "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -623,22 +242,6 @@ "type": "github" } }, - "transparent-nvim": { - "flake": false, - "locked": { - "lastModified": 1699805216, - "narHash": "sha256-wT+7rmp08r0XYGp+MhjJX8dsFTar8+nf10CV9OdkOSk=", - "owner": "xiyaowong", - "repo": "transparent.nvim", - "rev": "fd35a46f4b7c1b244249266bdcb2da3814f01724", - "type": "github" - }, - "original": { - "owner": "xiyaowong", - "repo": "transparent.nvim", - "type": "github" - } - }, "wlroots": { "flake": false, "locked": { @@ -675,11 +278,11 @@ ] }, "locked": { - "lastModified": 1706145785, - "narHash": "sha256-j9MP4fv2U/vdRKAXXc2gyMTmYwVnHP6kHx1/y6jprrU=", + "lastModified": 1706521509, + "narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "5a592647587cd20b9692a347df6939b6d371b3bb", + "rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8", "type": "github" }, "original": { @@ -690,16 +293,18 @@ }, "yazi": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_4", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1707187677, - "narHash": "sha256-2IXAbgOLcNotmiWOXUTR+Tzp4ZO1xiwQKvpFD7OqW7Q=", + "lastModified": 1707813055, + "narHash": "sha256-tI6xFUBWq89HqSj0b8TfpXtH5bgM0apOa21vQbn991s=", "owner": "sxyazi", "repo": "yazi", - "rev": "19791d8328c798157b3d75d35b955541a0f5f7c9", + "rev": "b027487d12213b3653f33265b291dd41c707d1ab", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5fdf5bd..1ea34bf 100644 --- a/flake.nix +++ b/flake.nix @@ -19,11 +19,17 @@ inputs.hyprland.follows = "hyprland"; }; - # My neovim configuration using nixvim. - custom-neovim.url = "github:wizardlink/neovim"; - # CLI file manager. - yazi.url = "github:sxyazi/yazi"; + yazi = { + url = "github:sxyazi/yazi"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Neovim distribution + astronvim = { + url = "github:AstroNvim/AstroNvim"; + flake = false; + }; }; outputs = @@ -32,10 +38,13 @@ , hyprland , nixpkgs , ... - }@inputs: { - nixosConfigurations.nixos = + } @ inputs: + let + system = "x86_64-linux"; + in + { + nixosConfigurations."nixos" = let - system = "x86_64-linux"; specialArgs = inputs; modules = [ ./nixos.nix @@ -57,6 +66,6 @@ in nixpkgs.lib.nixosSystem { inherit system specialArgs modules; }; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; + formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt; }; } diff --git a/home-manager.nix b/home-manager.nix index b84cbb9..91c77a3 100644 --- a/home-manager.nix +++ b/home-manager.nix @@ -11,6 +11,7 @@ ./programs/git.nix ./programs/hyprland ./programs/mangohud.nix + ./programs/neovim ./programs/obs-studio.nix ./programs/rofi ./programs/waybar.nix @@ -97,7 +98,7 @@ path-of-building protontricks vkbasalt - wineWowPackages.stableFull + winePackages.stableFull winetricks ## Libraries diff --git a/nixos.nix b/nixos.nix index dd24340..5f265a3 100644 --- a/nixos.nix +++ b/nixos.nix @@ -292,9 +292,6 @@ zip zoxide - # Development - custom-neovim.packages.${system}.default - # File managing yazi.packages.${pkgs.system}.default diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 1f3f0df..c45d878 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -23,6 +23,8 @@ /home/wizardlink/.local/bin \ /lib/flatpak/exports/bin \ /home/wizardlink/.local/share/scripts/burrito + + zoxide init --cmd cd fish | source ''; shellAbbrs = { diff --git a/programs/hyprland/default.nix b/programs/hyprland/default.nix index cf6bcdc..0e408aa 100644 --- a/programs/hyprland/default.nix +++ b/programs/hyprland/default.nix @@ -112,10 +112,10 @@ force_no_accel = true sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - } - device:wacom-bamboo-one-m-pen { - output = DP-2 + tablet { + output = DP-2 + } } general { diff --git a/programs/neovim/default.nix b/programs/neovim/default.nix new file mode 100644 index 0000000..97e4c53 --- /dev/null +++ b/programs/neovim/default.nix @@ -0,0 +1,104 @@ +{ pkgs, astronvim, lib, ... }: + +{ + programs.neovim = { + enable = true; + withNodeJs = true; + withPython3 = true; + + extraLuaConfig = builtins.readFile "${astronvim}/init.lua"; + + extraPackages = with pkgs; [ + # CMAKE + neocmakelsp + + # C/C++ + clang-tools + + # HTML/CSS + emmet-ls + vscode-langservers-extracted + + # JSON + nodePackages_latest.vscode-json-languageserver-bin + + # LUA + lua-language-server + stylua + + # Markdown + markdownlint-cli + marksman + prettierd + + # Nix + nil + nixpkgs-fmt + + # TypeScript + nodePackages.typescript-language-server + + # Rust + rust-analyzer + taplo + vscode-extensions.vadimcn.vscode-lldb.adapter + + # Vue + nodePackages.volar + + # YAML + yaml-language-server + ]; + }; + + xdg.configFile = lib.mkMerge [ + { "nvim/lua/astronvim".source = "${astronvim}/lua/astronvim"; } + { "nvim/lua/plugins".source = "${astronvim}/lua/plugins"; } + { "nvim/lua/resession/extensions".source = "${astronvim}/lua/resession/extensions"; } + { "nvim/lua/lazy_snapshot.lua".source = "${astronvim}/lua/lazy_snapshot.lua"; } + { "nvim/lua/user".source = ./user; } + { + "nvim/parser".source = + let + parsers = pkgs.symlinkJoin { + name = "treesitter-parsers"; + paths = (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: with plugins; [ + bash + c + cmake + cpp + css + cuda + dockerfile + gdscript + glsl + godot_resource + html + javascript + jsdoc + json + jsonc + lua + lua + markdown + markdown_inline + nim + nim_format_string + nix + objc + proto + python + query + tsx + typescript + vim + vimdoc + vue + yaml + ])).dependencies; + }; + in + "${parsers}/parser"; + } + ]; +} diff --git a/programs/neovim/user/.luacheckrc b/programs/neovim/user/.luacheckrc new file mode 100644 index 0000000..d1113eb --- /dev/null +++ b/programs/neovim/user/.luacheckrc @@ -0,0 +1,18 @@ +-- Global objects +globals = { + "astronvim", + "astronvim_installation", + "vim", + "bit", +} + +-- Rerun tests only if their modification time changed +cache = true + +-- Don't report unused self arguments of methods +self = false + +ignore = { + "631", -- max_line_length + "212/_.*", -- unused argument, for vars with "_" prefix +} diff --git a/programs/neovim/user/.neoconf.json b/programs/neovim/user/.neoconf.json new file mode 100644 index 0000000..2d7a81f --- /dev/null +++ b/programs/neovim/user/.neoconf.json @@ -0,0 +1,20 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + }, + "lspconfig": { + "lua_ls": { + "Lua.format.enable": false + } + } +} diff --git a/programs/neovim/user/.stylua.toml b/programs/neovim/user/.stylua.toml new file mode 100644 index 0000000..bfcffff --- /dev/null +++ b/programs/neovim/user/.stylua.toml @@ -0,0 +1,7 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" +collapse_simple_statement = "Always" diff --git a/programs/neovim/user/README.md b/programs/neovim/user/README.md new file mode 100644 index 0000000..e6c589a --- /dev/null +++ b/programs/neovim/user/README.md @@ -0,0 +1,36 @@ +# AstroNvim User Configuration Example + +A user configuration template for [AstroNvim](https://github.com/AstroNvim/AstroNvim) + +## 🛠️ Installation + +#### Make a backup of your current nvim and shared folder + +```shell +mv ~/.config/nvim ~/.config/nvim.bak +mv ~/.local/share/nvim ~/.local/share/nvim.bak +``` + +#### Clone AstroNvim + +```shell +git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim +``` + +#### Create a new user repository from this template + +Press the "Use this template" button above to create a new repository to store your user configuration. + +You can also just clone this repository directly if you do not want to track your user configuration in GitHub. + +#### Clone the repository + +```shell +git clone https://github.com// ~/.config/nvim/lua/user +``` + +#### Start Neovim + +```shell +nvim +``` diff --git a/programs/neovim/user/highlights/duskfox.lua b/programs/neovim/user/highlights/duskfox.lua new file mode 100644 index 0000000..31318ee --- /dev/null +++ b/programs/neovim/user/highlights/duskfox.lua @@ -0,0 +1,3 @@ +return { -- a table of overrides/changes to the duskfox theme + Normal = { bg = "#000000" }, +} diff --git a/programs/neovim/user/highlights/init.lua b/programs/neovim/user/highlights/init.lua new file mode 100644 index 0000000..f7e055b --- /dev/null +++ b/programs/neovim/user/highlights/init.lua @@ -0,0 +1,3 @@ +return { -- this table overrides highlights in all themes + -- Normal = { bg = "#000000" }, +} diff --git a/programs/neovim/user/init.lua b/programs/neovim/user/init.lua new file mode 100644 index 0000000..23bd69a --- /dev/null +++ b/programs/neovim/user/init.lua @@ -0,0 +1,110 @@ +return { + -- Configure AstroNvim updates + updater = { + remote = "origin", -- remote to use + channel = "stable", -- "stable" or "nightly" + version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) + branch = "nightly", -- branch name (NIGHTLY ONLY) + commit = nil, -- commit hash (NIGHTLY ONLY) + pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) + skip_prompts = false, -- skip prompts about breaking changes + show_changelog = true, -- show the changelog after performing an update + auto_quit = false, -- automatically quit the current session after a successful update + remotes = { -- easily add new remotes to track + -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url + -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, + -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork + }, + }, + + -- Set colorscheme to use + colorscheme = "catppuccin", + + -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on + diagnostics = { + virtual_text = true, + underline = true, + }, + + lsp = { + -- customize lsp formatting options + formatting = { + -- control auto formatting on save + format_on_save = { + enabled = true, -- enable or disable format on save globally + allow_filetypes = { -- enable format on save for specified filetypes only + -- "go", + "javascript", + "jsx", + "lua", + "nix", + "rust", + "tsx", + "typescript", + }, + ignore_filetypes = { -- disable format on save for specified filetypes + -- "python", + }, + }, + disabled = { -- disable formatting capabilities for the listed language servers + -- disable lua_ls formatting capability if you want to use StyLua to format your lua code + -- "lua_ls", + }, + timeout_ms = 1000, -- default format timeout + -- filter = function(client) -- fully override the default formatting function + -- return true + -- end + }, + -- enable servers that you already have installed without mason + servers = { + "clangd", + "cmake", + "cssls", + "html", + "jsonls", + "lua_ls", + "marksman", + "nil_ls", + "rust_analyzer", + "taplo", + "tsserver", + "volar", + "yamlls", + }, + }, + + -- Configure require("lazy").setup() options + lazy = { + defaults = { lazy = true }, + performance = { + rtp = { + -- customize default disabled vim plugins + disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" }, + }, + }, + }, + + options = { + opt = { + relativenumber = false, + }, + }, + + -- This function is run last and is a good place to configuring + -- augroups/autocommands and custom filetypes also this just pure lua so + -- anything that doesn't fit in the normal config locations above can go here + polish = function() + -- Set up custom filetypes + -- vim.filetype.add { + -- extension = { + -- foo = "fooscript", + -- }, + -- filename = { + -- ["Foofile"] = "fooscript", + -- }, + -- pattern = { + -- ["~/%.config/foo/.*"] = "fooscript", + -- }, + -- } + end, +} diff --git a/programs/neovim/user/mappings.lua b/programs/neovim/user/mappings.lua new file mode 100644 index 0000000..8ac5c8f --- /dev/null +++ b/programs/neovim/user/mappings.lua @@ -0,0 +1,40 @@ +-- Mapping data with "desc" stored directly by vim.keymap.set(). +-- +-- Please use this mappings table to set keyboard mapping since this is the +-- lower level configuration and more robust one. (which-key will +-- automatically pick-up stored data by this setting.) +return { + -- first key is the mode + n = { + -- second key is the lefthand side of the map + + -- navigate buffer tabs with `H` and `L` + -- L = { + -- function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, + -- desc = "Next buffer", + -- }, + -- H = { + -- function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, + -- desc = "Previous buffer", + -- }, + + -- mappings seen under group name "Buffer" + ["bD"] = { + function() + require("astronvim.utils.status").heirline.buffer_picker( + function(bufnr) require("astronvim.utils.buffer").close(bufnr) end + ) + end, + desc = "Pick to close", + }, + -- tables with the `name` key will be registered with which-key if it's installed + -- this is useful for naming menus + ["b"] = { name = "Buffers" }, + -- quick save + -- [""] = { ":w!", desc = "Save File" }, -- change description but the same command + }, + t = { + -- setting a mapping to false will disable it + -- [""] = false, + }, +} diff --git a/programs/neovim/user/options.lua b/programs/neovim/user/options.lua new file mode 100644 index 0000000..74ed9ad --- /dev/null +++ b/programs/neovim/user/options.lua @@ -0,0 +1,30 @@ +-- set vim options here (vim.. = value) +return { + opt = { + -- set to true or false etc. + relativenumber = true, -- sets vim.opt.relativenumber + number = true, -- sets vim.opt.number + spell = false, -- sets vim.opt.spell + signcolumn = "auto", -- sets vim.opt.signcolumn to auto + wrap = false, -- sets vim.opt.wrap + }, + g = { + mapleader = " ", -- sets vim.g.mapleader + autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) + cmp_enabled = true, -- enable completion at start + autopairs_enabled = true, -- enable autopairs at start + diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on) + icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) + ui_notifications_enabled = true, -- disable notifications when toggling UI elements + resession_enabled = false, -- enable experimental resession.nvim session management (will be default in AstroNvim v4) + }, +} +-- If you need more control, you can use the function()...end notation +-- return function(local_vim) +-- local_vim.opt.relativenumber = true +-- local_vim.g.mapleader = " " +-- local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list +-- local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list +-- +-- return local_vim +-- end diff --git a/programs/neovim/user/plugins/community.lua b/programs/neovim/user/plugins/community.lua new file mode 100644 index 0000000..96b388b --- /dev/null +++ b/programs/neovim/user/plugins/community.lua @@ -0,0 +1,38 @@ +return { + -- Add the community repository of plugin specifications + "AstroNvim/astrocommunity", + -- example of importing a plugin, comment out to use it or add your own + -- available plugins can be found at https://github.com/AstroNvim/astrocommunity + + { import = "astrocommunity.colorscheme.catppuccin" }, + { + "catppuccin/nvim", + name = "catppuccin", + opts = function(_, config) + config.flavour = "frappe" + config.transparent_background = true + end, + }, + + { import = "astrocommunity.editing-support.todo-comments-nvim" }, + + { import = "astrocommunity.motion.flash-nvim" }, + { import = "astrocommunity.motion.flit-nvim" }, + { import = "astrocommunity.motion.leap-nvim" }, + { import = "astrocommunity.motion.mini-ai" }, + { import = "astrocommunity.motion.mini-surround" }, + + { import = "astrocommunity.pack.cmake" }, + { import = "astrocommunity.pack.cpp" }, + { import = "astrocommunity.pack.godot" }, + { import = "astrocommunity.pack.html-css" }, + { import = "astrocommunity.pack.json" }, + { import = "astrocommunity.pack.lua" }, + { import = "astrocommunity.pack.markdown" }, + { import = "astrocommunity.pack.nix" }, + { import = "astrocommunity.pack.rust" }, + { import = "astrocommunity.pack.toml" }, + { import = "astrocommunity.pack.typescript-all-in-one" }, + { import = "astrocommunity.pack.vue" }, + { import = "astrocommunity.pack.yaml" }, +} diff --git a/programs/neovim/user/plugins/core.lua b/programs/neovim/user/plugins/core.lua new file mode 100644 index 0000000..b32ff09 --- /dev/null +++ b/programs/neovim/user/plugins/core.lua @@ -0,0 +1,74 @@ +return { + -- customize alpha options + { + "goolord/alpha-nvim", + opts = function(_, opts) + -- customize the dashboard header + opts.section.header.val = { + "⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + "⠀⠀⠀⠀⣰⠿⡇⢸⡟⡇⠀⠘⡷⠶⢶⣆⠘⣶⠶⠶⠶⣦⣤⣤⣤⣤⣄⣀⣀⣀⡀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠤⠤⣤⡀⠀⠀", + "⠀⠀⠀⣰⣿⠀⠹⡌⣇⢹⣀⣠⣿⣦⠀⠹⣄⠸⣆⠀⣄⠹⡇⠀⠈⠃⠁⢹⢻⠀⣿⠈⢻⡛⢳⣤⣶⣿⣿⣿⣿⡶⠶⣶⣶⣶⣶⣶⣶⣶⣶⣾⡁⠀⢠⠴⠙⢦⡀", + "⠀⠀⣴⣿⡙⠀⠀⢳⣾⣿⣿⣿⣿⣿⣷⣦⣼⣿⣿⣷⡘⣆⠁⠀⠀⠀⢠⣼⣿⣴⠇⠀⠀⠙⢿⣿⣿⠟⢹⠃⠀⠀⣀⠀⠉⠈⢷⠈⢻⣿⠁⡿⢿⣄⡘⣄⠀⠀⠁", + "⠀⢸⠻⣿⠉⠓⣶⣶⣿⣿⣿⡿⠿⠿⢿⠿⣿⡉⠻⠇⠙⢿⣷⣀⠀⠀⢼⡙⠿⠃⠀⠀⠀⠀⠈⠿⠋⠀⢸⠄⠀⠀⠛⠃⠀⠀⢸⠀⠀⣿⢀⠇⢸⡿⠛⠛⢷⡶⠂", + "⠀⣸⡄⠙⣆⠀⣿⡿⠹⣏⡤⢤⣸⣿⠼⠀⠘⠇⠆⠀⠀⠀⠉⠉⢳⠦⣼⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢳⡀⠀⠀⠀⠀⢀⡞⠀⣰⣿⣾⣀⣾⡅⠀⡞⠉⠙⢆", + "⢀⡿⢿⢦⠹⣿⣿⡇⠀⢉⠀⠈⠁⠀⠀⠀⢠⢃⡗⠀⠀⠀⠀⠀⢻⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠲⢤⣙⣲⣤⣤⣶⣫⠤⠖⠹⠋⠉⠉⠉⠻⣶⣽⣦⣀⡼", + "⠼⣧⣬⣿⡿⣭⠈⠿⣤⡬⠷⠴⠒⠒⠒⠲⠿⠛⠀⠂⠀⠂⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠛⠛⠉⠉⠉⠁⠀", + "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠴⠶⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", + } + end, + }, + -- You can disable default plugins as follows: + -- { "max397574/better-escape.nvim", enabled = false }, + -- + -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call + -- { + -- "L3MON4D3/LuaSnip", + -- config = function(plugin, opts) + -- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom luasnip configuration such as filetype extend or custom snippets + -- local luasnip = require "luasnip" + -- luasnip.filetype_extend("javascript", { "javascriptreact" }) + -- end, + -- }, + -- { + -- "windwp/nvim-autopairs", + -- config = function(plugin, opts) + -- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom autopairs configuration such as custom rules + -- local npairs = require "nvim-autopairs" + -- local Rule = require "nvim-autopairs.rule" + -- local cond = require "nvim-autopairs.conds" + -- npairs.add_rules( + -- { + -- Rule("$", "$", { "tex", "latex" }) + -- -- don't add a pair if the next character is % + -- :with_pair(cond.not_after_regex "%%") + -- -- don't add a pair if the previous character is xxx + -- :with_pair( + -- cond.not_before_regex("xxx", 3) + -- ) + -- -- don't move right when repeat character + -- :with_move(cond.none()) + -- -- don't delete if the next character is xx + -- :with_del(cond.not_after_regex "xx") + -- -- disable adding a newline when you press + -- :with_cr(cond.none()), + -- }, + -- -- disable for .vim files, but it work for another filetypes + -- Rule("a", "a", "-vim") + -- ) + -- end, + -- }, + -- By adding to the which-key config and using our helper function you can add more which-key registered bindings + -- { + -- "folke/which-key.nvim", + -- config = function(plugin, opts) + -- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- Add bindings which show up as group name + -- local wk = require "which-key" + -- wk.register({ + -- b = { name = "Buffer" }, + -- }, { mode = "n", prefix = "" }) + -- end, + -- }, +} diff --git a/programs/neovim/user/plugins/dap.lua b/programs/neovim/user/plugins/dap.lua new file mode 100644 index 0000000..9c1c3c3 --- /dev/null +++ b/programs/neovim/user/plugins/dap.lua @@ -0,0 +1,28 @@ +return { + "mfussenegger/nvim-dap", + opts = function(_, config) + local dap = require("dap") + + dap.adapters.codelldb = { + type = "server", + port = "${port}", + executable = { + command = "codelldb", + args = { "--port", "${port}" }, + } + } + + dap.configurations.rust = { + { + name = "Launch file", + type = "codelldb", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + } + } + end, +} diff --git a/programs/neovim/user/plugins/mason.lua b/programs/neovim/user/plugins/mason.lua new file mode 100644 index 0000000..faa9a79 --- /dev/null +++ b/programs/neovim/user/plugins/mason.lua @@ -0,0 +1,29 @@ +-- customize mason plugins +return { + -- use mason-lspconfig to configure LSP installations + { + "williamboman/mason-lspconfig.nvim", + -- overrides `require("mason-lspconfig").setup(...)` + opts = function(_, opts) + opts.ensure_installed = nil + opts.automatic_installation = false + end, + }, + -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources + { + "jay-babu/mason-null-ls.nvim", + -- overrides `require("mason-null-ls").setup(...)` + opts = function(_, opts) + opts.ensure_installed = nil + opts.automatic_installation = false + end, + }, + { + "jay-babu/mason-nvim-dap.nvim", + -- overrides `require("mason-nvim-dap").setup(...)` + opts = function(_, opts) + opts.ensure_installed = nil + opts.automatic_installation = false + end, + }, +} diff --git a/programs/neovim/user/plugins/null-ls.lua b/programs/neovim/user/plugins/null-ls.lua new file mode 100644 index 0000000..0631e7d --- /dev/null +++ b/programs/neovim/user/plugins/null-ls.lua @@ -0,0 +1,20 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + opts = function(_, config) + -- config variable is the default configuration table for the setup function call + local null_ls = require "null-ls" + + -- Check supported formatters and linters + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics + config.sources = { + -- Set a formatter + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.nixpkgs_fmt, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.rustfmt, + null_ls.builtins.formatting.stylua, + } + end, +} diff --git a/programs/neovim/user/plugins/treesitter.lua b/programs/neovim/user/plugins/treesitter.lua new file mode 100644 index 0000000..c717d37 --- /dev/null +++ b/programs/neovim/user/plugins/treesitter.lua @@ -0,0 +1,8 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = nil + opts.automatic_installation = false + end, +} diff --git a/programs/neovim/user/plugins/user.lua b/programs/neovim/user/plugins/user.lua new file mode 100644 index 0000000..22e89de --- /dev/null +++ b/programs/neovim/user/plugins/user.lua @@ -0,0 +1,13 @@ +return { + -- You can also add new plugins here as well: + -- Add plugins, the lazy syntax + -- "andweeb/presence.nvim", + -- { + -- "ray-x/lsp_signature.nvim", + -- event = "BufRead", + -- config = function() + -- require("lsp_signature").setup() + -- end, + -- }, + { "folke/flash.nvim", vscode = false }, +}