├── .github ├── FUNDING.yml ├── readme.md └── workflows │ └── nix-check.yml ├── .luarc.json ├── LICENSE ├── flake.lock ├── flake.nix ├── init.lua ├── lazy-lock.json └── lua ├── lazy_spec.lua ├── lsp.lua ├── mappings.lua ├── mini_nvim.lua ├── modules.lua ├── opts.lua └── plugins ├── blink.lua ├── cpt.lua ├── lazydev.lua ├── mini.lua ├── misc.lua └── snacks.lua /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: pwnwriter 2 | -------------------------------------------------------------------------------- /.github/readme.md: -------------------------------------------------------------------------------- 1 | Screenshot 2025-12-14 at 12 56 59 PM 2 | 3 | 4 | Screenshot 2025-12-14 at 12 57 41 PM 5 | 6 | 7 | ---- 8 | 9 | ```bash 10 | git clone https://github.com/pwnwriter/pwnvim ~/.config/nvim 11 | nvim --headless +"Lazy! sync" +qa 12 | ``` 13 | --- 14 | ```bash 15 | nix develop github:pwnwriter/pwnvim 16 | ``` 17 | 18 | ## 🍦 Tips 19 | 20 | 21 | > [!IMPORTANT] 22 | > ***This config requires latest [Neovim][Neovim] build !*** 23 | 24 | - You can Set `NVIM_DEV` environment variable to modify where [**`lazy.nvim`**][Lazy.nvim] 25 | should look for `dev = true` plugins. 26 | 27 | - To install [**`treesitter`**][Treesitter] of `x` language Run `:TSInstall [x]` ! 28 | - On [`NIX`][Nix] , run `nix develop` to enter a shell with `pwnvim` . 29 | - Install `lsp servers` and configure inside [**`lsp.lua`**][LSP]. 30 | - See **`:h vim.lsp.config`** to get an understanding of how 31 | you would setup a language server protocol. 32 | ```lua 33 | -- plugins/lsp.lua 34 | vim.lsp.config.lua_ls = { 35 | cmd = { "lua-language-server" }, 36 | filetypes = { "lua" }, 37 | root_markers = { ".luarc.json", ".git", vim.uv.cwd() }, 38 | settings = { 39 | Lua = { 40 | telemetry = { 41 | enable = false, 42 | }, 43 | }, 44 | }, 45 | } 46 | ``` 47 | 48 |

49 |

