This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

init with tools.*vim

author
lassulus
date (Aug 31, 2023, 9:20 PM CEST) commit 7505d051
+954
+314
flake.lock
··· 1 + { 2 + "nodes": { 3 + "astro-nvim": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1693178813, 7 + "narHash": "sha256-XbvqX7xEdgfS8/fNvkwB4x7SW4S/Myh3MJS8TH70Xs0=", 8 + "owner": "AstroNvim", 9 + "repo": "AstroNvim", 10 + "rev": "9ea4eaa1e6cdd4e0618a9d30751eed94319c986a", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "AstroNvim", 15 + "repo": "AstroNvim", 16 + "type": "github" 17 + } 18 + }, 19 + "beautysh": { 20 + "inputs": { 21 + "nixpkgs": [ 22 + "nixvim", 23 + "nixpkgs" 24 + ], 25 + "poetry2nix": "poetry2nix", 26 + "utils": "utils" 27 + }, 28 + "locked": { 29 + "lastModified": 1680308980, 30 + "narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=", 31 + "owner": "lovesegfault", 32 + "repo": "beautysh", 33 + "rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c", 34 + "type": "github" 35 + }, 36 + "original": { 37 + "owner": "lovesegfault", 38 + "repo": "beautysh", 39 + "type": "github" 40 + } 41 + }, 42 + "flake-compat": { 43 + "flake": false, 44 + "locked": { 45 + "lastModified": 1673956053, 46 + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", 47 + "owner": "edolstra", 48 + "repo": "flake-compat", 49 + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", 50 + "type": "github" 51 + }, 52 + "original": { 53 + "owner": "edolstra", 54 + "repo": "flake-compat", 55 + "type": "github" 56 + } 57 + }, 58 + "flake-parts": { 59 + "inputs": { 60 + "nixpkgs-lib": "nixpkgs-lib" 61 + }, 62 + "locked": { 63 + "lastModified": 1690933134, 64 + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", 65 + "owner": "hercules-ci", 66 + "repo": "flake-parts", 67 + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", 68 + "type": "github" 69 + }, 70 + "original": { 71 + "id": "flake-parts", 72 + "type": "indirect" 73 + } 74 + }, 75 + "flake-utils": { 76 + "inputs": { 77 + "systems": "systems" 78 + }, 79 + "locked": { 80 + "lastModified": 1692799911, 81 + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", 82 + "owner": "numtide", 83 + "repo": "flake-utils", 84 + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", 85 + "type": "github" 86 + }, 87 + "original": { 88 + "owner": "numtide", 89 + "repo": "flake-utils", 90 + "type": "github" 91 + } 92 + }, 93 + "flake-utils_2": { 94 + "inputs": { 95 + "systems": "systems_2" 96 + }, 97 + "locked": { 98 + "lastModified": 1685518550, 99 + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", 100 + "owner": "numtide", 101 + "repo": "flake-utils", 102 + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", 103 + "type": "github" 104 + }, 105 + "original": { 106 + "owner": "numtide", 107 + "repo": "flake-utils", 108 + "type": "github" 109 + } 110 + }, 111 + "gitignore": { 112 + "inputs": { 113 + "nixpkgs": [ 114 + "nixvim", 115 + "pre-commit-hooks", 116 + "nixpkgs" 117 + ] 118 + }, 119 + "locked": { 120 + "lastModified": 1660459072, 121 + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", 122 + "owner": "hercules-ci", 123 + "repo": "gitignore.nix", 124 + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", 125 + "type": "github" 126 + }, 127 + "original": { 128 + "owner": "hercules-ci", 129 + "repo": "gitignore.nix", 130 + "type": "github" 131 + } 132 + }, 133 + "nixpkgs": { 134 + "locked": { 135 + "lastModified": 1693377291, 136 + "narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=", 137 + "owner": "NixOS", 138 + "repo": "nixpkgs", 139 + "rev": "e7f38be3775bab9659575f192ece011c033655f0", 140 + "type": "github" 141 + }, 142 + "original": { 143 + "owner": "NixOS", 144 + "ref": "nixos-unstable", 145 + "repo": "nixpkgs", 146 + "type": "github" 147 + } 148 + }, 149 + "nixpkgs-lib": { 150 + "locked": { 151 + "dir": "lib", 152 + "lastModified": 1690881714, 153 + "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", 154 + "owner": "NixOS", 155 + "repo": "nixpkgs", 156 + "rev": "9e1960bc196baf6881340d53dccb203a951745a2", 157 + "type": "github" 158 + }, 159 + "original": { 160 + "dir": "lib", 161 + "owner": "NixOS", 162 + "ref": "nixos-unstable", 163 + "repo": "nixpkgs", 164 + "type": "github" 165 + } 166 + }, 167 + "nixpkgs-stable": { 168 + "locked": { 169 + "lastModified": 1685801374, 170 + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", 171 + "owner": "NixOS", 172 + "repo": "nixpkgs", 173 + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", 174 + "type": "github" 175 + }, 176 + "original": { 177 + "owner": "NixOS", 178 + "ref": "nixos-23.05", 179 + "repo": "nixpkgs", 180 + "type": "github" 181 + } 182 + }, 183 + "nixvim": { 184 + "inputs": { 185 + "beautysh": "beautysh", 186 + "flake-utils": "flake-utils", 187 + "nixpkgs": [ 188 + "nixpkgs" 189 + ], 190 + "pre-commit-hooks": "pre-commit-hooks" 191 + }, 192 + "locked": { 193 + "lastModified": 1693402604, 194 + "narHash": "sha256-pnmgGOZqWw4rQnF5Cq8P4xeTkQlj/qbzDjiJgCsVSS4=", 195 + "owner": "nix-community", 196 + "repo": "nixvim", 197 + "rev": "26b202828f5227b1d06f6cc7ba723011679ff69e", 198 + "type": "github" 199 + }, 200 + "original": { 201 + "owner": "nix-community", 202 + "repo": "nixvim", 203 + "type": "github" 204 + } 205 + }, 206 + "poetry2nix": { 207 + "inputs": { 208 + "flake-utils": [ 209 + "nixvim", 210 + "beautysh", 211 + "utils" 212 + ], 213 + "nixpkgs": [ 214 + "nixvim", 215 + "beautysh", 216 + "nixpkgs" 217 + ] 218 + }, 219 + "locked": { 220 + "lastModified": 1658665240, 221 + "narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=", 222 + "owner": "nix-community", 223 + "repo": "poetry2nix", 224 + "rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f", 225 + "type": "github" 226 + }, 227 + "original": { 228 + "owner": "nix-community", 229 + "repo": "poetry2nix", 230 + "type": "github" 231 + } 232 + }, 233 + "pre-commit-hooks": { 234 + "inputs": { 235 + "flake-compat": "flake-compat", 236 + "flake-utils": "flake-utils_2", 237 + "gitignore": "gitignore", 238 + "nixpkgs": [ 239 + "nixvim", 240 + "nixpkgs" 241 + ], 242 + "nixpkgs-stable": "nixpkgs-stable" 243 + }, 244 + "locked": { 245 + "lastModified": 1692274144, 246 + "narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=", 247 + "owner": "cachix", 248 + "repo": "pre-commit-hooks.nix", 249 + "rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa", 250 + "type": "github" 251 + }, 252 + "original": { 253 + "owner": "cachix", 254 + "repo": "pre-commit-hooks.nix", 255 + "type": "github" 256 + } 257 + }, 258 + "root": { 259 + "inputs": { 260 + "astro-nvim": "astro-nvim", 261 + "flake-parts": "flake-parts", 262 + "nixpkgs": "nixpkgs", 263 + "nixvim": "nixvim" 264 + } 265 + }, 266 + "systems": { 267 + "locked": { 268 + "lastModified": 1681028828, 269 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 270 + "owner": "nix-systems", 271 + "repo": "default", 272 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 273 + "type": "github" 274 + }, 275 + "original": { 276 + "owner": "nix-systems", 277 + "repo": "default", 278 + "type": "github" 279 + } 280 + }, 281 + "systems_2": { 282 + "locked": { 283 + "lastModified": 1681028828, 284 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 285 + "owner": "nix-systems", 286 + "repo": "default", 287 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 288 + "type": "github" 289 + }, 290 + "original": { 291 + "owner": "nix-systems", 292 + "repo": "default", 293 + "type": "github" 294 + } 295 + }, 296 + "utils": { 297 + "locked": { 298 + "lastModified": 1678901627, 299 + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", 300 + "owner": "numtide", 301 + "repo": "flake-utils", 302 + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", 303 + "type": "github" 304 + }, 305 + "original": { 306 + "owner": "numtide", 307 + "repo": "flake-utils", 308 + "type": "github" 309 + } 310 + } 311 + }, 312 + "root": "root", 313 + "version": 7 314 + }
+41
flake.nix
··· 1 + { 2 + description = "lassulus superconfig"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 + 7 + nixvim.url = "github:nix-community/nixvim"; 8 + nixvim.inputs.nixpkgs.follows = "nixpkgs"; 9 + 10 + astro-nvim.url = "github:AstroNvim/AstroNvim"; 11 + astro-nvim.flake = false; 12 + }; 13 + 14 + outputs = inputs@{ flake-parts, ... }: 15 + flake-parts.lib.mkFlake { inherit inputs; } { 16 + imports = [ 17 + # To import a flake module 18 + # 1. Add foo to inputs 19 + # 2. Add foo as a parameter to the outputs function 20 + # 3. Add here: foo.flakeModule 21 + ./tools/nvim.nix 22 + ./tools/astronvim/flake-module.nix 23 + 24 + ]; 25 + systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; 26 + perSystem = { config, self', inputs', pkgs, system, ... }: { 27 + # Per-system attributes can be defined here. The self' and inputs' 28 + # module parameters provide easy access to attributes of the same 29 + # system. 30 + 31 + # Equivalent to inputs'.nixpkgs.legacyPackages.hello; 32 + packages.default = pkgs.hello; 33 + }; 34 + flake = { 35 + # The usual flake attributes can be defined here, including system- 36 + # agnostic ones like nixosModule and system-enumerating ones, although 37 + # those are more easily expressed in perSystem. 38 + 39 + }; 40 + }; 41 + }
+25
tools/nvim.nix
··· 1 + { inputs, ... }: 2 + { 3 + perSystem = { system, ... }: { 4 + packages.nvim = inputs.nixvim.legacyPackages.${system}.makeNixvim { 5 + colorschemes.gruvbox.enable = true; 6 + options = { 7 + mouse = "a"; 8 + pastetoggle = "<INS>"; 9 + undofile = {}; 10 + undolevels = 10000; 11 + undoreload = 10000; 12 + }; 13 + extraConfigVim = '' 14 + set list listchars=tab:⇥\ ,extends:❯,precedes:❮,nbsp:␣,trail:· showbreak=¬ 15 + set et 16 + ''; 17 + maps.normalVisualOp = { 18 + "<C-c>" = ":q<cr>"; 19 + }; 20 + plugins.lsp = { 21 + enable = true; 22 + }; 23 + }; 24 + }; 25 + }
+95
tools/astronvim/flake-module.nix
··· 1 + { inputs , ... }: 2 + { 3 + perSystem = { system, lib, pkgs, ... }: let 4 + langs = [ 5 + # "agda" 6 + "bash" 7 + "c" 8 + "c-sharp" 9 + "cpp" 10 + "css" 11 + "elm" 12 + "elisp" 13 + #"fluent" 14 + "go" 15 + "hcl" 16 + "haskell" 17 + "html" 18 + "janet-simple" 19 + "java" 20 + "javascript" 21 + "jsdoc" 22 + "json" 23 + "julia" 24 + "ocaml" 25 + "pgn" 26 + "php" 27 + "python" 28 + "ruby" 29 + "rust" 30 + "scala" 31 + # "swift" 32 + "typescript" 33 + "yaml" 34 + "nix" 35 + "lua" 36 + "markdown-inline" 37 + "perl" 38 + "make" 39 + "toml" 40 + ]; 41 + nvim_deps = with pkgs; [ 42 + nodejs # copilot 43 + vale 44 + terraform-ls 45 + nodePackages.pyright 46 + sumneko-lua-language-server 47 + 48 + # based on ./suggested-pkgs.json nvim 49 + delve 50 + gopls 51 + golangci-lint 52 + nodePackages.bash-language-server 53 + taplo-lsp 54 + marksman 55 + rust-analyzer 56 + yaml-language-server 57 + nil 58 + gomodifytags 59 + gofumpt 60 + iferr 61 + impl 62 + gotools 63 + shellcheck 64 + shfmt 65 + isort 66 + black 67 + ruff 68 + nixpkgs-fmt 69 + terraform-ls 70 + clang-tools 71 + nodePackages.prettier 72 + stylua 73 + # does not build yet on aarch64 74 + ] ++ lib.optional (pkgs.stdenv.hostPlatform.system == "x86_64-linux") pkgs.deno; # lsp 75 + nvim_config = pkgs.runCommand "nvim_config" { } '' 76 + mkdir -p $out/nvim/parser 77 + 78 + ln -s ${inputs.astro-nvim}/* $out/nvim/ 79 + rm $out/nvim/lua 80 + mkdir -p $out/nvim/lua 81 + ln -s ${inputs.astro-nvim}/lua/* $out/nvim/lua 82 + ln -s ${./user} $out/nvim/lua/user 83 + 84 + ${lib.concatMapStringsSep "\n" (name: '' 85 + ln -s ${pkgs.tree-sitter.builtGrammars."tree-sitter-${name}"}/parser $out/nvim/parser/${name}.so 86 + '') langs} 87 + ''; 88 + in { 89 + packages.asvim = pkgs.writers.writeDashBin "asvim" '' 90 + unset VIMINIT 91 + export PATH=$PATH:${lib.makeBinPath nvim_deps} 92 + XDG_CONFIG_HOME=${nvim_config} ${pkgs.neovim}/bin/nvim "$@" 93 + ''; 94 + }; 95 + }
+7
tools/astronvim/user/.stylua.toml
··· 1 + column_width = 120 2 + line_endings = "Unix" 3 + indent_type = "Spaces" 4 + indent_width = 2 5 + quote_style = "AutoPreferDouble" 6 + call_parentheses = "None" 7 + collapse_simple_statement = "Always"
+129
tools/astronvim/user/init.lua
··· 1 + vim.api.nvim_create_user_command("RaiseTmuxPane", function() 2 + -- run shell command 3 + 4 + local out = vim.fn.system "tmux list-panes -a -F '#I #{pane_tty}'" 5 + local tty = vim.env.TTY 6 + if tty == nil then return end 7 + local _, _, window_id = string.find(out, "(%d+) " .. tty) 8 + if window_id == nil then return end 9 + vim.fn.system("tmux select-window -t '" .. window_id .. "'") 10 + end, {}) 11 + 12 + vim.api.nvim_create_user_command("Nurl", function() 13 + local url = vim.fn.input("Enter a URL: ") 14 + local rev = vim.fn.input("Enter the revision (e.g., v0.2.0 or empty string): ") 15 + 16 + local cmd = string.format('nurl %s %s 2>/dev/null', url, rev) 17 + 18 + local output = vim.fn.systemlist(cmd) 19 + if vim.v.shell_error == 0 and #output > 0 then 20 + vim.api.nvim_put(output, "l", true, true) 21 + else 22 + print("Error executing command or command returned empty result.") 23 + end 24 + end, {}) 25 + 26 + return { 27 + -- Configure AstroNvim updates 28 + updater = { 29 + remote = "origin", -- remote to use 30 + channel = "stable", -- "stable" or "nightly" 31 + version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) 32 + branch = "nightly", -- branch name (NIGHTLY ONLY) 33 + commit = nil, -- commit hash (NIGHTLY ONLY) 34 + pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) 35 + skip_prompts = false, -- skip prompts about breaking changes 36 + show_changelog = true, -- show the changelog after performing an update 37 + auto_quit = false, -- automatically quit the current session after a successful update 38 + remotes = { -- easily add new remotes to track 39 + -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url 40 + -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, 41 + -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork 42 + }, 43 + }, 44 + -- Set colorscheme to use 45 + colorscheme = "gruvbox", 46 + -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on 47 + diagnostics = { 48 + virtual_text = true, 49 + underline = true, 50 + }, 51 + lsp = { 52 + config = { 53 + clangd = { 54 + cmd = { "clangd", "--offset-encoding=utf-16" }, 55 + }, 56 + vale = { 57 + cmd = { "vale", "--lsp" }, 58 + filetypes = { "markdown", "text" }, 59 + }, 60 + }, 61 + -- customize lsp formatting options 62 + formatting = { 63 + -- control auto formatting on save 64 + format_on_save = { 65 + enabled = true, -- enable or disable format on save globally 66 + allow_filetypes = { -- enable format on save for specified filetypes only 67 + "go", 68 + }, 69 + ignore_filetypes = { -- disable format on save for specified filetypes 70 + -- "python", 71 + }, 72 + }, 73 + disabled = { -- disable formatting capabilities for the listed language servers 74 + -- disable lua_ls formatting capability if you want to use StyLua to format your lua code 75 + -- "lua_ls", 76 + }, 77 + timeout_ms = 1000, -- default format timeout 78 + -- filter = function(client) -- fully override the default formatting function 79 + -- return true 80 + -- end 81 + }, 82 + -- enable servers that you already have installed without mason 83 + servers = { 84 + "clangd", 85 + "bashls", 86 + "gopls", 87 + "taplo", 88 + "marksman", 89 + "pyright", 90 + "nil_ls", 91 + "terraformls", 92 + "lua_ls", 93 + "vale", 94 + "rust_analyzer", 95 + "gopls", 96 + "yamlls", 97 + "denols", 98 + }, 99 + }, 100 + -- Configure require("lazy").setup() options 101 + lazy = { 102 + defaults = { lazy = true }, 103 + -- Disable change detection because it caused nvim to constantly need 3-5% CPU, which is bad for battery life 104 + change_detection = { enabled = false, }, 105 + performance = { 106 + rtp = { 107 + -- customize default disabled vim plugins 108 + disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" }, 109 + }, 110 + }, 111 + }, 112 + -- This function is run last and is a good place to configuring 113 + -- augroups/autocommands and custom filetypes also this just pure lua so 114 + -- anything that doesn't fit in the normal config locations above can go here 115 + polish = function() 116 + -- Set up custom filetypes 117 + -- vim.filetype.add { 118 + -- extension = { 119 + -- foo = "fooscript", 120 + -- }, 121 + -- filename = { 122 + -- ["Foofile"] = "fooscript", 123 + -- }, 124 + -- pattern = { 125 + -- ["~/%.config/foo/.*"] = "fooscript", 126 + -- }, 127 + -- } 128 + end, 129 + }
+60
tools/astronvim/user/mappings.lua
··· 1 + function open_or_create_file(tfilename) 2 + -- complete filepath from the file where this is called 3 + local parent = vim.fn.expand('%:p:h') 4 + local newfilepath = parent .. '/' .. vim.fn.expand(tfilename) 5 + 6 + if vim.fn.filereadable(newfilepath) ~= 1 then 7 + -- create parent directory 8 + vim.fn.system('mkdir -p ' .. vim.fn.shellescape(parent)) 9 + vim.fn.system('touch ' .. vim.fn.shellescape(newfilepath)) 10 + end 11 + vim.cmd(':e ' .. newfilepath) 12 + end 13 + 14 + 15 + -- Mapping data with "desc" stored directly by vim.keymap.set(). 16 + -- 17 + -- Please use this mappings table to set keyboard mapping since this is the 18 + -- lower level configuration and more robust one. (which-key will 19 + -- automatically pick-up stored data by this setting.) 20 + return { 21 + -- first key is the mode 22 + n = { 23 + -- second key is the lefthand side of the map 24 + 25 + -- navigate buffer tabs with `H` and `L` 26 + -- L = { 27 + -- function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, 28 + -- desc = "Next buffer", 29 + -- }, 30 + -- H = { 31 + -- function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, 32 + -- desc = "Previous buffer", 33 + -- }, 34 + -- mappings seen under group name "Buffer" 35 + ["<leader>bD"] = { 36 + function() 37 + require("astronvim.utils.status").heirline.buffer_picker(function(bufnr) require("astronvim.utils.buffer").close(bufnr) end) 38 + end, 39 + desc = "Pick to close", 40 + }, 41 + -- tables with the `name` key will be registered with which-key if it's installed 42 + -- this is useful for naming menus 43 + ["<leader>b"] = { name = "Buffers" }, 44 + -- quick save 45 + -- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command 46 + 47 + -- Don't error if file doesn't exist 48 + ["gf"] = { function() open_or_create_file(vim.fn.expand("<cfile>")) end, desc = "Create file" }, 49 + ["<leader>*"] = { function() require("telescope.builtin").grep_string() end, desc = "Find for word under cursor", }, 50 + ["<leader><leader>"] = { function() require("telescope.builtin").find_files() end, desc = "Find files" }, 51 + }, 52 + t = { 53 + -- setting a mapping to false will disable it 54 + -- ["<esc>"] = false, 55 + }, 56 + c = { 57 + -- setting a mapping to false will disable it 58 + ["w!!"] = { "w !sudo tee > /dev/null %", desc = "Write as sudo" }, 59 + } 60 + }
+30
tools/astronvim/user/options.lua
··· 1 + -- set vim options here (vim.<first_key>.<second_key> = value) 2 + return { 3 + opt = { 4 + -- set to true or false etc. 5 + relativenumber = true, -- sets vim.opt.relativenumber 6 + number = true, -- sets vim.opt.number 7 + spell = false, -- sets vim.opt.spell 8 + signcolumn = "auto", -- sets vim.opt.signcolumn to auto 9 + wrap = false, -- sets vim.opt.wrap 10 + }, 11 + g = { 12 + mapleader = " ", -- sets vim.g.mapleader 13 + autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) 14 + cmp_enabled = true, -- enable completion at start 15 + autopairs_enabled = true, -- enable autopairs at start 16 + 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) 17 + icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) 18 + ui_notifications_enabled = true, -- disable notifications when toggling UI elements 19 + resession_enabled = false, -- enable experimental resession.nvim session management (will be default in AstroNvim v4) 20 + }, 21 + } 22 + -- If you need more control, you can use the function()...end notation 23 + -- return function(local_vim) 24 + -- local_vim.opt.relativenumber = true 25 + -- local_vim.g.mapleader = " " 26 + -- local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list 27 + -- local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list 28 + -- 29 + -- return local_vim 30 + -- end
+36
tools/astronvim/user/.github/README.md
··· 1 + # AstroNvim User Configuration Example 2 + 3 + A user configuration template for [AstroNvim](https://github.com/AstroNvim/AstroNvim) 4 + 5 + ## 🛠️ Installation 6 + 7 + #### Make a backup of your current nvim and shared folder 8 + 9 + ```shell 10 + mv ~/.config/nvim ~/.config/nvim.bak 11 + mv ~/.local/share/nvim ~/.local/share/nvim.bak 12 + ``` 13 + 14 + #### Clone AstroNvim 15 + 16 + ```shell 17 + git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim 18 + ``` 19 + 20 + #### Create a new user repository from this template 21 + 22 + Press the "Use this template" button above to create a new repository to store your user configuration. 23 + 24 + You can also just clone this repository directly if you do not want to track your user configuration in GitHub. 25 + 26 + #### Clone the repository 27 + 28 + ```shell 29 + git clone https://github.com/<your_user>/<your_repository> ~/.config/nvim/lua/user 30 + ``` 31 + 32 + #### Start Neovim 33 + 34 + ```shell 35 + nvim 36 + ```
+3
tools/astronvim/user/highlights/init.lua
··· 1 + return { -- this table overrides highlights in all themes 2 + -- Normal = { bg = "#000000" }, 3 + }
+29
tools/astronvim/user/plugins/community.lua
··· 1 + return { 2 + -- Add the community repository of plugin specifications 3 + "AstroNvim/astrocommunity", 4 + -- example of imporing a plugin, comment out to use it or add your own 5 + -- available plugins can be found at https://github.com/AstroNvim/astrocommunity 6 + { import = "astrocommunity.colorscheme.gruvbox-nvim" }, 7 + { import = "astrocommunity.completion.copilot-lua" }, 8 + { import = "astrocommunity.completion.copilot-lua-cmp" }, 9 + { import = "astrocommunity.project.project-nvim" }, 10 + { import = "astrocommunity.pack.go" }, 11 + { import = "astrocommunity.pack.bash" }, 12 + { import = "astrocommunity.pack.python" }, 13 + { import = "astrocommunity.pack.lua" }, 14 + { import = "astrocommunity.pack.toml" }, 15 + { import = "astrocommunity.pack.markdown" }, 16 + { import = "astrocommunity.pack.rust" }, 17 + { import = "astrocommunity.pack.yaml" }, 18 + { import = "astrocommunity.pack.nix" }, 19 + { import = "astrocommunity.terminal-integration.vim-tpipeline" }, 20 + { import = "astrocommunity.editing-support.rainbow-delimiters-nvim" }, 21 + { import = "astrocommunity.editing-support.auto-save-nvim" }, 22 + { import = "astrocommunity.editing-support.chatgpt-nvim" }, 23 + { 24 + "jackMort/ChatGPT.nvim", 25 + opts = { 26 + api_key_cmd = "rbw get openai-api-key", 27 + }, 28 + }, 29 + }
+93
tools/astronvim/user/plugins/core.lua
··· 1 + return { 2 + -- customize alpha options 3 + { 4 + "goolord/alpha-nvim", 5 + opts = function(_, opts) 6 + -- customize the dashboard header 7 + opts.section.header.val = { 8 + " █████ ███████ ████████ ██████ ██████", 9 + "██ ██ ██ ██ ██ ██ ██ ██", 10 + "███████ ███████ ██ ██████ ██ ██", 11 + "██ ██ ██ ██ ██ ██ ██ ██", 12 + "██ ██ ███████ ██ ██ ██ ██████", 13 + " ", 14 + " ███  ██ ██  ██ ██ ███  ███", 15 + " ████  ██ ██  ██ ██ ████  ████", 16 + " ██ ██  ██ ██  ██ ██ ██ ████ ██", 17 + " ██  ██ ██  ██  ██  ██ ██  ██  ██", 18 + " ██   ████   ████   ██ ██      ██", 19 + } 20 + return opts 21 + end, 22 + }, 23 + { 24 + "gitsigns.nvim", 25 + opts = function(_, opts) 26 + opts.current_line_blame = true 27 + return opts 28 + end, 29 + }, 30 + { 31 + "nvim-neo-tree/neo-tree.nvim", 32 + opts = { 33 + follow_current_file = true, 34 + }, 35 + }, 36 + -- override make command build since we provide the shared library with home-manager already 37 + { "nvim-telescope/telescope-fzf-native.nvim", build = "true", }, 38 + 39 + -- You can disable default plugins as follows: 40 + -- { "max397574/better-escape.nvim", enabled = false }, 41 + -- 42 + -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call 43 + -- { 44 + -- "L3MON4D3/LuaSnip", 45 + -- config = function(plugin, opts) 46 + -- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call 47 + -- -- add more custom luasnip configuration such as filetype extend or custom snippets 48 + -- local luasnip = require "luasnip" 49 + -- luasnip.filetype_extend("javascript", { "javascriptreact" }) 50 + -- end, 51 + -- }, 52 + -- { 53 + -- "windwp/nvim-autopairs", 54 + -- config = function(plugin, opts) 55 + -- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call 56 + -- -- add more custom autopairs configuration such as custom rules 57 + -- local npairs = require "nvim-autopairs" 58 + -- local Rule = require "nvim-autopairs.rule" 59 + -- local cond = require "nvim-autopairs.conds" 60 + -- npairs.add_rules( 61 + -- { 62 + -- Rule("$", "$", { "tex", "latex" }) 63 + -- -- don't add a pair if the next character is % 64 + -- :with_pair(cond.not_after_regex "%%") 65 + -- -- don't add a pair if the previous character is xxx 66 + -- :with_pair( 67 + -- cond.not_before_regex("xxx", 3) 68 + -- ) 69 + -- -- don't move right when repeat character 70 + -- :with_move(cond.none()) 71 + -- -- don't delete if the next character is xx 72 + -- :with_del(cond.not_after_regex "xx") 73 + -- -- disable adding a newline when you press <cr> 74 + -- :with_cr(cond.none()), 75 + -- }, 76 + -- -- disable for .vim files, but it work for another filetypes 77 + -- Rule("a", "a", "-vim") 78 + -- ) 79 + -- end, 80 + -- }, 81 + -- By adding to the which-key config and using our helper function you can add more which-key registered bindings 82 + -- { 83 + -- "folke/which-key.nvim", 84 + -- config = function(plugin, opts) 85 + -- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call 86 + -- -- Add bindings which show up as group name 87 + -- local wk = require "which-key" 88 + -- wk.register({ 89 + -- b = { name = "Buffer" }, 90 + -- }, { mode = "n", prefix = "<leader>" }) 91 + -- end, 92 + -- }, 93 + }
+33
tools/astronvim/user/plugins/mason.lua
··· 1 + -- customize mason plugins 2 + local suggested_packages = {} 3 + local utils = require "astronvim.utils" 4 + 5 + local disable_auto_install = function(_, opts) 6 + local data_dir = vim.fn.stdpath("data") 7 + utils.list_insert_unique(suggested_packages, opts.ensure_installed or {}) 8 + local f = io.open(data_dir .. "/suggested-pkgs.json", "w") 9 + f:write(vim.fn.json_encode(suggested_packages)) 10 + f:close() 11 + 12 + opts.ensure_installed = {} 13 + end 14 + 15 + return { 16 + -- use mason-lspconfig to configure LSP installations 17 + { 18 + "williamboman/mason-lspconfig.nvim", 19 + -- overrides `require("mason-lspconfig").setup(...)` 20 + opts = disable_auto_install, 21 + }, 22 + -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources 23 + { 24 + "jay-babu/mason-null-ls.nvim", 25 + -- overrides `require("mason-null-ls").setup(...)` 26 + opts = disable_auto_install, 27 + }, 28 + { 29 + "jay-babu/mason-nvim-dap.nvim", 30 + -- overrides `require("mason-nvim-dap").setup(...)` 31 + opts = disable_auto_install, 32 + }, 33 + }
+44
tools/astronvim/user/plugins/null-ls.lua
··· 1 + return { 2 + "jose-elias-alvarez/null-ls.nvim", 3 + opts = function(_, config) 4 + -- config variable is the default configuration table for the setup function call 5 + local null_ls = require "null-ls" 6 + 7 + -- Check supported formatters and linters 8 + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting 9 + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics 10 + config.sources = { 11 + -- Set a formatter 12 + null_ls.builtins.formatting.stylua, 13 + 14 + -- html/css/js/ts/json/yaml/xml/markdown 15 + null_ls.builtins.formatting.prettier, 16 + 17 + -- go 18 + null_ls.builtins.formatting.gofumpt, 19 + null_ls.builtins.formatting.goimports, 20 + null_ls.builtins.diagnostics.golangci_lint, 21 + null_ls.builtins.code_actions.impl, 22 + 23 + -- nix 24 + null_ls.builtins.formatting.nixpkgs_fmt, 25 + 26 + -- python 27 + null_ls.builtins.formatting.black, 28 + null_ls.builtins.formatting.isort, 29 + null_ls.builtins.formatting.ruff, 30 + 31 + -- c/c++ 32 + null_ls.builtins.formatting.clang_format, 33 + 34 + -- rust 35 + null_ls.builtins.formatting.rustfmt, 36 + 37 + -- bash 38 + null_ls.builtins.formatting.shfmt.with { 39 + args = { "-i", "2" }, 40 + }, 41 + } 42 + return config -- return final config table 43 + end, 44 + }
+9
tools/astronvim/user/plugins/treesitter.lua
··· 1 + return { 2 + "nvim-treesitter/nvim-treesitter", 3 + config = function() 4 + end, 5 + opts = { 6 + -- enable terraform using hcl 7 + -- ensure_installed = { "lua" }, 8 + }, 9 + }
+6
tools/astronvim/user/plugins/user.lua
··· 1 + return { 2 + { 3 + "lewis6991/spaceless.nvim", 4 + config = function() require("spaceless").setup() end, 5 + }, 6 + }