Copyright © 2022 - present pwnwriter me 🍃 50 | 51 | [Neovim]: https://github.com/neovim/neovim 52 | [Lazy.nvim]: https://github.com/folke/lazy.nvim 53 | [Lspconfig]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md 54 | [Treesitter]: https://github.com/nvim-treesitter/nvim-treesitter 55 | [Mason]: https://github.com/williamboman/mason.nvim 56 | [LSP]: /lua/plugins/lsp.lua 57 | [Nix]: https://github.com/NixOS/nix 58 | -------------------------------------------------------------------------------- /.github/workflows/nix-check.yml: -------------------------------------------------------------------------------- 1 | name: Test pwnvim configuration 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v3 15 | 16 | - name: Install Nix package manager 17 | uses: DeterminateSystems/nix-installer-action@main 18 | 19 | - name: Setup Nix cache 20 | uses: DeterminateSystems/magic-nix-cache-action@main 21 | 22 | - name: Install neovim config 23 | run: | 24 | nix develop --command nvim +q 25 | 26 | # - name: Show startuptime time 27 | # run: | 28 | # nix develop --command nvim --startuptime tmp.txt 29 | # tail -n 1 tmp.txt 30 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.globals": [ 3 | "vim", 4 | "w" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 PwnWriter < pwnwriter.xyz > 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1746397377, 6 | "narHash": "sha256-5oLdRa3vWSRbuqPIFFmQBGGUqaYZBxX+GGtN9f/n4lU=", 7 | "owner": "nixos", 8 | "repo": "nixpkgs", 9 | "rev": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "nixos", 14 | "ref": "nixpkgs-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = ""; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 6 | }; 7 | 8 | outputs = 9 | { self, nixpkgs, ... }: 10 | let 11 | systems = [ 12 | "x86_64-linux" 13 | "aarch64-linux" 14 | "x86_64-darwin" 15 | "aarch64-darwin" 16 | ]; 17 | forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (import nixpkgs { inherit system; })); 18 | in 19 | { 20 | apps = forAllSystems ( 21 | pkgs: 22 | let 23 | runtimeDeps = with pkgs; [ 24 | gcc 25 | nixd 26 | lua-language-server 27 | ripgrep 28 | fd 29 | ]; 30 | 31 | nvim = pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped ( 32 | pkgs.neovimUtils.makeNeovimConfig { 33 | 34 | customRC = '' 35 | set runtimepath^=${./.} 36 | source ${./.}/init.lua 37 | ''; 38 | } 39 | // { 40 | wrapperArgs = [ 41 | "--prefix" 42 | "PATH" 43 | ":" 44 | "${pkgs.lib.makeBinPath runtimeDeps}" 45 | ]; 46 | } 47 | ); 48 | in 49 | { 50 | default = { 51 | type = "app"; 52 | program = "${nvim}/bin/nvim"; 53 | }; 54 | } 55 | ); 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- ┏┓ ┓┏• 2 | -- ┃┃┓┏┏┏┓┃┃┓┏┳┓ 3 | -- ┣┛┗┻┛┛┗┗┛┗┛┗┗ 4 | -- Neo(vim) the less is more 5 | -- @pwnwriter/pwnvim 6 | 7 | if vim.loader then 8 | vim.loader.enable() 9 | end 10 | 11 | require("opts").initial() 12 | 13 | local lazy_path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 14 | 15 | if not vim.uv.fs_stat(lazy_path) then 16 | local lazy_url = "https://github.com/folke/lazy.nvim" 17 | vim.fn.system { "git", "clone", "--filter=blob:none", lazy_url, "--branch=stable", lazy_path } 18 | end 19 | 20 | vim.opt.rtp:prepend(lazy_path) 21 | 22 | require "lazy_spec" 23 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, 3 | "catppuccin": { "branch": "main", "commit": "56a9dfd1e05868cf3189369aad87242941396563" }, 4 | "dropbar": { "branch": "master", "commit": "f7ecb0c3600ca1dc467c361e9af40f97289d7aad" }, 5 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, 6 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 7 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 8 | "lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" }, 9 | "mini": { "branch": "main", "commit": "25c8959b3fcf0461271a21dd204e6f3cd1cd7806" }, 10 | "render-markdown.nvim": { "branch": "main", "commit": "048d68028d09ad2e134e7059032b8192a85180b9" }, 11 | "snacks": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, 12 | "treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" } 13 | } 14 | -------------------------------------------------------------------------------- /lua/lazy_spec.lua: -------------------------------------------------------------------------------- 1 | require("lazy").setup("plugins", { 2 | concurrency = 4, 3 | defaults = { 4 | lazy = true, 5 | }, 6 | install = { 7 | colorscheme = { "catppuccin" }, 8 | }, 9 | dev = { 10 | path = vim.env.NVIM_DEV, 11 | }, 12 | performance = { 13 | cache = { 14 | enabled = true, 15 | }, 16 | reset_packpath = true, 17 | rtp = { 18 | disabled_plugins = { 19 | "osc52", 20 | "parser", 21 | "gzip", 22 | "netrwPlugin", 23 | "health", 24 | "man", 25 | "matchit", 26 | "rplugin", 27 | "tarPlugin", 28 | "tohtml", 29 | "tutor", 30 | "zipPlugin", 31 | "shadafile", 32 | "spellfile", 33 | "editorconfig", 34 | }, 35 | }, 36 | }, 37 | ui = { 38 | border = "solid", 39 | title = "lazy.nvim", 40 | size = { width = 0.9, height = 0.9 }, 41 | }, 42 | }) 43 | -------------------------------------------------------------------------------- /lua/lsp.lua: -------------------------------------------------------------------------------- 1 | local capabilities = vim.lsp.protocol.make_client_capabilities() 2 | 3 | capabilities = require("blink.cmp").get_lsp_capabilities(capabilities) 4 | 5 | capabilities.textDocument.foldingRange = { 6 | dynamicRegistration = false, 7 | lineFoldingOnly = true, 8 | } 9 | 10 | capabilities.textDocument.formatting = { 11 | dynamicRegistration = false, 12 | } 13 | 14 | capabilities.textDocument.semanticTokens.augmentsSyntaxTokens = false 15 | 16 | capabilities.textDocument.completion.completionItem = { 17 | contextSupport = true, 18 | snippetSupport = true, 19 | deprecatedSupport = true, 20 | commitCharactersSupport = true, 21 | resolveSupport = { 22 | properties = { 23 | "documentation", 24 | "detail", 25 | "additionalTextEdits", 26 | }, 27 | }, 28 | labelDetailsSupport = true, 29 | documentationFormat = { "markdown", "plaintext" }, 30 | } 31 | 32 | -- send actions with hover request 33 | capabilities.experimental = { 34 | hoverActions = true, 35 | hoverRange = true, 36 | serverStatusNotification = true, 37 | -- snippetTextEdit = true, -- not supported yet 38 | codeActionGroup = true, 39 | ssr = true, 40 | commands = { 41 | "rust-analyzer.runSingle", 42 | "rust-analyzer.debugSingle", 43 | "rust-analyzer.showReferences", 44 | "rust-analyzer.gotoLocation", 45 | "editor.action.triggerParameterHints", 46 | }, 47 | } 48 | 49 | require('mappings').lsp() 50 | 51 | vim.api.nvim_create_user_command("LspLog", function() 52 | vim.cmd.vsplit(vim.lsp.log.get_filename()) 53 | end, { 54 | desc = "Get all the lsp logs", 55 | }) 56 | 57 | vim.api.nvim_create_user_command("LspInfo", function() 58 | vim.cmd("silent checkhealth vim.lsp") 59 | end, { 60 | desc = "Get all the information about all LSP attached", 61 | }) 62 | 63 | vim.lsp.config.lua_ls = { 64 | cmd = { "lua-language-server" }, 65 | filetypes = { "lua" }, 66 | root_markers = { ".luarc.json", ".git", vim.uv.cwd() }, 67 | settings = { 68 | Lua = { 69 | telemetry = { 70 | enable = false, 71 | }, 72 | }, 73 | }, 74 | } 75 | 76 | vim.lsp.config.nixd = { 77 | cmd = { 'nixd' }, 78 | filetypes = { 'nix' }, 79 | root_markers = { 'flake.nix', 'git' }, 80 | } 81 | 82 | vim.lsp.config.nil_ls = { 83 | cmd = { 'nil' }, 84 | filetypes = { 'nix' }, 85 | root_markers = { 'flake.nix', '.git' }, 86 | } 87 | 88 | vim.lsp.enable({ 'lua_ls', 'nixd', 'nil_ls' }) 89 | -------------------------------------------------------------------------------- /lua/mappings.lua: -------------------------------------------------------------------------------- 1 | local modules = require "modules" 2 | 3 | local function map(mode, keys, action, desc) 4 | desc = desc or "" 5 | local opts = { noremap = true, silent = true, desc = desc } 6 | vim.keymap.set(mode, keys, action, opts) 7 | end 8 | 9 | local M = {} 10 | -- Expose the map function 11 | M.map = map 12 | 13 | M.general = function() 14 | -- insert movement 15 | map("i", "", "") 16 | map("i", "", "") 17 | map("i", "", "") 18 | map("i", "", "") 19 | 20 | -- Copy and paste in the same cursor position 21 | map("n", "p", function() 22 | local row, col = unpack(vim.api.nvim_win_get_cursor(0)) 23 | vim.cmd('put') 24 | vim.api.nvim_win_set_cursor(0, { row + 1, col }) 25 | end) 26 | 27 | map("i", "jj", "") 28 | map("i", "", "") 29 | 30 | map("n", "", "noh") 31 | 32 | -- Save only on new changes 33 | map("n", "", "update") 34 | 35 | -- Switching splits 36 | map("n", "", "h") 37 | map("n", "", "j") 38 | map("n", "", "k") 39 | map("n", "", "l") 40 | 41 | 42 | map("n", "", "bnext") 43 | map("n", "", "bprev") 44 | 45 | -- Resize splits 46 | map("n", "", ":resize +2") 47 | map("n", "", ":resize -2") 48 | map("n", "", ":vertical resize +2") 49 | map("n", "", ":vertical resize -2") 50 | 51 | map("n", "", "zz") 52 | map("n", "", "zz") 53 | 54 | map("v", "??", 'y:h ""') -- Show vim help 55 | map("v", "?/", 'y:/ ""') -- Search across the buffer 56 | end 57 | 58 | M.mini = function() 59 | local minipick = require "mini.pick" 60 | local miniextra = require "mini.extra" 61 | local minivisits = require "mini.visits" 62 | local minidiff = require "mini.diff" 63 | 64 | local builtin = minipick.builtin 65 | 66 | 67 | map({ "n" }, "ff", function() 68 | builtin.files() 69 | end, "find files") 70 | 71 | map({ "n" }, "bs", function() 72 | builtin.buffers() 73 | end, "Find buffers") 74 | 75 | map({ "n" }, "fr", function() 76 | builtin.resume() 77 | end, "Resume finding") 78 | 79 | map({ "n" }, "fw", function() 80 | builtin.grep_live() 81 | end, "Grep live") 82 | 83 | map({ "n" }, "e", function() 84 | local _ = require("mini.files").close() or require("mini.files").open() 85 | end, "Toggle minifiles") 86 | 87 | map({ "n" }, "bq", function() 88 | require("mini.bufremove").delete() 89 | end, "Remove current buffer") 90 | 91 | map("n", "", function() 92 | miniextra.pickers.visit_paths { filter = "todo" } 93 | end, "Add file to todolist") 94 | 95 | map("n", "", function() 96 | minivisits.add_label "todo" 97 | end, "Remove file from todolist") 98 | 99 | map("n", "", function() 100 | minivisits.remove_label() 101 | end, "Remove label from file") 102 | 103 | map("n", "gc", function() 104 | miniextra.pickers.git_commits() 105 | end, "Show git commits") 106 | 107 | map("n", "gh", function() 108 | miniextra.pickers.git_hunks() 109 | end, "Show git hunks") 110 | 111 | map("n", "dp", function() 112 | miniextra.pickers.diagnostic() 113 | end, "Diagnostic in picker") 114 | 115 | map("n", "td", function() 116 | minidiff.toggle_overlay(0) 117 | end, "Toggle git diff") 118 | end 119 | 120 | M.misc = function() 121 | map("n", "tn", function() 122 | modules.toggle_numbering() 123 | end, "Toggle line numbering") 124 | 125 | map("n", "tf", function() 126 | modules.toggle_flow() 127 | end, "Toggle flow") 128 | end 129 | 130 | -- map the following keys on lsp attach only 131 | M.lsp = function() 132 | --- Set minipick as default picker 133 | local minipick = require "mini.pick" 134 | vim.ui.select = minipick.ui_select 135 | 136 | -- Diagnostics mappings 137 | map("n", "dp", function() 138 | vim.diagnostic.goto_prev { float = false } 139 | end, "Diagnostics goto_prev") 140 | 141 | map("n", "dn", function() 142 | vim.diagnostic.goto_next { float = false } 143 | end, "Diagnostics goto_next") 144 | 145 | map("n", "ds", vim.diagnostic.setloclist, "Add buffer diagnostics to the location list.") 146 | 147 | map("n", "hi", function() 148 | modules.toggle_inlay_hint() -- toggle inlay hint 149 | end, "Toggle inlay hint") 150 | 151 | vim.api.nvim_create_autocmd("LspAttach", { 152 | --group = lspgroup, 153 | callback = function(event) 154 | vim.keymap.set("n", "k", function() vim.lsp.buf.hover({ border = "rounded" }) end, { buffer = event.buf }) 155 | end 156 | }) 157 | 158 | map("n", "df", function() 159 | vim.diagnostic.open_float() 160 | end, "Open diagnostics float ") 161 | map("n", "ld", vim.lsp.buf.definition, "Goto lsp definition") 162 | map("n", "lh", vim.lsp.buf.declaration, "Goto lsp declaration") 163 | map("n", "lt", vim.lsp.buf.type_definition, "Goto lsp definition") 164 | map("n", "li", vim.lsp.buf.implementation, "Goto lsp implementation") 165 | map("n", "lr", vim.lsp.buf.references, "Goto lsp reference") 166 | map({ "n", "v" }, "la", vim.lsp.buf.code_action, "Open lsp code action") 167 | map("n", "lf", function() 168 | vim.lsp.buf.format { async = true } 169 | end, "Lsp format") 170 | map("n", "lc", vim.lsp.buf.rename, "Lsp rename") 171 | map({ "i", "x" }, "", vim.lsp.buf.signature_help, "Lsp signature help") 172 | end 173 | 174 | return M 175 | -------------------------------------------------------------------------------- /lua/mini_nvim.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.pairs = { 4 | mappings = { 5 | ["<"] = { action = "closeopen", pair = "<>", neigh_pattern = "[^\\].", register = { cr = false } }, 6 | }, 7 | } 8 | 9 | M.files = { 10 | use_as_default_explorer = true, 11 | windows = { 12 | max_number = math.huge, 13 | preview = false, 14 | width_focus = 30, 15 | width_nofocus = 20, 16 | width_preview = 25, 17 | }, 18 | } 19 | 20 | local hipatterns = require "mini.hipatterns" 21 | M.hipatterns = { 22 | highlighters = { 23 | fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" }, 24 | hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" }, 25 | todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" }, 26 | note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" }, 27 | hex_color = hipatterns.gen_highlighter.hex_color(), 28 | }, 29 | } 30 | 31 | M.bufremove = { 32 | silent = true, 33 | } 34 | 35 | M.comment = {} 36 | 37 | M.pick = { 38 | options = { 39 | use_cache = true, 40 | }, 41 | } 42 | 43 | M.move = { 44 | mappings = { 45 | left = "", 46 | right = "", 47 | down = "", 48 | up = "", 49 | line_left = "", 50 | line_right = "", 51 | line_down = "", 52 | line_up = "", 53 | }, 54 | } 55 | 56 | -- M.indentscope = { 57 | -- symbol = "┋", 58 | -- } 59 | 60 | M.ai = {} 61 | 62 | M.visits = { 63 | store = { 64 | path = vim.fn.stdpath "cache" .. "mini-visits-index", 65 | }, 66 | } 67 | 68 | local miniclue = require "mini.clue" 69 | M.clue = { 70 | triggers = { 71 | { mode = "n", keys = "" }, 72 | { mode = "x", keys = "" }, 73 | 74 | { mode = "i", keys = "" }, 75 | 76 | { mode = "n", keys = "g" }, 77 | { mode = "x", keys = "g" }, 78 | 79 | { mode = "n", keys = "'" }, 80 | { mode = "n", keys = "`" }, 81 | { mode = "x", keys = "'" }, 82 | { mode = "x", keys = "`" }, 83 | 84 | { mode = "n", keys = '"' }, 85 | { mode = "x", keys = '"' }, 86 | { mode = "i", keys = "" }, 87 | { mode = "c", keys = "" }, 88 | 89 | { mode = "n", keys = "" }, 90 | 91 | { mode = "n", keys = "z" }, 92 | { mode = "x", keys = "z" }, 93 | }, 94 | 95 | clues = { 96 | miniclue.gen_clues.builtin_completion(), 97 | miniclue.gen_clues.g(), 98 | miniclue.gen_clues.marks(), 99 | miniclue.gen_clues.registers(), 100 | miniclue.gen_clues.windows(), 101 | miniclue.gen_clues.z(), 102 | }, 103 | } 104 | 105 | M.git = {} 106 | 107 | M.diff = { 108 | view = { 109 | style = "sign", 110 | signs = { add = " ", change = " ", delete = "" }, 111 | }, 112 | } 113 | 114 | local starter = require "mini.starter" 115 | 116 | M.starter = { 117 | evaluate_single = false, 118 | header = table.concat({ 119 | " ", 120 | " ", 121 | " ", 122 | " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", 123 | " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", 124 | " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", 125 | " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", 126 | " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", 127 | " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", 128 | " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", 129 | " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", 130 | " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", 131 | " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", 132 | " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", 133 | " ", }, "\n"), 134 | footer = os.date("%B %d, %I:%M %p"), 135 | items = { 136 | { 137 | name = " Bookmarked Files", 138 | action = "lua MiniExtra.pickers.visit_paths { filter = 'todo' }", 139 | section = " Actions ", 140 | }, 141 | { 142 | name = " Lazy Update", 143 | action = ":Lazy update", 144 | section = " Actions ", 145 | }, 146 | { 147 | name = " Open Blank File", 148 | action = ":enew", 149 | section = " Actions ", 150 | }, 151 | { 152 | name = " Find Files", 153 | action = "lua MiniPick.builtin.files()", 154 | section = " Actions ", 155 | }, 156 | { 157 | name = " Recent Files", 158 | action = "lua MiniExtra.pickers.oldfiles()", 159 | section = " Actions ", 160 | }, 161 | { 162 | name = " Quit", 163 | action = ":q!", 164 | section = " Actions ", 165 | }, 166 | }, 167 | content_hooks = { 168 | starter.gen_hook.aligning("center", "center"), 169 | }, 170 | } 171 | 172 | M.icons = { 173 | lsp = { 174 | ["function"] = { glyph = "󰡱", hl = "MiniIconsCyan" }, 175 | }, 176 | } 177 | 178 | M.operators = {} 179 | 180 | return M 181 | -------------------------------------------------------------------------------- /lua/modules.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local cmds = { "nu!", "rnu!", "nonu!" } 4 | local current_index = 1 5 | 6 | function M.toggle_numbering() 7 | current_index = current_index % #cmds + 1 8 | vim.cmd("set " .. cmds[current_index]) 9 | local signcolumn_setting = "auto" 10 | if cmds[current_index] == "nonu!" then 11 | signcolumn_setting = "yes:4" 12 | end 13 | vim.opt.signcolumn = signcolumn_setting 14 | end 15 | 16 | --- Toggle inlay hints 17 | function M.toggle_inlay_hint() 18 | local is_enabled = vim.lsp.inlay_hint.is_enabled() 19 | vim.lsp.inlay_hint.enable(not is_enabled) 20 | end 21 | 22 | -- Toggle flow state mode, Disable most of the unnecessary plugins :oOc 23 | local state = 0 24 | function M.toggle_flow() 25 | if state == 0 then 26 | vim.o.relativenumber = false 27 | vim.o.number = false 28 | vim.opt.signcolumn = "yes:4" 29 | vim.o.winbar = "" 30 | state = 1 31 | else 32 | vim.o.relativenumber = true 33 | vim.o.number = true 34 | vim.opt.signcolumn = "auto" 35 | vim.o.winbar = "%{%v:lua.dropbar.get_dropbar_str()%}" 36 | state = 0 37 | end 38 | end 39 | 40 | -- Autocommands 41 | local autocmd = vim.api.nvim_create_autocmd 42 | vim.b.miniindentscope_disable = true 43 | autocmd("FileType", { 44 | pattern = "help", 45 | desc = "Disable 'mini.indentscope' help page", 46 | callback = function(data) 47 | vim.b[data.buf].miniindentscope_disable = true 48 | end, 49 | }) 50 | 51 | autocmd("LspProgress", { 52 | ---@param ev {data: {client_id: integer, params: lsp.ProgressParams}} 53 | callback = function(ev) 54 | local spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" } 55 | vim.notify(vim.lsp.status(), "info", { 56 | id = "lsp_progress", 57 | title = "LSP Progress", 58 | opts = function(notif) 59 | notif.icon = ev.data.params.value.kind == "end" and " " 60 | or spinner[math.floor(vim.uv.hrtime() / (1e6 * 80)) % #spinner + 1] 61 | end, 62 | }) 63 | end, 64 | }) 65 | 66 | autocmd("CursorHold", { 67 | callback = function() 68 | vim.diagnostic.open_float(nil, { focusable = false, source = "if_many" }) 69 | end, 70 | }) 71 | 72 | return M 73 | -------------------------------------------------------------------------------- /lua/opts.lua: -------------------------------------------------------------------------------- 1 | local opt = vim.opt 2 | local g = vim.g 3 | local opts = {} 4 | 5 | opts.initial = function() 6 | opt.laststatus = 3 7 | opt.clipboard = "unnamedplus" 8 | opt.termguicolors = true 9 | opt.fillchars:append { eob = " " } 10 | opt.shortmess:append "aIF" 11 | opt.cursorline = true 12 | opt.cursorlineopt = "number" 13 | opt.ruler = true 14 | opt.number = true 15 | opt.relativenumber = true 16 | opt.breakindent = true 17 | opt.linebreak = true 18 | opt.swapfile = false 19 | opt.undofile = true 20 | opt.cmdheight = 0 21 | 22 | g.border_style = "rounded" ---@type "single"|"double"|"rounded" 23 | g.winblend = 0 24 | g.mapleader = " " 25 | 26 | -- Disable providers 27 | g.loaded_node_provider = 0 28 | g.loaded_python3_provider = 0 29 | g.loaded_perl_provider = 0 30 | g.loaded_ruby_provider = 0 31 | end 32 | 33 | opts.final = function() 34 | opt.completeopt = { "menuone", "noselect", "noinsert" } 35 | opt.wildmenu = true 36 | opt.pumheight = 10 37 | opt.ignorecase = true 38 | opt.smartcase = true 39 | opt.timeout = false 40 | opt.updatetime = 400 41 | opt.confirm = false 42 | opt.equalalways = false 43 | opt.splitbelow = true 44 | opt.splitright = true 45 | opt.scrolloff = 2 46 | 47 | -- Indenting 48 | opt.shiftwidth = 2 49 | opt.smartindent = true 50 | opt.tabstop = 2 51 | opt.expandtab = true 52 | opt.softtabstop = 2 53 | opt.sidescrolloff = 2 54 | 55 | -- Statusline 56 | local statusline_ascii = "" 57 | opt.statusline = "%#Normal#" .. statusline_ascii .. "%=" 58 | end 59 | 60 | 61 | vim.g.neovide_padding_top = 25 62 | vim.g.neovide_padding_bottom = 25 63 | vim.g.neovide_padding_right = 25 64 | vim.g.neovide_padding_left = 25 65 | 66 | 67 | --- Load shada after ui-enter 68 | local shada = vim.o.shada 69 | vim.o.shada = "" 70 | vim.api.nvim_create_autocmd("User", { 71 | pattern = "VeryLazy", 72 | callback = function() 73 | vim.o.shada = shada 74 | pcall(vim.cmd.rshada, { bang = true }) 75 | end, 76 | }) 77 | 78 | vim.diagnostic.config { 79 | virtual_text = { 80 | prefix = "", 81 | suffix = "", 82 | format = function(diagnostic) 83 | return " " .. diagnostic.message .. " " 84 | end, 85 | }, 86 | underline = { 87 | severity = { min = vim.diagnostic.severity.WARN }, 88 | }, 89 | signs = { 90 | text = { 91 | [vim.diagnostic.severity.HINT] = "", 92 | [vim.diagnostic.severity.ERROR] = "✘", 93 | [vim.diagnostic.severity.INFO] = "◉", 94 | [vim.diagnostic.severity.WARN] = "", 95 | }, 96 | }, 97 | } 98 | 99 | return opts 100 | -------------------------------------------------------------------------------- /lua/plugins/blink.lua: -------------------------------------------------------------------------------- 1 | return 2 | { 3 | "saghen/blink.cmp", 4 | version = '*', 5 | event = { "LspAttach" }, 6 | dependencies = { 7 | "rafamadriz/friendly-snippets", 8 | }, 9 | opts = { 10 | keymap = { preset = 'default' }, 11 | sources = { 12 | default = { "lazydev", "lsp", "path", "snippets", "buffer" }, 13 | providers = { 14 | cmdline = { 15 | min_keyword_length = 2, 16 | }, 17 | lazydev = { 18 | name = "LazyDev", 19 | module = "lazydev.integrations.blink", 20 | score_offset = 100, 21 | }, 22 | }, 23 | }, 24 | completion = { 25 | menu = { 26 | border = vim.g.border_style, 27 | scrolloff = 1, 28 | scrollbar = false, 29 | -- draw = { 30 | -- treesitter = { 'lsp' }, 31 | -- } 32 | }, 33 | documentation = { 34 | auto_show_delay_ms = 0, 35 | auto_show = true, 36 | window = { 37 | border = vim.g.border_style, 38 | }, 39 | }, 40 | }, 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /lua/plugins/cpt.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "catppuccin/nvim", 3 | lazy = true, 4 | priority = 1000, 5 | -- enabled = false, 6 | name = "catppuccin", 7 | init = function() 8 | vim.cmd.colorscheme "catppuccin" 9 | end, 10 | opts = { 11 | transparent_background = not vim.g.neovide, 12 | compile_path = vim.fn.stdpath "cache" .. "/catppuccin", 13 | compile = true, 14 | flavour = "latte", 15 | integrations = { 16 | snacks = { 17 | enabled = false, 18 | indent_scope_color = "lavender", 19 | }, 20 | treesitter = true, 21 | mason = true, 22 | blink_cmp = true, 23 | native_lsp = { 24 | enabled = true, 25 | virtual_text = { 26 | errors = { "italic" }, 27 | hints = { "italic" }, 28 | warnings = { "italic" }, 29 | information = { "italic" }, 30 | }, 31 | underlines = { 32 | errors = { "undercurl" }, 33 | hints = { "undercurl" }, 34 | warnings = { "undercurl" }, 35 | information = { "undercurl" }, 36 | }, 37 | }, 38 | mini = { 39 | enabled = true, 40 | }, 41 | }, 42 | 43 | }, 44 | } 45 | -------------------------------------------------------------------------------- /lua/plugins/lazydev.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | { 4 | "folke/lazydev.nvim", 5 | ft = "lua", 6 | opts = { 7 | library = { 8 | { path = "${3rd}/luv/library", words = { "vim%.uv" } }, 9 | }, 10 | enabled = true, 11 | }, 12 | }, 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lua/plugins/mini.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "echasnovski/mini.nvim", 3 | name = "mini", 4 | version = false, 5 | keys = function() 6 | require("mappings").mini() 7 | end, 8 | init = function() 9 | package.preload["nvim-web-devicons"] = function() 10 | package.loaded["nvim-web-devicons"] = {} 11 | require("mini.icons").mock_nvim_web_devicons() 12 | return package.loaded["nvim-web-devicons"] 13 | end 14 | end, 15 | event = function() 16 | if vim.fn.argc() == 0 then 17 | return "VimEnter" 18 | else 19 | return { "InsertEnter", "LspAttach" } 20 | end 21 | end, 22 | 23 | config = function() 24 | local mini_config = require "mini_nvim" 25 | local mini_modules = { 26 | "icons", 27 | "comment", 28 | "starter", 29 | "pairs", 30 | "ai", 31 | "surround", 32 | "files", 33 | "hipatterns", 34 | "bufremove", 35 | "pick", 36 | "move", 37 | "extra", 38 | "visits", 39 | "clue", 40 | "git", 41 | "diff", 42 | "operators", 43 | } 44 | for _, module in ipairs(mini_modules) do 45 | require("mini." .. module).setup(mini_config[module]) 46 | end 47 | end, 48 | } 49 | -------------------------------------------------------------------------------- /lua/plugins/misc.lua: -------------------------------------------------------------------------------- 1 | local conf_path = vim.fn.stdpath "config" --[[@as string]] 2 | return { 3 | { 4 | "MeanderingProgrammer/render-markdown.nvim", 5 | ft = "markdown", 6 | dependencies = { 7 | "nvim-treesitter/nvim-treesitter", 8 | }, 9 | }, 10 | 11 | { 12 | "Bekaboo/dropbar.nvim", 13 | name = "dropbar", 14 | event = { "BufReadPost", "BufNewFile" }, 15 | keys = { 16 | require("mappings").map({ "n" }, "p", function() 17 | require("dropbar.api").pick(vim.v.count ~= 0 and vim.v.count) 18 | end, "Toggle dropbar menu"), 19 | }, 20 | opts = {}, 21 | }, 22 | 23 | { 24 | "nvim-treesitter/nvim-treesitter", 25 | name = "treesitter", 26 | cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, 27 | build = ":TSUpdate", 28 | event = { 29 | "BufReadPost", 30 | "BufNewFile", 31 | }, 32 | config = function() 33 | require("nvim-treesitter.configs").setup { 34 | ensure_installed = { "lua", "vimdoc", "rust", "go", "astro", "json", "toml", "markdown" }, 35 | highlight = { 36 | enable = true, 37 | use_languagetree = true, 38 | }, 39 | indent = { enable = true }, 40 | } 41 | end, 42 | }, 43 | 44 | { 45 | name = "options", 46 | event = "VeryLazy", 47 | dir = conf_path, 48 | config = function() 49 | require("opts").final() 50 | require("mappings").general() 51 | require("mappings").misc() 52 | require("lsp") 53 | end, 54 | }, 55 | 56 | } 57 | -------------------------------------------------------------------------------- /lua/plugins/snacks.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/snacks.nvim", 3 | name = "snacks", 4 | keys = { 5 | require("mappings").map({ "n" }, "o", function() 6 | require("snacks").scratch() 7 | end, "Toggle scratch pad"), 8 | 9 | require("mappings").map({ "n" }, "E", function() 10 | require("snacks").picker.explorer() 11 | end, "Toggle snacks explorer"), 12 | 13 | require("mappings").map({ "n" }, "F", function() 14 | require("snacks").picker.pick("files") 15 | end, "Toggle find files snacks"), 16 | 17 | require("mappings").map({ "n", "t" }, "", function() 18 | require("snacks").terminal() 19 | end, "Toggle terminal buffer") 20 | 21 | }, 22 | event = { "BufReadPost" }, 23 | opts = { 24 | statuscolumn = { 25 | left = { "fold", "git" }, 26 | right = { "mark", "sign" }, 27 | }, 28 | words = { 29 | enabled = true, 30 | debounce = 500, 31 | }, 32 | notifier = { 33 | wo = { 34 | winblend = vim.g.winblend, 35 | }, 36 | }, 37 | indent = { 38 | scope = { 39 | treesitter = { 40 | enabled = true, 41 | }, 42 | }, 43 | }, 44 | }, 45 | } 46 | --------------------------------------------------------------------------------