diff --git a/assets/screenshot.png b/assets/screenshot.png deleted file mode 100644 index aeffa95..0000000 Binary files a/assets/screenshot.png and /dev/null differ diff --git a/dotfyle.json b/dotfyle.json index 8277ccc..95cf53f 100644 --- a/dotfyle.json +++ b/dotfyle.json @@ -1 +1,1972 @@ -{"distribution": "custom", "masonTools": ["actionlint", "bash-language-server", "biome", "black", "clang-format", "clangd", "emmet-ls", "eslint_d", "goimports-reviser", "golangci-lint", "graphql-lsp", "hadolint", "isort", "jdtls", "lua-language-server", "prettier", "prisma-language-server", "proselint", "pylint", "pylsp", "pyright", "pyright-langserver", "rubocop", "ruff-lsp", "rust-analyzer", "shellcheck", "shfmt", "solargraph", "stylua", "svelteserver", "tailwindcss-language-server", "typescript-language-server", "typos-lsp", "vim-language-server", "vint", "vscode-css-language-server", "vscode-eslint-language-server", "vscode-html-language-server", "vscode-json-language-server", "write-good"], "keymaps": [{"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ":bnext"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "nohlsearch"}, {"desc": "Dismiss All Notifications", "noremap": true, "lhs": "un", "mode": "n", "rhs": ""}, {"desc": "Buffer Local Keymaps (which-key)", "noremap": true, "lhs": "?", "mode": "n", "rhs": ""}, {"desc": "Left File Explorer", "noremap": true, "lhs": "", "mode": "n", "rhs": ":Neotree toggle left"}, {"desc": "Float File Explorer", "noremap": true, "lhs": "ee", "mode": "n", "rhs": ":Neotree toggle float"}, {"desc": "Quit Buffer", "noremap": true, "lhs": "q", "mode": "n", "rhs": ""}, {"desc": "Toggle TS Context", "noremap": true, "lhs": "tc", "mode": "n", "rhs": ""}, {"desc": "Live Grep", "noremap": true, "lhs": "sg", "mode": "n", "rhs": ""}, {"desc": "Open Recent File", "noremap": true, "lhs": "so", "mode": "n", "rhs": ""}, {"desc": "Map Pages", "noremap": true, "lhs": "sM", "mode": "n", "rhs": ""}, {"desc": "Find highlight groups", "noremap": true, "lhs": "sH", "mode": "n", "rhs": ""}, {"desc": "Find Help", "noremap": true, "lhs": "sh", "mode": "n", "rhs": ""}, {"desc": "Find File (CWD)", "noremap": true, "lhs": "sf", "mode": "n", "rhs": ""}, {"desc": "Buffers", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "File Browser", "noremap": true, "lhs": "sF", "mode": "n", "rhs": ""}, {"desc": "Commands", "noremap": true, "lhs": "sC", "mode": "n", "rhs": ""}, {"desc": "Keymaps", "noremap": true, "lhs": "sk", "mode": "n", "rhs": ""}, {"desc": "Grep String", "noremap": true, "lhs": "sw", "mode": "n", "rhs": ""}, {"desc": "LSP references/definitions/... (Trouble)", "noremap": true, "lhs": "cS", "mode": "n", "rhs": ""}, {"desc": "Symbols (Trouble)", "noremap": true, "lhs": "cs", "mode": "n", "rhs": ""}, {"desc": "Buffer Diagnostics (Trouble)", "noremap": true, "lhs": "xX", "mode": "n", "rhs": ""}, {"desc": "Diagnostics (Trouble)", "noremap": true, "lhs": "xx", "mode": "n", "rhs": ""}, {"desc": "Quickfix List (Trouble)", "noremap": true, "lhs": "xQ", "mode": "n", "rhs": ""}, {"desc": "Location List (Trouble)", "noremap": true, "lhs": "xL", "mode": "n", "rhs": ""}, {"desc": "Maximize/minimize a split", "noremap": true, "lhs": "sm", "mode": "n", "rhs": ""}, {"desc": "Replace in Files (Spectre)", "noremap": true, "lhs": "sr", "mode": "n", "rhs": ""}, {"desc": "Toggle Undotree", "noremap": true, "lhs": "uu", "mode": "n", "rhs": ""}, {"desc": "Toggle zen mode", "noremap": true, "lhs": "zz", "mode": "n", "rhs": ""}, {"desc": "Don't Save Current Session", "noremap": true, "lhs": "sd", "mode": "n", "rhs": ""}, {"desc": "Restore Last Session", "noremap": true, "lhs": "sl", "mode": "n", "rhs": ""}, {"desc": "Restore Session", "noremap": true, "lhs": "ss", "mode": "n", "rhs": ""}, {"desc": "Stop", "noremap": true, "lhs": "tS", "mode": "n", "rhs": ""}, {"desc": "Toggle Output Panel", "noremap": true, "lhs": "tO", "mode": "n", "rhs": ""}, {"desc": "Show Output", "noremap": true, "lhs": "to", "mode": "n", "rhs": ""}, {"desc": "Toggle Summary", "noremap": true, "lhs": "ts", "mode": "n", "rhs": ""}, {"desc": "Run Nearest", "noremap": true, "lhs": "tr", "mode": "n", "rhs": ""}, {"desc": "Run All Test Files", "noremap": true, "lhs": "tT", "mode": "n", "rhs": ""}, {"desc": "Run File", "noremap": true, "lhs": "tw", "mode": "n", "rhs": ""}, {"desc": "toggle markdown preview", "noremap": true, "lhs": "mp", "mode": "n", "rhs": ""}, {"desc": "Horizontal Terminal", "noremap": true, "lhs": "th", "mode": "n", "rhs": ""}, {"desc": "Vertical Terminal", "noremap": true, "lhs": "tv", "mode": "n", "rhs": ""}, {"desc": "Toggle DB UI", "noremap": true, "lhs": "du", "mode": "n", "rhs": ""}, {"desc": "DB Last query", "noremap": true, "lhs": "dl", "mode": "n", "rhs": ""}, {"desc": "DB Rename buffer", "noremap": true, "lhs": "dr", "mode": "n", "rhs": ""}, {"desc": "DB Find buffer", "noremap": true, "lhs": "db", "mode": "n", "rhs": ""}, {"desc": "toggle barbecue", "noremap": true, "lhs": "bq", "mode": "n", "rhs": ""}, {"desc": "Screenshot (Save)", "noremap": true, "lhs": "cP", "mode": "v", "rhs": ""}, {"desc": "Screenshot (Clipboard)", "noremap": true, "lhs": "cp", "mode": "v", "rhs": ""}, {"desc": "Nav", "noremap": true, "lhs": "nv", "mode": "n", "rhs": ""}, {"desc": "Delete Comment Style", "noremap": true, "lhs": "cd", "mode": "v", "rhs": ""}, {"desc": "Delete Comment Style", "noremap": true, "lhs": "cd", "mode": "n", "rhs": ""}, {"desc": "Catalog", "noremap": true, "lhs": "cc", "mode": "n", "rhs": ""}, {"desc": "Marked", "noremap": true, "lhs": "cm", "mode": "v", "rhs": ""}, {"desc": "Marked", "noremap": true, "lhs": "cm", "mode": "n", "rhs": ""}, {"desc": "Line", "noremap": true, "lhs": "cl", "mode": "n", "rhs": ""}, {"desc": "Tiled line", "noremap": true, "lhs": "ct", "mode": "v", "rhs": ""}, {"desc": "Tiled line", "noremap": true, "lhs": "ct", "mode": "n", "rhs": ""}, {"desc": "Comment Box", "noremap": true, "lhs": "cb", "mode": "v", "rhs": ""}, {"desc": "Comment Box", "noremap": true, "lhs": "cb", "mode": "n", "rhs": ""}, {"desc": "Toggle keys", "noremap": true, "lhs": "kt", "mode": "n", "rhs": "Screenkey"}, {"desc": "", "noremap": true, "lhs": "se", "mode": "n", "rhs": "IconPickerInsert emoji"}, {"desc": " Insert Macro Breakpoint.", "noremap": true, "lhs": "##", "mode": "n", "rhs": ""}, {"desc": "Search Selected Text (Backwards)", "noremap": true, "lhs": "#", "mode": "x", "rhs": "y?\\V=escape(@\", '?\\')"}, {"desc": ":help &-default", "noremap": true, "lhs": "&", "mode": "n", "rhs": ":&&"}, {"desc": "Search Selected Text", "noremap": true, "lhs": "*", "mode": "x", "rhs": "y/\\V=escape(@\", '/\\')"}, {"desc": "", "noremap": true, "lhs": "+", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "-", "mode": "n", "rhs": ""}, {"desc": "(V) Indent to left", "noremap": true, "lhs": "<", "mode": "v", "rhs": "gv"}, {"desc": "(V) Indent to right", "noremap": true, "lhs": ">", "mode": "v", "rhs": ">gv"}, {"desc": ":help v_@-default", "noremap": true, "lhs": "@", "mode": "x", "rhs": "mode() ==# 'V' ? ':normal! @'.getcharstr().'' : '@'"}, {"desc": "Change without yanking", "noremap": true, "lhs": "C", "mode": "x", "rhs": "\"_C"}, {"desc": "Change without yanking", "noremap": true, "lhs": "C", "mode": "n", "rhs": "\"_C"}, {"desc": "Join line without moving the cursor", "noremap": true, "lhs": "J", "mode": "n", "rhs": "mzJ`z"}, {"desc": "", "noremap": true, "lhs": "J", "mode": "v", "rhs": ":m '>+1gv=gv"}, {"desc": "", "noremap": true, "lhs": "K", "mode": "v", "rhs": ":m '>-2gv=gv"}, {"desc": "", "noremap": true, "lhs": "N", "mode": "n", "rhs": "Nzzzv"}, {"desc": " Play Macro", "noremap": true, "lhs": "Q", "mode": "n", "rhs": ""}, {"desc": ":help v_Q-default", "noremap": true, "lhs": "Q", "mode": "x", "rhs": "mode() ==# 'V' ? ':normal! @=reg_recorded()' : 'Q'"}, {"desc": "Treesitter Search", "noremap": true, "lhs": "R", "mode": "x", "rhs": ""}, {"desc": "Flash Treesitter", "noremap": true, "lhs": "S", "mode": "x", "rhs": ""}, {"desc": "Flash Treesitter", "noremap": true, "lhs": "S", "mode": "n", "rhs": ""}, {"desc": ":help Y-default", "noremap": true, "lhs": "Y", "mode": "n", "rhs": "y$"}, {"desc": "Go to TS context", "noremap": true, "lhs": "[c", "mode": "n", "rhs": ""}, {"desc": "Previous Trouble/Quickfix Item", "noremap": true, "lhs": "[q", "mode": "n", "rhs": ""}, {"desc": "Jump to the previous diagnostic", "noremap": true, "lhs": "[d", "mode": "n", "rhs": ""}, {"desc": "Previous location list item", "noremap": true, "lhs": "\\lp", "mode": "n", "rhs": "lprev"}, {"desc": "Next location list item", "noremap": true, "lhs": "\\ln", "mode": "n", "rhs": "lnext"}, {"desc": "Close location list", "noremap": true, "lhs": "\\lc", "mode": "n", "rhs": "lclose"}, {"desc": "Open location list", "noremap": true, "lhs": "\\lo", "mode": "n", "rhs": "lopen"}, {"desc": "Paste from system clipboard", "noremap": true, "lhs": "\\p", "mode": "n", "rhs": "\"+p"}, {"desc": "Copy to system clipboard", "noremap": true, "lhs": "\\y", "mode": "v", "rhs": "\"+y"}, {"desc": "Copy to system clipboard", "noremap": true, "lhs": "\\y", "mode": "n", "rhs": "\"+y"}, {"desc": "Select pasted text", "noremap": true, "lhs": "\\vp", "mode": "n", "rhs": "`[v`]"}, {"desc": "", "noremap": true, "lhs": "\\r", "mode": "v", "rhs": "\"hy:%s/h//g"}, {"desc": "Force save and quit", "noremap": true, "lhs": "\\Q", "mode": "n", "rhs": "wq!"}, {"desc": "Save file", "noremap": true, "lhs": "\\w", "mode": "n", "rhs": ":w"}, {"desc": "Paste from system clipboard", "noremap": true, "lhs": "\\p", "mode": "v", "rhs": "\"+p"}, {"desc": "Next Trouble/Quickfix Item", "noremap": true, "lhs": "]q", "mode": "n", "rhs": ""}, {"desc": "Jump to the next diagnostic", "noremap": true, "lhs": "]d", "mode": "n", "rhs": ""}, {"desc": " Edit Macro", "noremap": true, "lhs": "cq", "mode": "n", "rhs": ""}, {"desc": "Change without yanking", "noremap": true, "lhs": "cc", "mode": "x", "rhs": "\"_cc"}, {"desc": "Change without yanking", "noremap": true, "lhs": "cc", "mode": "n", "rhs": "\"_cc"}, {"desc": "Change without yanking", "noremap": true, "lhs": "c", "mode": "x", "rhs": "\"_c"}, {"desc": "Change without yanking", "noremap": true, "lhs": "c", "mode": "n", "rhs": "\"_c"}, {"desc": "Change previous match by pressing dot (.)", "noremap": true, "lhs": "cN", "mode": "n", "rhs": "*``cgN"}, {"desc": "Change next match by pressing dot (.)", "noremap": true, "lhs": "cn", "mode": "n", "rhs": "*``cgn"}, {"desc": " Delete All Macros", "noremap": true, "lhs": "dq", "mode": "n", "rhs": ""}, {"desc": "Don't Yank Empty Line to Clipboard", "noremap": true, "lhs": "dd", "mode": "n", "rhs": ""}, {"desc": "Search Inside Visual Selection", "noremap": true, "lhs": "g/", "mode": "x", "rhs": "/\\%V"}, {"desc": "Toggle comment line", "noremap": true, "lhs": "gcc", "mode": "n", "rhs": ""}, {"desc": "Toggle comment", "noremap": true, "lhs": "gc", "mode": "x", "rhs": ""}, {"desc": "Toggle comment", "noremap": true, "lhs": "gc", "mode": "n", "rhs": ""}, {"desc": "Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)", "noremap": true, "lhs": "gx", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "gx", "mode": "n", "rhs": ":URLOpenUnderCursor"}, {"desc": "", "noremap": true, "lhs": "hs", "mode": "n", "rhs": ":sp"}, {"desc": "", "noremap": true, "lhs": "j", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "k", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "n", "mode": "n", "rhs": "nzzzv"}, {"desc": " Start/Stop Recording", "noremap": true, "lhs": "q", "mode": "n", "rhs": ""}, {"desc": "Flash", "noremap": true, "lhs": "s", "mode": "x", "rhs": ""}, {"desc": "Flash", "noremap": true, "lhs": "s", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "vs", "mode": "n", "rhs": ":vsp"}, {"desc": "delete without yanking", "noremap": true, "lhs": "x", "mode": "x", "rhs": "\"_x"}, {"desc": "delete without yanking", "noremap": true, "lhs": "x", "mode": "n", "rhs": "\"_x"}, {"desc": " Yank Macro", "noremap": true, "lhs": "yq", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zb", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zb", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zz", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zz", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zt", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "zt", "mode": "n", "rhs": ""}, {"desc": " Switch Macro Slot", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "Resize split right", "noremap": true, "lhs": "", "mode": "n", "rhs": "vertical resize +2"}, {"desc": "Resize split left", "noremap": true, "lhs": "", "mode": "n", "rhs": "vertical resize -2"}, {"desc": "Resize split down", "noremap": true, "lhs": "", "mode": "n", "rhs": "resize +2"}, {"desc": "Resize split up", "noremap": true, "lhs": "", "mode": "n", "rhs": "resize -2"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ":bprev"}, {"desc": "", "noremap": true, "lhs": "", "mode": "v", "rhs": ":sort"}, {"desc": "Change Without Yanking", "noremap": true, "lhs": "", "mode": "x", "rhs": "\"_c"}, {"desc": "Change Without Yanking", "noremap": true, "lhs": "", "mode": "n", "rhs": "\"_c"}, {"desc": "Delete Without Yanking", "noremap": true, "lhs": "", "mode": "x", "rhs": "\"_d"}, {"desc": "Delete Without Yanking", "noremap": true, "lhs": "", "mode": "n", "rhs": "\"_d"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "ggVG"}, {"desc": "Show diagnostics under the cursor", "noremap": false, "lhs": "", "mode": "n", "rhs": "d"}, {"desc": "Show diagnostics under the cursor", "noremap": true, "lhs": "d", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}], "plugins": ["2kabhishek/termim.nvim", "Exafunction/codeium.vim", "HiPhish/rainbow-delimiters.nvim", "L3MON4D3/LuaSnip", "LudoPinelli/comment-box.nvim", "LunarVim/bigfile.nvim", "MunifTanjim/nui.nvim", "NStefan002/screenkey.nvim", "SmiteshP/nvim-navbuddy", "SmiteshP/nvim-navic", "WhoIsSethDaniel/mason-tool-installer.nvim", "akinsho/toggleterm.nvim", "altermo/ultimate-autopair.nvim", "antosha417/nvim-lsp-file-operations", "bluz71/vim-moonfly-colors", "chrisgrieser/nvim-recorder", "creativenull/dotfyle-metadata.nvim", "echasnovski/mini.nvim", "famiu/bufdelete.nvim", "folke/flash.nvim", "folke/lazy.nvim", "folke/lazydev.nvim", "folke/noice.nvim", "folke/persistence.nvim", "folke/trouble.nvim", "folke/which-key.nvim", "folke/zen-mode.nvim", "goolord/alpha-nvim", "haydenmeade/neotest-jest", "hrsh7th/cmp-buffer", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-path", "hrsh7th/nvim-cmp", "iamcco/markdown-preview.nvim", "jay-babu/mason-null-ls.nvim", "karb94/neoscroll.nvim", "kristijanhusak/vim-dadbod-completion", "kristijanhusak/vim-dadbod-ui", "leoluz/nvim-dap-go", "luukvbaal/statuscol.nvim", "m-demare/hlargs.nvim", "marilari88/neotest-vitest", "max397574/better-escape.nvim", "mbbill/undotree", "mfussenegger/nvim-dap", "mistricky/codesnap.nvim", "mstuttgart/odoo-snippets", "mvllow/modes.nvim", "nacro90/numb.nvim", "neovim/nvim-lspconfig", "nmac427/guess-indent.nvim", "numToStr/Navigator.nvim", "nvim-lua/plenary.nvim", "nvim-lualine/lualine.nvim", "nvim-neo-tree/neo-tree.nvim", "nvim-neotest/neotest", "nvim-neotest/nvim-nio", "nvim-pack/nvim-spectre", "nvim-telescope/telescope-file-browser.nvim", "nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-ui-select.nvim", "nvim-telescope/telescope.nvim", "nvim-tree/nvim-web-devicons", "nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-textobjects", "nvimdev/lspsaga.nvim", "nvimtools/none-ls.nvim", "onsails/lspkind.nvim", "rafamadriz/friendly-snippets", "rcarriga/nvim-dap-ui", "rcarriga/nvim-notify", "saadparwaiz1/cmp_luasnip", "smjonas/inc-rename.nvim", "sontungexpt/url-open", "soulis-1256/eagle.nvim", "stevearc/dressing.nvim", "szw/vim-maximizer", "tpope/vim-dadbod", "utilyre/barbecue.nvim", "wakatime/vim-wakatime", "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "willothy/flatten.nvim", "willothy/nvim-cokeline", "windwp/nvim-autopairs", "windwp/nvim-ts-autotag", "zapling/mason-lock.nvim", "ziontee113/icon-picker.nvim"], "pluginManager": "lazy.nvim", "treesitterParsers": ["bash", "c", "cpp", "css", "html", "java", "javascript", "json", "lua", "markdown", "markdown_inline", "python", "scss", "toml", "tsx", "typescript", "vim", "vimdoc"], "lspServers": ["bashls", "clangd", "cssls", "html", "lua_ls", "pyright", "svelte", "tailwindcss", "tsserver"], "leaderKey": ""} \ No newline at end of file +{ + "distribution": "custom", + "masonTools": [ + "biome", + "black", + "clang-format", + "clangd", + "eslint_d", + "isort", + "jdtls", + "lua-language-server", + "prettier", + "pylint", + "pyright", + "pyright-langserver", + "stylua", + "vscode-html-language-server" + ], + "plugins": [ + "2kabhishek/tdo.nvim", + "2kabhishek/termim.nvim", + "Exafunction/codeium.vim", + "HiPhish/rainbow-delimiters.nvim", + "L3MON4D3/LuaSnip", + "LudoPinelli/comment-box.nvim", + "LunarVim/bigfile.nvim", + "MunifTanjim/nui.nvim", + "NStefan002/screenkey.nvim", + "SmiteshP/nvim-navic", + "WhoIsSethDaniel/mason-tool-installer.nvim", + "akinsho/bufferline.nvim", + "akinsho/toggleterm.nvim", + "altermo/ultimate-autopair.nvim", + "antosha417/nvim-lsp-file-operations", + "bluz71/vim-moonfly-colors", + "chrisgrieser/nvim-recorder", + "creativenull/dotfyle-metadata.nvim", + "debugloop/telescope-undo.nvim", + "echasnovski/mini.files", + "echasnovski/mini.nvim", + "folke/flash.nvim", + "folke/lazy.nvim", + "folke/noice.nvim", + "folke/persistence.nvim", + "folke/trouble.nvim", + "folke/which-key.nvim", + "folke/zen-mode.nvim", + "gbprod/yanky.nvim", + "goolord/alpha-nvim", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-path", + "hrsh7th/nvim-cmp", + "iamcco/markdown-preview.nvim", + "jay-babu/mason-null-ls.nvim", + "kristijanhusak/vim-dadbod-completion", + "kristijanhusak/vim-dadbod-ui", + "lukas-reineke/indent-blankline.nvim", + "m-demare/hlargs.nvim", + "m4xshen/hardtime.nvim", + "max397574/better-escape.nvim", + "mfussenegger/nvim-dap", + "mstuttgart/odoo-snippets", + "mvllow/modes.nvim", + "nacro90/numb.nvim", + "neovim/nvim-lspconfig", + "numToStr/Navigator.nvim", + "nvim-lua/plenary.nvim", + "nvim-lualine/lualine.nvim", + "nvim-neo-tree/neo-tree.nvim", + "nvim-neotest/neotest", + "nvim-neotest/neotest-jest", + "nvim-neotest/neotest-python", + "nvim-neotest/nvim-nio", + "nvim-pack/nvim-spectre", + "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-fzf-native.nvim", + "nvim-telescope/telescope-symbols.nvim", + "nvim-telescope/telescope-ui-select.nvim", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", + "nvim-treesitter/nvim-treesitter", + "nvim-treesitter/nvim-treesitter-context", + "nvim-treesitter/nvim-treesitter-textobjects", + "nvimdev/lspsaga.nvim", + "nvimtools/none-ls.nvim", + "olimorris/neotest-rspec", + "onsails/lspkind.nvim", + "rafamadriz/friendly-snippets", + "rcarriga/nvim-dap-ui", + "rcarriga/nvim-notify", + "saadparwaiz1/cmp_luasnip", + "smjonas/inc-rename.nvim", + "stevearc/dressing.nvim", + "szw/vim-maximizer", + "tpope/vim-dadbod", + "utilyre/barbecue.nvim", + "wakatime/vim-wakatime", + "williamboman/mason-lspconfig.nvim", + "williamboman/mason.nvim", + "willothy/flatten.nvim", + "windwp/nvim-ts-autotag", + "zapling/mason-lock.nvim" + ], + "pluginManager": "lazy.nvim", + "keymaps": [ + { + "desc": "Next Buffer", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "bnext" + }, + { + "desc": "Escape and clear hlsearch", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "noh" + }, + { + "desc": " Left File Explorer", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": ":Neotree toggle left" + }, + { + "desc": "Float File Explorer", + "noremap": true, + "lhs": "ee", + "mode": "n", + "rhs": ":Neotree toggle float" + }, + { + "desc": "Current Word", + "noremap": true, + "lhs": "jw", + "mode": "v", + "rhs": "lua require(\"flash\").jump({ pattern = vim.fn.expand(\"cword>\")})" + }, + { + "desc": "Current Word", + "noremap": true, + "lhs": "jw", + "mode": "n", + "rhs": "lua require(\"flash\").jump({ pattern = vim.fn.expand(\"cword>\")})" + }, + { + "desc": "Remote Treesitter", + "noremap": true, + "lhs": "jt", + "mode": "v", + "rhs": "lua require('flash').treesitter_search()" + }, + { + "desc": "Remote Treesitter", + "noremap": true, + "lhs": "jt", + "mode": "n", + "rhs": "lua require('flash').treesitter_search()" + }, + { + "desc": "Search", + "noremap": true, + "lhs": "js", + "mode": "v", + "rhs": "lua require('flash').jump()" + }, + { + "desc": "Search", + "noremap": true, + "lhs": "js", + "mode": "n", + "rhs": "lua require('flash').jump()" + }, + { + "desc": "Previous Jump", + "noremap": true, + "lhs": "jp", + "mode": "v", + "rhs": "lua require('flash').jump({continue = true})" + }, + { + "desc": "Previous Jump", + "noremap": true, + "lhs": "jp", + "mode": "n", + "rhs": "lua require('flash').jump({continue = true})" + }, + { + "desc": "Search Forward", + "noremap": true, + "lhs": "jn", + "mode": "v", + "rhs": "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})" + }, + { + "desc": "Search Forward", + "noremap": true, + "lhs": "jn", + "mode": "n", + "rhs": "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})" + }, + { + "desc": "Forward", + "noremap": true, + "lhs": "jl", + "mode": "n", + "rhs": "" + }, + { + "desc": "Treesitter", + "noremap": true, + "lhs": "jk", + "mode": "v", + "rhs": "lua require('flash').treesitter()" + }, + { + "desc": "Treesitter", + "noremap": true, + "lhs": "jk", + "mode": "n", + "rhs": "lua require('flash').treesitter()" + }, + { + "desc": "Remote", + "noremap": true, + "lhs": "jj", + "mode": "v", + "rhs": "lua require('flash').remote()" + }, + { + "desc": "Remote", + "noremap": true, + "lhs": "jj", + "mode": "n", + "rhs": "lua require('flash').remote()" + }, + { + "desc": "Backward", + "noremap": true, + "lhs": "jh", + "mode": "n", + "rhs": "" + }, + { + "desc": "Jumplist", + "noremap": true, + "lhs": "jf", + "mode": "n", + "rhs": "Telescope jumplist" + }, + { + "desc": "Diagnostics", + "noremap": true, + "lhs": "jd", + "mode": "v", + "rhs": "FlashDiagnostics" + }, + { + "desc": "Diagnostics", + "noremap": true, + "lhs": "jd", + "mode": "n", + "rhs": "FlashDiagnostics" + }, + { + "desc": "Word", + "noremap": true, + "lhs": "jc", + "mode": "n", + "rhs": "*" + }, + { + "desc": "Search Backward", + "noremap": true, + "lhs": "jN", + "mode": "v", + "rhs": "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})" + }, + { + "desc": "Search Backward", + "noremap": true, + "lhs": "jN", + "mode": "n", + "rhs": "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})" + }, + { + "desc": "Sort Desc", + "noremap": true, + "lhs": "cS", + "mode": "v", + "rhs": ":sort!" + }, + { + "desc": "Time", + "noremap": true, + "lhs": "it", + "mode": "n", + "rhs": "put =strftime('## %r')" + }, + { + "desc": "Registers", + "noremap": true, + "lhs": "ir", + "mode": "n", + "rhs": "Telescope registers" + }, + { + "desc": "Relative Path", + "noremap": true, + "lhs": "ip", + "mode": "n", + "rhs": "put %" + }, + { + "desc": "Nerd Glyphs", + "noremap": true, + "lhs": "in", + "mode": "n", + "rhs": "Nerdy" + }, + { + "desc": "File Name", + "noremap": true, + "lhs": "if", + "mode": "n", + "rhs": "put =expand('%:t')" + }, + { + "desc": "Emojis", + "noremap": true, + "lhs": "ie", + "mode": "n", + "rhs": "Telescope symbols" + }, + { + "desc": "Date", + "noremap": true, + "lhs": "id", + "mode": "n", + "rhs": "put =strftime('## %a, %d %b, %Y, %r')" + }, + { + "desc": "Absolute Path", + "noremap": true, + "lhs": "iP", + "mode": "n", + "rhs": "put %:p" + }, + { + "desc": "New File", + "noremap": true, + "lhs": "en", + "mode": "n", + "rhs": "enew" + }, + { + "desc": " Buffer Local Keymaps (which-key)", + "noremap": true, + "lhs": "?", + "mode": "n", + "rhs": "" + }, + { + "desc": "Reload Configs", + "noremap": true, + "lhs": "cR", + "mode": "n", + "rhs": "ReloadConfig" + }, + { + "desc": "Root Directory", + "noremap": true, + "lhs": "cd", + "mode": "n", + "rhs": "RootDir" + }, + { + "desc": "Clean Empty Lines", + "noremap": true, + "lhs": "cl", + "mode": "n", + "rhs": ":g/^\\s*$/d" + }, + { + "desc": "Alpha", + "noremap": true, + "lhs": "co", + "mode": "n", + "rhs": "Alpha" + }, + { + "desc": "Sort Case Insensitive", + "noremap": true, + "lhs": "ci", + "mode": "v", + "rhs": ":sort i" + }, + { + "desc": "Sort Asc", + "noremap": true, + "lhs": "cs", + "mode": "v", + "rhs": ":sort" + }, + { + "desc": "Unique", + "noremap": true, + "lhs": "cu", + "mode": "v", + "rhs": ":!uniq" + }, + { + "desc": "Close Tab", + "noremap": true, + "lhs": "sc", + "mode": "n", + "rhs": "tabclose" + }, + { + "desc": "Horizontal Split", + "noremap": true, + "lhs": "sa", + "mode": "n", + "rhs": "split" + }, + { + "desc": "Previous Window", + "noremap": true, + "lhs": "s`", + "mode": "n", + "rhs": "p" + }, + { + "desc": "Decrease window height", + "noremap": true, + "lhs": "s_", + "mode": "n", + "rhs": "resize -10" + }, + { + "desc": "Split Right", + "noremap": true, + "lhs": "s\\", + "mode": "n", + "rhs": "v" + }, + { + "desc": "Increase window width", + "noremap": true, + "lhs": "sL", + "mode": "n", + "rhs": "vertical resize +10" + }, + { + "desc": "Increase window height", + "noremap": true, + "lhs": "sK", + "mode": "n", + "rhs": "resize +5" + }, + { + "desc": "Decrease window height", + "noremap": true, + "lhs": "sJ", + "mode": "n", + "rhs": "resize -5" + }, + { + "desc": "Decrease window width", + "noremap": true, + "lhs": "sH", + "mode": "n", + "rhs": "vertical resize -10" + }, + { + "desc": "Increase window width", + "noremap": true, + "lhs": "s=", + "mode": "n", + "rhs": "vertical resize +20" + }, + { + "desc": "Split Below", + "noremap": true, + "lhs": "s/", + "mode": "n", + "rhs": "s" + }, + { + "desc": "Decrease window width", + "noremap": true, + "lhs": "s-", + "mode": "n", + "rhs": "vertical resize -20" + }, + { + "desc": "Increase window height", + "noremap": true, + "lhs": "s+", + "mode": "n", + "rhs": "resize +10" + }, + { + "desc": "Readme", + "noremap": true, + "lhs": "em", + "mode": "n", + "rhs": "e README.md" + }, + { + "desc": "Config Dir", + "noremap": true, + "lhs": "ed", + "mode": "n", + "rhs": "lua require(\"telescope.builtin\").find_files({cwd = vim.fn.stdpath(\"config\")})" + }, + { + "desc": "Config", + "noremap": true, + "lhs": "ec", + "mode": "n", + "rhs": "e $MYVIMRC" + }, + { + "desc": "Alternate File", + "noremap": true, + "lhs": "ea", + "mode": "n", + "rhs": "b#" + }, + { + "desc": "Write and Quit", + "noremap": true, + "lhs": "qw", + "mode": "n", + "rhs": "wq" + }, + { + "desc": "Close Split", + "noremap": true, + "lhs": "qs", + "mode": "n", + "rhs": "c" + }, + { + "desc": "Quit", + "noremap": true, + "lhs": "qq", + "mode": "n", + "rhs": "q" + }, + { + "desc": "Close Others", + "noremap": true, + "lhs": "qo", + "mode": "n", + "rhs": ":%bdelete|b#|bdelete#" + }, + { + "desc": "Force Quit", + "noremap": true, + "lhs": "qf", + "mode": "n", + "rhs": "qall!" + }, + { + "desc": "Delete Buffer", + "noremap": true, + "lhs": "qd", + "mode": "n", + "rhs": "bdelete" + }, + { + "desc": "Close Buffer", + "noremap": true, + "lhs": "qc", + "mode": "n", + "rhs": "bw" + }, + { + "desc": "Quit All", + "noremap": true, + "lhs": "qa", + "mode": "n", + "rhs": "qall" + }, + { + "desc": " Save and Quit", + "noremap": true, + "lhs": "x", + "mode": "n", + "rhs": "x" + }, + { + "desc": "Write and Quit", + "noremap": true, + "lhs": "ww", + "mode": "n", + "rhs": "w" + }, + { + "desc": "Suggestions", + "noremap": true, + "lhs": "ws", + "mode": "n", + "rhs": "Telescope spell_suggest" + }, + { + "desc": "Write and Quit", + "noremap": true, + "lhs": "wq", + "mode": "n", + "rhs": "wq" + }, + { + "desc": "Prev Misspell", + "noremap": true, + "lhs": "wk", + "mode": "n", + "rhs": "[s" + }, + { + "desc": "Next Misspell", + "noremap": true, + "lhs": "wj", + "mode": "n", + "rhs": "]s" + }, + { + "desc": "Force Write", + "noremap": true, + "lhs": "wf", + "mode": "n", + "rhs": "lua require'utils'.sudo_write()" + }, + { + "desc": "Spellcheck", + "noremap": true, + "lhs": "wc", + "mode": "n", + "rhs": "set spell!" + }, + { + "desc": "Quote", + "noremap": true, + "lhs": "vq", + "mode": "n", + "rhs": "viq" + }, + { + "desc": "Paragraph", + "noremap": true, + "lhs": "vp", + "mode": "n", + "rhs": "vip" + }, + { + "desc": "Bracket", + "noremap": true, + "lhs": "vb", + "mode": "n", + "rhs": "vib" + }, + { + "desc": "Around Quote", + "noremap": true, + "lhs": "vQ", + "mode": "n", + "rhs": "vaq" + }, + { + "desc": "Around Para", + "noremap": true, + "lhs": "vP", + "mode": "n", + "rhs": "vap" + }, + { + "desc": "Around Bracket", + "noremap": true, + "lhs": "vB", + "mode": "n", + "rhs": "vab" + }, + { + "desc": "Vertical Split", + "noremap": true, + "lhs": "ss", + "mode": "n", + "rhs": "vsplit" + }, + { + "desc": "Close Split", + "noremap": true, + "lhs": "sq", + "mode": "n", + "rhs": "c" + }, + { + "desc": "Previous Pane", + "noremap": true, + "lhs": "sp", + "mode": "n", + "rhs": "NavigatorPrevious" + }, + { + "desc": "Move Right", + "noremap": true, + "lhs": "sl", + "mode": "n", + "rhs": "l" + }, + { + "desc": "Move Up", + "noremap": true, + "lhs": "sk", + "mode": "n", + "rhs": "k" + }, + { + "desc": "Move Down", + "noremap": true, + "lhs": "sj", + "mode": "n", + "rhs": "j" + }, + { + "desc": "Move Left", + "noremap": true, + "lhs": "sh", + "mode": "n", + "rhs": "h" + }, + { + "desc": "First Tab", + "noremap": true, + "lhs": "sf", + "mode": "n", + "rhs": "tabfirst" + }, + { + "desc": "Dismiss All Notifications", + "noremap": true, + "lhs": "mn", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Hardtime", + "noremap": true, + "lhs": "ch", + "mode": "n", + "rhs": "HardtimeToggle" + }, + { + "desc": "Don't Save Current Session", + "noremap": true, + "lhs": "md", + "mode": "n", + "rhs": "" + }, + { + "desc": "Restore Last Session", + "noremap": true, + "lhs": "ml", + "mode": "n", + "rhs": "" + }, + { + "desc": "Restore Session", + "noremap": true, + "lhs": "ms", + "mode": "n", + "rhs": "" + }, + { + "desc": "Marked", + "noremap": true, + "lhs": "Cm", + "mode": "n", + "rhs": "" + }, + { + "desc": "Line", + "noremap": true, + "lhs": "Cl", + "mode": "n", + "rhs": "" + }, + { + "desc": "Tiled line", + "noremap": true, + "lhs": "Ct", + "mode": "v", + "rhs": "" + }, + { + "desc": "Tiled line", + "noremap": true, + "lhs": "Ct", + "mode": "n", + "rhs": "" + }, + { + "desc": "Comment Box", + "noremap": true, + "lhs": "Cb", + "mode": "v", + "rhs": "" + }, + { + "desc": "Comment Box", + "noremap": true, + "lhs": "Cb", + "mode": "n", + "rhs": "" + }, + { + "desc": "Delete Comment Style", + "noremap": true, + "lhs": "Cd", + "mode": "v", + "rhs": "" + }, + { + "desc": "Delete Comment Style", + "noremap": true, + "lhs": "Cd", + "mode": "n", + "rhs": "" + }, + { + "desc": "Catalog", + "noremap": true, + "lhs": "Cc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Marked", + "noremap": true, + "lhs": "Cm", + "mode": "v", + "rhs": "" + }, + { + "desc": "Diagnostics", + "noremap": true, + "lhs": "fd", + "mode": "n", + "rhs": "" + }, + { + "desc": "Search History", + "noremap": true, + "lhs": "ks", + "mode": "n", + "rhs": "" + }, + { + "desc": "Command History", + "noremap": true, + "lhs": "kh", + "mode": "n", + "rhs": "" + }, + { + "desc": "Commands", + "noremap": true, + "lhs": "kc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Keymaps", + "noremap": true, + "lhs": "kk", + "mode": "n", + "rhs": "" + }, + { + "desc": "Grep String", + "noremap": true, + "lhs": "fG", + "mode": "n", + "rhs": "" + }, + { + "desc": "Find Highlight Groups", + "noremap": true, + "lhs": "fH", + "mode": "n", + "rhs": "" + }, + { + "desc": "Marks", + "noremap": true, + "lhs": "fm", + "mode": "n", + "rhs": "" + }, + { + "desc": "Old Recent Files", + "noremap": true, + "lhs": "fo", + "mode": "n", + "rhs": "" + }, + { + "desc": "Find Help", + "noremap": true, + "lhs": "fh", + "mode": "n", + "rhs": "" + }, + { + "desc": "Buffers", + "noremap": true, + "lhs": "fb", + "mode": "n", + "rhs": "" + }, + { + "desc": "Live Grep", + "noremap": true, + "lhs": "fg", + "mode": "n", + "rhs": "" + }, + { + "desc": "Find Files (CWD)", + "noremap": true, + "lhs": "ff", + "mode": "n", + "rhs": "" + }, + { + "desc": "File Browser", + "noremap": true, + "lhs": "ef", + "mode": "n", + "rhs": "" + }, + { + "desc": "Fuzzy Find in File", + "noremap": true, + "lhs": "fs", + "mode": "n", + "rhs": "" + }, + { + "desc": "Quickfix", + "noremap": true, + "lhs": "fq", + "mode": "n", + "rhs": "" + }, + { + "desc": "Undo History", + "noremap": true, + "lhs": "fu", + "mode": "n", + "rhs": "" + }, + { + "desc": "Notifications", + "noremap": true, + "lhs": "cn", + "mode": "n", + "rhs": "" + }, + { + "desc": "Run Current Test", + "noremap": true, + "lhs": "uc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Output Panel", + "noremap": true, + "lhs": "uO", + "mode": "n", + "rhs": "" + }, + { + "desc": "Stop", + "noremap": true, + "lhs": "us", + "mode": "n", + "rhs": "" + }, + { + "desc": "Run Nearest Test", + "noremap": true, + "lhs": "ur", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Summary", + "noremap": true, + "lhs": "uS", + "mode": "n", + "rhs": "" + }, + { + "desc": "Show Output", + "noremap": true, + "lhs": "uo", + "mode": "n", + "rhs": "" + }, + { + "desc": "Run Test File", + "noremap": true, + "lhs": "uf", + "mode": "n", + "rhs": "" + }, + { + "desc": "toggle markdown preview", + "noremap": true, + "lhs": "cm", + "mode": "n", + "rhs": "" + }, + { + "desc": "DB Last query", + "noremap": true, + "lhs": "dl", + "mode": "n", + "rhs": "" + }, + { + "desc": "DB Rename buffer", + "noremap": true, + "lhs": "dr", + "mode": "n", + "rhs": "" + }, + { + "desc": "DB Find buffer", + "noremap": true, + "lhs": "db", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle DB UI", + "noremap": true, + "lhs": "du", + "mode": "n", + "rhs": "" + }, + { + "desc": "Reload Module", + "noremap": true, + "lhs": "cr", + "mode": "n", + "rhs": "" + }, + { + "desc": "Vertical Terminal", + "noremap": true, + "lhs": "tv", + "mode": "n", + "rhs": "" + }, + { + "desc": "Horizontal Terminal", + "noremap": true, + "lhs": "th", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Terminal", + "noremap": true, + "lhs": "t1", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Terminal", + "noremap": true, + "lhs": "t2", + "mode": "n", + "rhs": "" + }, + { + "desc": "toggle barbecue", + "noremap": true, + "lhs": "bq", + "mode": "n", + "rhs": "" + }, + { + "desc": "Find Notes", + "noremap": true, + "lhs": "ng", + "mode": "n", + "rhs": "" + }, + { + "desc": "All Notes", + "noremap": true, + "lhs": "nf", + "mode": "n", + "rhs": "" + }, + { + "desc": "Today's Entry", + "noremap": true, + "lhs": "ne", + "mode": "n", + "rhs": "" + }, + { + "desc": "Today's Todo", + "noremap": true, + "lhs": "nd", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle Todo", + "noremap": true, + "lhs": "nx", + "mode": "n", + "rhs": "" + }, + { + "desc": "Incomplete Todos", + "noremap": true, + "lhs": "nt", + "mode": "n", + "rhs": "" + }, + { + "desc": "New Note", + "noremap": true, + "lhs": "nn", + "mode": "n", + "rhs": "" + }, + { + "desc": "Tomorrow's Todo", + "noremap": true, + "lhs": "nl", + "mode": "n", + "rhs": "" + }, + { + "desc": "Yesterday's Todo", + "noremap": true, + "lhs": "nh", + "mode": "n", + "rhs": "" + }, + { + "desc": "Location List (Trouble)", + "noremap": true, + "lhs": "xL", + "mode": "n", + "rhs": "" + }, + { + "desc": "LSP references/definitions/... (Trouble)", + "noremap": true, + "lhs": "xS", + "mode": "n", + "rhs": "" + }, + { + "desc": "Symbols (Trouble)", + "noremap": true, + "lhs": "xs", + "mode": "n", + "rhs": "" + }, + { + "desc": "Buffer Diagnostics (Trouble)", + "noremap": true, + "lhs": "xX", + "mode": "n", + "rhs": "" + }, + { + "desc": "Diagnostics (Trouble)", + "noremap": true, + "lhs": "xx", + "mode": "n", + "rhs": "" + }, + { + "desc": "Quickfix List (Trouble)", + "noremap": true, + "lhs": "xQ", + "mode": "n", + "rhs": "" + }, + { + "desc": "Breakpoint", + "noremap": true, + "lhs": "bb", + "mode": "n", + "rhs": "" + }, + { + "desc": "Restart Frame", + "noremap": true, + "lhs": "bR", + "mode": "n", + "rhs": "" + }, + { + "desc": "Out", + "noremap": true, + "lhs": "bO", + "mode": "n", + "rhs": "" + }, + { + "desc": "Exit", + "noremap": true, + "lhs": "bx", + "mode": "n", + "rhs": "" + }, + { + "desc": "Debugger", + "noremap": true, + "lhs": "bt", + "mode": "n", + "rhs": "" + }, + { + "desc": "Repl", + "noremap": true, + "lhs": "br", + "mode": "n", + "rhs": "" + }, + { + "desc": "Over", + "noremap": true, + "lhs": "bo", + "mode": "n", + "rhs": "" + }, + { + "desc": "Last", + "noremap": true, + "lhs": "bl", + "mode": "n", + "rhs": "" + }, + { + "desc": "Into", + "noremap": true, + "lhs": "bi", + "mode": "n", + "rhs": "" + }, + { + "desc": "Continue", + "noremap": true, + "lhs": "bc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Relative Path", + "noremap": true, + "lhs": "yp", + "mode": "n", + "rhs": "" + }, + { + "desc": "Copy Git URL", + "noremap": true, + "lhs": "yg", + "mode": "n", + "rhs": "" + }, + { + "desc": "File Name", + "noremap": true, + "lhs": "yf", + "mode": "n", + "rhs": "" + }, + { + "desc": "Copy Whole File", + "noremap": true, + "lhs": "ya", + "mode": "n", + "rhs": "" + }, + { + "desc": "Absolute Path", + "noremap": true, + "lhs": "yP", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle zen mode", + "noremap": true, + "lhs": "wz", + "mode": "n", + "rhs": "" + }, + { + "desc": "Maximize/minimize a split", + "noremap": true, + "lhs": "mm", + "mode": "n", + "rhs": "" + }, + { + "desc": "Replace in Files (Spectre)", + "noremap": true, + "lhs": "mr", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle keys", + "noremap": true, + "lhs": "kt", + "mode": "n", + "rhs": "Screenkey" + }, + { + "desc": " Insert Macro Breakpoint.", + "noremap": true, + "lhs": "##", + "mode": "n", + "rhs": "" + }, + { + "desc": ":help v_#-default", + "noremap": true, + "lhs": "#", + "mode": "x", + "rhs": "" + }, + { + "desc": ":help &-default", + "noremap": true, + "lhs": "&", + "mode": "n", + "rhs": ":&&" + }, + { + "desc": ":help v_star-default", + "noremap": true, + "lhs": "*", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": ",", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": ",", + "mode": "n", + "rhs": "" + }, + { "desc": "", "noremap": true, "lhs": "-", "mode": "x", "rhs": "" }, + { + "desc": "", + "noremap": true, + "lhs": "-", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": ";", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": ";", + "mode": "n", + "rhs": "" + }, + { "desc": "", "noremap": true, "lhs": "<", "mode": "v", "rhs": "gv" }, + { "desc": "", "noremap": true, "lhs": "=", "mode": "x", "rhs": "" }, + { "desc": "", "noremap": true, "lhs": "=", "mode": "n", "rhs": "" }, + { "desc": "", "noremap": true, "lhs": ">", "mode": "v", "rhs": ">gv" }, + { + "desc": ":help v_@-default", + "noremap": true, + "lhs": "@", + "mode": "x", + "rhs": "mode() ==# 'V' ? ':normal! @'.getcharstr().'' : '@'" + }, + { + "desc": "", + "noremap": true, + "lhs": "F", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "F", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "J", + "mode": "x", + "rhs": ":move '>+1gv-gv" + }, + { "desc": "", "noremap": true, "lhs": "J", "mode": "n", "rhs": "mzJ`z" }, + { + "desc": "LSP Hover", + "noremap": true, + "lhs": "K", + "mode": "n", + "rhs": "Lspsaga hover_doc" + }, + { + "desc": "", + "noremap": true, + "lhs": "K", + "mode": "x", + "rhs": ":move '-2gv-gv" + }, + { + "desc": "Prev search result", + "noremap": true, + "lhs": "N", + "mode": "x", + "rhs": "'nN'[v:searchforward]" + }, + { + "desc": "Prev search result", + "noremap": true, + "lhs": "N", + "mode": "n", + "rhs": "'nN'[v:searchforward]" + }, + { + "desc": "Put yanked text before cursor", + "noremap": true, + "lhs": "P", + "mode": "n", + "rhs": "" + }, + { + "desc": "Put yanked text before cursor", + "noremap": true, + "lhs": "P", + "mode": "x", + "rhs": "" + }, + { + "desc": " Play Macro", + "noremap": true, + "lhs": "Q", + "mode": "n", + "rhs": "" + }, + { + "desc": ":help v_Q-default", + "noremap": true, + "lhs": "Q", + "mode": "x", + "rhs": "mode() ==# 'V' ? ':normal! @=reg_recorded()' : 'Q'" + }, + { + "desc": "", + "noremap": true, + "lhs": "T", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "T", + "mode": "n", + "rhs": "" + }, + { + "desc": "Redo", + "noremap": true, + "lhs": "U", + "mode": "n", + "rhs": "redo" + }, + { + "desc": ":help Y-default", + "noremap": true, + "lhs": "Y", + "mode": "n", + "rhs": "y$" + }, + { + "desc": "First Buffer", + "noremap": true, + "lhs": "[B", + "mode": "n", + "rhs": "bfirst" + }, + { + "desc": "Buffer", + "noremap": true, + "lhs": "[b", + "mode": "n", + "rhs": "bprevious" + }, + { + "desc": "Diagnostic", + "noremap": true, + "lhs": "[d", + "mode": "n", + "rhs": "Lspsaga diagnostic_jump_prev" + }, + { "desc": "Edit", "noremap": true, "lhs": "[e", "mode": "n", "rhs": "g;" }, + { + "desc": "Jump", + "noremap": true, + "lhs": "[j", + "mode": "n", + "rhs": "" + }, + { + "desc": "Previous Trouble/Quickfix Item", + "noremap": true, + "lhs": "[q", + "mode": "n", + "rhs": "" + }, + { + "desc": "Buffer", + "noremap": true, + "lhs": "]B", + "mode": "n", + "rhs": "blast" + }, + { + "desc": "Buffer", + "noremap": true, + "lhs": "]b", + "mode": "n", + "rhs": "bnext" + }, + { + "desc": "Diagnostic", + "noremap": true, + "lhs": "]d", + "mode": "n", + "rhs": "Lspsaga diagnostic_jump_next" + }, + { "desc": "Edit", "noremap": true, "lhs": "]e", "mode": "n", "rhs": "g," }, + { + "desc": "Jump", + "noremap": true, + "lhs": "]j", + "mode": "n", + "rhs": "" + }, + { + "desc": "Next Trouble/Quickfix Item", + "noremap": true, + "lhs": "]q", + "mode": "n", + "rhs": "" + }, + { + "desc": " Edit Macro", + "noremap": true, + "lhs": "cq", + "mode": "n", + "rhs": "" + }, + { + "desc": " Delete All Macros", + "noremap": true, + "lhs": "dq", + "mode": "n", + "rhs": "" + }, + { + "desc": "Don't Yank Empty Line to Clipboard", + "noremap": true, + "lhs": "dd", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "f", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "f", + "mode": "n", + "rhs": "" + }, + { + "desc": "Put yanked text after selection", + "noremap": true, + "lhs": "gp", + "mode": "n", + "rhs": "" + }, + { + "desc": "Put yanked text before selection", + "noremap": true, + "lhs": "gP", + "mode": "n", + "rhs": "" + }, + { + "desc": "Put yanked text before selection", + "noremap": true, + "lhs": "gP", + "mode": "x", + "rhs": "" + }, + { + "desc": "Put yanked text after selection", + "noremap": true, + "lhs": "gp", + "mode": "x", + "rhs": "" + }, + { + "desc": "Beginning of line", + "noremap": true, + "lhs": "gh", + "mode": "x", + "rhs": "^" + }, + { + "desc": "Beginning of line", + "noremap": true, + "lhs": "gh", + "mode": "n", + "rhs": "^" + }, + { + "desc": "End of line", + "noremap": true, + "lhs": "gl", + "mode": "x", + "rhs": "$" + }, + { + "desc": "End of line", + "noremap": true, + "lhs": "gl", + "mode": "n", + "rhs": "$" + }, + { + "desc": "Toggle comment line", + "noremap": true, + "lhs": "gcc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Toggle comment", + "noremap": true, + "lhs": "gc", + "mode": "x", + "rhs": "" + }, + { + "desc": "Toggle comment", + "noremap": true, + "lhs": "gc", + "mode": "n", + "rhs": "" + }, + { + "desc": "Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)", + "noremap": true, + "lhs": "gx", + "mode": "x", + "rhs": "" + }, + { + "desc": "Opens filepath or URI under cursor with the system handler (file explorer, web browser, …)", + "noremap": true, + "lhs": "gx", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "j", + "mode": "n", + "rhs": "v:count == 0 ? 'gj' : 'j'" + }, + { + "desc": "", + "noremap": true, + "lhs": "k", + "mode": "n", + "rhs": "v:count == 0 ? 'gk' : 'k'" + }, + { + "desc": "Next search result", + "noremap": true, + "lhs": "n", + "mode": "x", + "rhs": "'Nn'[v:searchforward]" + }, + { + "desc": "Next search result", + "noremap": true, + "lhs": "n", + "mode": "n", + "rhs": "'Nn'[v:searchforward]" + }, + { + "desc": "Put yanked text after cursor", + "noremap": true, + "lhs": "p", + "mode": "n", + "rhs": "" + }, + { + "desc": "Put yanked text after cursor", + "noremap": true, + "lhs": "p", + "mode": "x", + "rhs": "" + }, + { + "desc": " Start/Stop Recording", + "noremap": true, + "lhs": "q", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "t", + "mode": "x", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "t", + "mode": "n", + "rhs": "" + }, + { "desc": "", "noremap": true, "lhs": "x", "mode": "x", "rhs": "\"_x" }, + { + "desc": " Yank Macro", + "noremap": true, + "lhs": "yq", + "mode": "n", + "rhs": "" + }, + { + "desc": "Yank text", + "noremap": true, + "lhs": "y", + "mode": "n", + "rhs": "" + }, + { + "desc": "Yank text", + "noremap": true, + "lhs": "y", + "mode": "x", + "rhs": "" + }, + { + "desc": " Switch Macro Slot", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "Previous Buffer", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "bprevious" + }, + { + "desc": "Find browser", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "Telescope file_browser" + }, + { + "desc": "Find Files", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "Telescope find_files" + }, + { + "desc": "Increase window height", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "resize +10" + }, + { + "desc": "Increase window width", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "vertical resize +10" + }, + { + "desc": "Decrease window width", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "vertical resize -10" + }, + { + "desc": "Decrease window height", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "resize -10" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "zz" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "zz" + }, + { "desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "ggVG" }, + { + "desc": "Show diagnostics under the cursor", + "noremap": false, + "lhs": "", + "mode": "n", + "rhs": "d" + }, + { + "desc": "Show diagnostics under the cursor", + "noremap": true, + "lhs": "d", + "mode": "n", + "rhs": "" + }, + { + "desc": "", + "noremap": true, + "lhs": "", + "mode": "n", + "rhs": "" + } + ], + "treesitterParsers": [ + "bash", + "c", + "cpp", + "css", + "html", + "java", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "scss", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc" + ], + "lspServers": [ + "bashls", + "clangd", + "cssls", + "html", + "lua_ls", + "pyright", + "svelte", + "tailwindcss", + "tsserver" + ], + "leaderKey": "" +} diff --git a/init.lua b/init.lua index 8f59cb0..ee117dc 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ -require('config.keymaps') -require('config.options') -require('config.lazy') -require('config.autocmd') +require('core.keymaps') +require('core.options') +require('core.functions') +require('core.lazy') +require('core.autocmd') diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua deleted file mode 100644 index 17d4077..0000000 --- a/lua/config/keymaps.lua +++ /dev/null @@ -1,110 +0,0 @@ --- Increment / Decrement -vim.keymap.set('n', '+', '') -vim.keymap.set('n', '-', '') - --- Select all -vim.keymap.set('n', '', 'ggG') - --- Replace currently selected text with default register without yanking it -vim.keymap.set('x', 'p', '"_dP') - --- Delete and change without yanking -vim.keymap.set({ 'n', 'x' }, '', '"_d', { desc = 'Delete Without Yanking' }) -vim.keymap.set({ 'n', 'x' }, '', '"_c', { desc = 'Change Without Yanking' }) - --- Deleting without yanking empty line -vim.keymap.set('n', 'dd', function() - local is_empty_line = vim.api.nvim_get_current_line():match('^%s*$') - if is_empty_line then - return '"_dd' - else - return 'dd' - end -end, { noremap = true, expr = true, desc = "Don't Yank Empty Line to Clipboard" }) - --- Search inside visually highlighted text -vim.keymap.set('x', 'g/', '/\\%V', { silent = false, desc = 'Search Inside Visual Selection' }) - --- Search visually selected text (slightly better than builtins in Neovim>=0.8) -vim.keymap.set('x', '*', [[y/\V=escape(@", '/\')]], { desc = 'Search Selected Text', silent = true }) -vim.keymap.set( - 'x', - '#', - [[y?\V=escape(@", '?\')]], - { desc = 'Search Selected Text (Backwards)', silent = true } -) - --- save file -vim.keymap.set('n', 'w', ':w', { desc = 'Save file' }) - --- save and quit -vim.keymap.set('n', 'Q', 'wq!', { desc = 'Force save and quit' }) - --- Clear highlights on search when pressing in normal mode -vim.keymap.set('n', '', 'nohlsearch') - --- Visual vim.keymap.sets -vim.keymap.set('v', 'r', '"hy:%s/h//g') -- Replace all instances of highlighted words -vim.keymap.set('v', '', ':sort') -- Sort highlighted text in visual mode with Control+S -vim.keymap.set('v', 'K', ":m '>-2gv=gv") -- Move current line up -vim.keymap.set('v', 'J', ":m '>+1gv=gv") -- Move current line down - --- for buffers -vim.api.nvim_set_keymap('n', '', ':bnext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':bprev', { noremap = true, silent = true }) - ---utility vim.keymap.setpings -vim.keymap.set('n', 'n', 'nzzzv') -- keep the cursor centered when doing 'n' -vim.keymap.set('n', 'N', 'Nzzzv') -- keep the cursor centered when doing 'N' -vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Join line without moving the cursor' }) -vim.keymap.set('n', 'cn', '*``cgn', { desc = 'Change next match by pressing dot (.)' }) -vim.keymap.set('n', 'cN', '*``cgN', { desc = 'Change previous match by pressing dot (.)' }) -vim.keymap.set('n', 'vp', '`[v`]', { desc = 'Select pasted text' }) -vim.keymap.set('n', '', 'zz', { desc = 'Scroll down' }) -vim.keymap.set('n', '', 'zz', { desc = 'Scroll up' }) - -vim.keymap.set({ 'n', 'v' }, 'y', '"+y', { desc = 'Copy to system clipboard' }) -vim.keymap.set({ 'n', 'v' }, 'p', '"+p', { desc = 'Paste from system clipboard' }) - -vim.keymap.set({ 'i' }, '', '', { desc = 'Move cursor to right' }) -vim.keymap.set({ 'i' }, '', '', { desc = 'Move cursor to right' }) - --- Better window management -vim.keymap.set('n', 'vs', ':vsp', { noremap = true, silent = true }) -vim.keymap.set('n', 'hs', ':sp', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'h', { desc = 'Move to left split' }) -vim.keymap.set('n', '', 'j', { desc = 'Move to below split' }) -vim.keymap.set('n', '', 'k', { desc = 'Move to above split' }) -vim.keymap.set('n', '', 'l', { desc = 'Move to right split' }) -vim.keymap.set('n', '', 'resize -2', { desc = 'Resize split up' }) -vim.keymap.set('n', '', 'resize +2', { desc = 'Resize split down' }) -vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Resize split left' }) -vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Resize split right' }) - --- Stay in indent mode -vim.keymap.set('v', '<', '', '>gv', { desc = '(V) Indent to right' }) - -vim.keymap.set('n', 'lo', 'lopen', { desc = 'Open location list' }) -vim.keymap.set('n', 'lc', 'lclose', { desc = 'Close location list' }) -vim.keymap.set('n', 'ln', 'lnext', { desc = 'Next location list item' }) -vim.keymap.set('n', 'lp', 'lprev', { desc = 'Previous location list item' }) - --- insert semicolon in the end -vim.keymap.set('i', '', 'miA;`ii', { desc = 'insert semicolon in the end' }) - --- Change text without putting it into the vim register, -vim.keymap.set({ 'n', 'x' }, 'c', '"_c', { desc = 'Change without yanking' }) -vim.keymap.set({ 'n', 'x' }, 'C', '"_C', { desc = 'Change without yanking' }) -vim.keymap.set({ 'n', 'x' }, 'cc', '"_cc', { desc = 'Change without yanking' }) -vim.keymap.set({ 'n', 'x' }, 'x', '"_x', { desc = 'delete without yanking' }) - --- Better escape using jk in insert and terminal mode -vim.keymap.set('i', 'jk', '') -vim.keymap.set('i', 'kj', '') -vim.keymap.set('i', 'jj', '') - --- Terminal Mappings -vim.keymap.set('t', 'jk', '') -vim.keymap.set('t', 'kj', '') -vim.keymap.set('t', '', '') diff --git a/lua/plugins/alpha.lua b/lua/configs/alpha.lua similarity index 64% rename from lua/plugins/alpha.lua rename to lua/configs/alpha.lua index af7e71e..8172ed1 100644 --- a/lua/plugins/alpha.lua +++ b/lua/configs/alpha.lua @@ -45,39 +45,32 @@ local function footer() line3, } end +local alpha = require('alpha') +local dashboard = require('alpha.themes.dashboard') -return { - 'goolord/alpha-nvim', - event = 'VimEnter', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - local alpha = require('alpha') - local dashboard = require('alpha.themes.dashboard') +dashboard.section.header.val = header() +dashboard.section.footer.val = footer() - dashboard.section.header.val = header() - dashboard.section.footer.val = footer() - - -- Menu - -- TODO: Add projects and Frecency? - dashboard.section.buttons.val = { - dashboard.button('e', ' New file', ':ene startinsert'), - dashboard.button('f', ' Find files', 'Telescope find_files'), - dashboard.button('t', '󰊄 Find text', 'Telescope live_grep'), - dashboard.button('r', '󰔠 Recent files', 'Telescope oldfiles'), - dashboard.button('p', '󱠏 Projects', 'Telescope projects'), - dashboard.button('c', ' Config', 'e $MYVIMRC'), - dashboard.button('l', ' Plugins', 'Lazy'), - dashboard.button('q', ' Quit', 'qa'), - } - - alpha.setup(dashboard.config) - -- Update the footer after all plugins are fully loaded - vim.api.nvim_create_autocmd('User', { - pattern = 'LazyVimStarted', - callback = function() - dashboard.section.footer.val = footer() - pcall(vim.cmd, 'AlphaRedraw') - end, - }) - end, +-- Menu +-- TODO: Add projects and Frecency? +dashboard.section.buttons.val = { + dashboard.button('e', ' New file', ':ene startinsert'), + dashboard.button('f', ' Find files', 'Telescope find_files'), + dashboard.button('t', '󰊄 Find text', 'Telescope live_grep'), + dashboard.button('F', ' File browser', 'Telescope file_browser'), + dashboard.button('r', '󰔠 Recent files', 'Telescope oldfiles'), + dashboard.button('s', ' Open last session', ':lua require("persistence").load({ last = true })'), + dashboard.button('c', ' Config', 'e $MYVIMRC'), + dashboard.button('l', ' Plugins', 'Lazy'), + dashboard.button('q', ' Quit', 'qa'), } + +alpha.setup(dashboard.config) +-- Update the footer after all plugins are fully loaded +vim.api.nvim_create_autocmd('User', { + pattern = 'LazyVimStarted', + callback = function() + dashboard.section.footer.val = footer() + pcall(vim.cmd, 'AlphaRedraw') + end, +}) diff --git a/lua/configs/cmp.lua b/lua/configs/cmp.lua new file mode 100644 index 0000000..5e5ceac --- /dev/null +++ b/lua/configs/cmp.lua @@ -0,0 +1,90 @@ +local cmp = require('cmp') +local luasnip = require('luasnip') +require('luasnip/loaders/from_vscode').lazy_load() + +cmp.setup({ + completion = { + keyword_length = 1, + completeopt = 'menu,menuone', + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + formatting = { + fields = { 'kind', 'abbr', 'menu' }, + format = function(entry, vim_item) + local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50 })(entry, vim_item) + local strings = vim.split(kind.kind, '%s', { trimempty = true }) + kind.kind = ' ' .. (strings[1] or '') .. ' ' + kind.menu = ' (' .. (strings[2] or '') .. ')' + + return kind + end, + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping(cmp.mapping.scroll_docs(-1), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.scroll_docs(1), { 'i', 'c' }), + [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.config.disable, + [''] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }, + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'cmdline' }, + }, + }), + cmp.setup.cmdline('/', { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' }, + }, + }), + -- sources for autocompletion + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- snippets + { name = 'buffer' }, -- text within current buffer + { name = 'path' }, -- file system paths + { name = 'codeium' }, -- AI for autocompletion + -- { name = "nvim_lsp_signature_help" }, + -- { name = "calc" }, --for maths calculations + }, +}) diff --git a/lua/configs/lsp.lua b/lua/configs/lsp.lua new file mode 100644 index 0000000..1feb91b --- /dev/null +++ b/lua/configs/lsp.lua @@ -0,0 +1,172 @@ +local lspconfig = require('lspconfig') +-- import cmp-nvim-lsp plugin +local cmp_nvim_lsp = require('cmp_nvim_lsp') + +local keymap = vim.keymap -- for conciseness + +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + + -- set keybinds + opts.desc = 'Show LSP references' + keymap.set('n', 'lR', 'Telescope lsp_references', opts) -- show definition, references + + opts.desc = 'Go to declaration' + keymap.set('n', 'lD', vim.lsp.buf.declaration, opts) -- go to declaration + + opts.desc = 'Show LSP definitions' + keymap.set('n', 'ld', 'Telescope lsp_definitions', opts) -- show lsp definitions + + opts.desc = 'Show LSP implementations' + keymap.set('n', 'li', 'Telescope lsp_implementations', opts) -- show lsp implementations + + opts.desc = 'Show LSP type definitions' + keymap.set('n', 'lt', 'Telescope lsp_type_definitions', opts) -- show lsp type definitions + + opts.desc = 'See available code actions' + keymap.set({ 'n', 'v' }, 'la', vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection + + opts.desc = 'Smart rename' + keymap.set('n', 'mr', vim.lsp.buf.rename, opts) -- smart rename + + opts.desc = 'Show buffer diagnostics' + keymap.set('n', 'lD', 'Telescope diagnostics bufnr=0', opts) -- show diagnostics for file + + opts.desc = 'Show line diagnostics' + keymap.set('n', 'ld', vim.diagnostic.open_float, opts) -- show diagnostics for line + + opts.desc = 'Show documentation for what is under cursor' + keymap.set('n', 'K', vim.lsp.buf.hover, opts) -- show documentation for what is under cursor + + opts.desc = 'Restart LSP' + keymap.set('n', 'ls', ':LspRestart', opts) -- mapping to restart lsp if necessary + end, +}) + +-- used to enable autocompletion (assign to every lsp server config) +local capabilities = cmp_nvim_lsp.default_capabilities() + +-- configure matlab server +lspconfig['clangd'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) +-- configure bash server +lspconfig['bashls'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) +-- configure html server +lspconfig['html'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) +-- configure typescript server with plugin +lspconfig['tsserver'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure css server +lspconfig['cssls'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure tailwindcss server +lspconfig['tailwindcss'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure svelte server +lspconfig['svelte'].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + on_attach(client, bufnr) + + vim.api.nvim_create_autocmd('BufWritePost', { + pattern = { '*.js', '*.ts' }, + callback = function(ctx) + if client.name == 'svelte' then + client.notify('$/onDidChangeTsOrJsFile', { uri = ctx.file }) + end + end, + }) + end, +}) + +-- configure prisma orm server +lspconfig['prismals'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure emmet language server +lspconfig['emmet_ls'].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { 'html', 'typescriptreact', 'javascriptreact', 'css', 'sass', 'scss', 'less', 'svelte' }, +}) + +-- configure python server +lspconfig['pyright'].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure lua server (with special settings) +lspconfig['lua_ls'].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { -- custom settings for lua + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { 'vim' }, + }, + workspace = { + -- make language server aware of runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.stdpath('config') .. '/lua'] = true, + }, + }, + }, + }, +}) + +local x = vim.diagnostic.severity +local config = { + -- Enable virtual text + virtual_text = { -- or false for disable + prefix = '', -- ■  󰊠 + suffix = '', + format = function(diagnostic) + local prefix = '󰊠 ' + local suffix = ' ' + -- return full message with custom prefix & suffix + return prefix .. diagnostic.message .. suffix + end, + }, + update_in_insert = true, + signs = { text = { [x.ERROR] = '', [x.WARN] = '', [x.HINT] = '󰌵', [x.INFO] = '' } }, + underline = false, + severity_sort = true, + float = { + focusable = false, + style = 'minimal', + border = 'rounded', + source = 'always', + header = '', + prefix = '', + }, +} + +vim.diagnostic.config(config) +-- add borders to lsp info window +require('lspconfig.ui.windows').default_options.border = 'single' diff --git a/lua/configs/lualine.lua b/lua/configs/lualine.lua new file mode 100644 index 0000000..44e0cba --- /dev/null +++ b/lua/configs/lualine.lua @@ -0,0 +1,198 @@ +local lualine = require('lualine') + +-- Color table for highlights + -- stylua: ignore + local colors = { + bg = 'none', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + +local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, +} + +-- Config +local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + disabled_filetypes = { + 'NeoTree', + 'NvimTree', + 'Outline', + 'alpha', + }, + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, +} + +-- Inserts a component in lualine_c at left section +local function ins_left(component) + table.insert(config.sections.lualine_c, component) +end + +-- Inserts a component in lualine_x at right section +local function ins_right(component) + table.insert(config.sections.lualine_x, component) +end + +ins_left({ + function() + return '▊' + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 0, right = 1 }, -- We don't need space before this +}) + +ins_left({ + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + ['␖'] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + ['␓'] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, +}) + +ins_left({ + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = 'bold' }, +}) + +ins_left({ + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + error = { fg = colors.red }, + warn = { fg = colors.yellow }, + info = { fg = colors.cyan }, + }, +}) + +-- Insert mid section. You can make any number of sections in neovim :) +-- for lualine it's any number greater then 2 +ins_left({ + function() + return '%=' + end, +}) + +ins_left({ + -- Lsp server name . + function() + local msg = 'No Active Lsp' + local clients = vim.lsp.get_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' LSP:', + color = { fg = '#ffffff', gui = 'bold' }, +}) + +ins_right({ + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = ' ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, +}) + +ins_right({ + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, +}) + +ins_right({ + function() + return '▊' + end, + color = { fg = colors.blue }, + padding = { left = 1 }, +}) + +-- Now don't forget to initialize lualine +lualine.setup(config) diff --git a/lua/configs/mason.lua b/lua/configs/mason.lua new file mode 100644 index 0000000..5a2e78a --- /dev/null +++ b/lua/configs/mason.lua @@ -0,0 +1,47 @@ +local mason = require('mason') +local mason_lspconfig = require('mason-lspconfig') +local mason_tool_installer = require('mason-tool-installer') + +-- enable mason and configure icons +mason.setup({ + ui = { + border = 'rounded', + icons = { + package_installed = '✓', + package_pending = '➜', + package_uninstalled = '✗', + }, + }, +}) + +mason_lspconfig.setup({ + -- list of servers for mason to install + ensure_installed = { + 'tsserver', + 'html', + 'cssls', + 'tailwindcss', + 'svelte', + 'lua_ls', + 'pyright', + 'jdtls', + 'bashls', + 'jsonls', + 'clangd', + 'emmet_ls', + 'prismals', + }, +}) + +mason_tool_installer.setup({ + ensure_installed = { + 'prettier', -- prettier formatter + 'biome', -- js formatter + 'stylua', -- lua formatter + 'black', -- python formatter + 'isort', -- python formatter + 'clang-format', -- c/c++ formatter + 'pylint', + 'eslint_d', + }, +}) diff --git a/lua/configs/none-ls.lua b/lua/configs/none-ls.lua new file mode 100644 index 0000000..ffff12a --- /dev/null +++ b/lua/configs/none-ls.lua @@ -0,0 +1,61 @@ +local mason_null_ls = require('mason-null-ls') + +local null_ls = require('null-ls') + +local null_ls_utils = require('null-ls.utils') + +mason_null_ls.setup({ + ensure_installed = { + 'prettier', -- prettier formatter + 'biome', -- js formatter + 'clang-format', -- c/c++ formatter + 'stylua', -- lua formatter + 'black', -- python formatter + 'pylint', -- python linter + -- "eslint_d", -- js linter + }, +}) + +-- for conciseness +local formatting = null_ls.builtins.formatting -- to setup formatters +local diagnostics = null_ls.builtins.diagnostics -- to setup linters + +-- to setup format on save +local augroup = vim.api.nvim_create_augroup('LspFormatting', {}) + +-- configure null_ls +null_ls.setup({ + root_dir = null_ls_utils.root_pattern('.null-ls-root', 'Makefile', '.git', 'package.json'), + sources = { + formatting.prettier, -- js/ts formatter + formatting.stylua, -- lua formatter + formatting.isort, + formatting.black, + formatting.clang_format, + diagnostics.pylint, + -- diagnostics.eslint_d.with({ -- js/ts linter + -- condition = function(utils) + -- return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs + -- end, + -- }), + }, + -- configure format on save + on_attach = function(current_client, bufnr) + if current_client.supports_method('textDocument/formatting') then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd('BufWritePre', { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ + filter = function(client) + -- only use null-ls for formatting instead of lsp server + return client.name == 'null-ls' + end, + bufnr = bufnr, + }) + end, + }) + end + end, +}) diff --git a/lua/configs/telescope.lua b/lua/configs/telescope.lua new file mode 100644 index 0000000..b794171 --- /dev/null +++ b/lua/configs/telescope.lua @@ -0,0 +1,68 @@ +local telescope = require('telescope') +local fb_actions = require('telescope').extensions.file_browser.actions +telescope.setup({ + file_ignore_patterns = { '%.git/.' }, + defaults = { + preview = { + treesitter = false, + }, + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = 'smart_case', -- or "ignore_case" or "respect_case" + }, + + file_browser = { + theme = 'ivy', + hijack_netrw = true, + mapping = { + ['i'] = { + [''] = fb_actions.create, + [''] = fb_actions.rename, + [''] = fb_actions.remove, + [''] = fb_actions.toggle_hidden, + }, + ['n'] = { + [''] = fb_actions.create, + [''] = require('telescope-undo.actions').yank_additions, + [''] = require('telescope-undo.actions').yank_deletions, + [''] = require('telescope-undo.actions').restore, + }, + }, + }, + }, + borderchars = { + prompt = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, + results = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, + }, +}) +telescope.load_extension('ui-select') +telescope.load_extension('file_browser') +-- telescope.load_extension("refactoring") +telescope.load_extension('notify') +telescope.load_extension('undo') diff --git a/lua/configs/toggleterm.lua b/lua/configs/toggleterm.lua new file mode 100644 index 0000000..a59a984 --- /dev/null +++ b/lua/configs/toggleterm.lua @@ -0,0 +1,23 @@ +require('toggleterm').setup({ + size = 10, + open_mapping = [[]], + hide_numbers = true, + shade_filetypes = {}, + shade_terminals = true, + shading_factor = '2', + start_in_insert = true, + insert_mappings = true, + terminal_mappings = true, + persist_size = true, + direction = 'float', -- Use 'float' for floating terminal windows + close_on_exit = true, + shell = vim.o.shell, + float_opts = { + border = 'curved', -- or 'single', 'double', 'shadow', etc. + winblend = 0, -- Set to 0 for full transparency + highlights = { + border = 'Normal', + background = 'Normal', + }, + }, +}) diff --git a/lua/config/autocmd.lua b/lua/core/autocmd.lua similarity index 59% rename from lua/config/autocmd.lua rename to lua/core/autocmd.lua index d968dae..523e42f 100644 --- a/lua/config/autocmd.lua +++ b/lua/core/autocmd.lua @@ -1,3 +1,7 @@ +local function augroup(name) + return vim.api.nvim_create_augroup('nvim2k_' .. name, { clear = true }) +end + -- don't auto comment new line vim.api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] }) @@ -22,6 +26,7 @@ vim.api.nvim_create_autocmd('UILeave', { -- Highlight on yank vim.api.nvim_create_autocmd('TextYankPost', { + group = augroup('highlight_yank'), callback = function() vim.highlight.on_yank() end, @@ -67,6 +72,67 @@ vim.api.nvim_create_autocmd( } ) +-- go to last loc when opening a buffer +vim.api.nvim_create_autocmd('BufReadPost', { + group = augroup('last_loc'), + callback = function() + local mark = vim.api.nvim_buf_get_mark(0, '"') + local lcount = vim.api.nvim_buf_line_count(0) + if mark[1] > 0 and mark[1] <= lcount then + pcall(vim.api.nvim_win_set_cursor, 0, mark) + end + end, +}) + +-- Strip trailing spaces before write +vim.api.nvim_create_autocmd({ 'BufWritePre' }, { + group = augroup('strip_space'), + pattern = { '*' }, + callback = function() + vim.cmd([[ %s/\s\+$//e ]]) + end, +}) + +-- Check if we need to reload the file when it changed +vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, { + group = augroup('checktime'), + command = 'checktime', +}) + +-- resize splits if window got resized +vim.api.nvim_create_autocmd({ 'VimResized' }, { + group = augroup('resize_splits'), + callback = function() + vim.cmd('tabdo wincmd =') + end, +}) + +-- wrap and check for spell in text filetypes +vim.api.nvim_create_autocmd('FileType', { + group = augroup('wrap_spell'), + pattern = { 'gitcommit', 'markdown' }, + callback = function() + vim.opt_local.wrap = true + vim.opt_local.spell = true + end, +}) + +-- Auto create dir when saving a file, in case some intermediate directory does not exist +vim.api.nvim_create_autocmd({ 'BufWritePre' }, { + group = augroup('auto_create_dir'), + callback = function(event) + local file = vim.loop.fs_realpath(event.match) or event.match + vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p') + end, +}) + +-- Set arb filetype +vim.api.nvim_create_autocmd({ 'BufEnter' }, { + group = augroup('set_file_type'), + pattern = { '*.arb' }, + command = require('core.util').get_file_type_cmd('arb'), +}) + -- close some filetypes with vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('close_with_q', { clear = true }), diff --git a/lua/core/functions.lua b/lua/core/functions.lua new file mode 100644 index 0000000..e49a9fd --- /dev/null +++ b/lua/core/functions.lua @@ -0,0 +1,39 @@ +-- Reload neovim config +vim.api.nvim_create_user_command('ReloadConfig', function() + for name, _ in pairs(package.loaded) do + if name:match('^plugins') then + package.loaded[name] = nil + end + end + + dofile(vim.env.MYVIMRC) + vim.notify('Nvim configuration reloaded!', vim.log.levels.INFO) +end, {}) + +vim.api.nvim_create_user_command('CopyRelativePath', function() + local path = vim.fn.expand('%') + vim.fn.setreg('+', path) + vim.notify('Copied "' .. path .. '" to the clipboard!') +end, {}) + +vim.api.nvim_create_user_command('CopyAbsolutePath', function() + local path = vim.fn.expand('%:p') + vim.fn.setreg('+', path) + vim.notify('Copied "' .. path .. '" to the clipboard!') +end, {}) + +vim.api.nvim_create_user_command('CopyFileName', function() + local path = vim.fn.expand('%:t') + vim.fn.setreg('+', path) + vim.notify('Copied "' .. path .. '" to the clipboard!') +end, {}) + +-- Switch to git root or file parent dir +vim.api.nvim_create_user_command('RootDir', function() + local root = require('core.util').get_root_dir() + + if root == '' then + return + end + vim.cmd('lcd ' .. root) +end, {}) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua new file mode 100644 index 0000000..0bc455f --- /dev/null +++ b/lua/core/keymaps.lua @@ -0,0 +1,75 @@ +local function map(mode, lhs, rhs, opts) + opts = opts or {} + opts.silent = opts.silent ~= false + vim.keymap.set(mode, lhs, rhs, opts) +end +local opts = { noremap = true, silent = true } + +-- Use jj as escape +map('i', 'jj', '', opts) +map('t', 'JJ', '', opts) + +-- Visual overwrite paste +map({ 'v', 'x' }, 'p', '"_dP', opts) + +-- Do not copy on x +map({ 'v', 'x' }, 'x', '"_x', opts) + +-- Increment/decrement +map({ 'n', 'v', 'x' }, '-', '', opts) +map({ 'n', 'v', 'x' }, '=', '', opts) + +-- Move to line beginning and end +map({ 'n', 'v', 'x' }, 'gl', '$', { desc = 'End of line' }) +map({ 'n', 'v', 'x' }, 'gh', '^', { desc = 'Beginning of line' }) + +-- Select all +map('n', '', 'ggG') + +-- Deleting without yanking empty line +map('n', 'dd', function() + local is_empty_line = vim.api.nvim_get_current_line():match('^%s*$') + if is_empty_line then + return '"_dd' + else + return 'dd' + end +end, { noremap = true, expr = true, desc = "Don't Yank Empty Line to Clipboard" }) + +-- Center Cursors +map('n', 'J', 'mzJ`z', opts) +map('n', '', 'zz', opts) +map('n', '', 'zz', opts) +map('n', 'n', 'nzzzv', opts) +map('n', 'N', 'Nzzzv', opts) + +-- Better up/down +map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + +-- Move text up and down +map({ 'v', 'x' }, 'J', ":move '>+1gv-gv", opts) +map({ 'v', 'x' }, 'K', ":move '<-2gv-gv", opts) + +-- Clear search, diff update and redraw +map({ 'i', 'n' }, '', 'noh', { desc = 'Escape and clear hlsearch' }) + +-- Consistent n/N search navigation +map('n', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) +map('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) +map('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next search result' }) +map('n', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) +map('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) +map('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev search result' }) + +-- Better indenting +map('v', '<', '', '>gv') + +-- Add undo breakpoints +map('i', ',', ',u') +map('i', '.', '.u') +map('i', ';', ';u') + +map({ 'i' }, '', '', { desc = 'Move cursor to right' }) +map({ 'i' }, '', '', { desc = 'Move cursor to right' }) diff --git a/lua/config/lazy.lua b/lua/core/lazy.lua similarity index 97% rename from lua/config/lazy.lua rename to lua/core/lazy.lua index 64fc39a..7b2677e 100644 --- a/lua/config/lazy.lua +++ b/lua/core/lazy.lua @@ -19,7 +19,6 @@ vim.opt.rtp:prepend(lazypath) require('lazy').setup({ spec = { { import = 'plugins' }, - { import = 'list' }, }, install = { missing = true, @@ -59,6 +58,7 @@ require('lazy').setup({ }, }, }, + lockfile = vim.fn.stdpath('config') .. '/lua/lock.json', performance = { rtp = { disabled_plugins = { diff --git a/lua/config/options.lua b/lua/core/options.lua similarity index 100% rename from lua/config/options.lua rename to lua/core/options.lua diff --git a/lua/core/util.lua b/lua/core/util.lua new file mode 100644 index 0000000..b2f3de1 --- /dev/null +++ b/lua/core/util.lua @@ -0,0 +1,66 @@ +local util = {} + +util.get_user_config = function(key, default) + local status_ok, user = pcall(require, 'user') + if not status_ok then + return default + end + + local user_config = user[key] + if user_config == nil then + return default + end + return user_config +end + +util.get_root_dir = function() + local bufname = vim.fn.expand('%:p') + if vim.fn.filereadable(bufname) == 0 then + return + end + + local parent = vim.fn.fnamemodify(bufname, ':h') + local git_root = vim.fn.systemlist('git -C ' .. parent .. ' rev-parse --show-toplevel') + if #git_root > 0 and git_root[1] ~= '' then + return git_root[1] + else + return parent + end +end + +util.get_file_type_cmd = function(extension) + local root = util.get_root_dir() + + if extension == 'arb' and root then + local gemfile_exists = vim.fn.filereadable(root .. '/Gemfile') == 1 + local pubspec_exists = vim.fn.filereadable(root .. '/pubspec.yaml') == 1 + if gemfile_exists then + return 'setfiletype ruby' + end + if pubspec_exists then + return 'setfiletype json' + end + end + return '' +end + +util.is_present = function(bin) + return vim.fn.executable(bin) == 1 +end + +util.telescope_select = function(options, options_desc, select_prompt) + require('telescope.pickers') + .new({}, { + prompt_title = select_prompt, + results_title = options_desc, + finder = require('telescope.finders').new_table({ + results = options, + entry_maker = require('telescope.make_entry').gen_from_file(), + }), + sorter = require('telescope.sorters').get_fzy_sorter(), + previewer = require('telescope.previewers').vim_buffer_cat.new({}), + }) + :find() +end + +return util diff --git a/lua/list.lua b/lua/list.lua deleted file mode 100644 index c8a405d..0000000 --- a/lua/list.lua +++ /dev/null @@ -1,587 +0,0 @@ -return { - -- Delete Buffer - { - 'famiu/bufdelete.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - init = function() - vim.keymap.set('n', 'q', function() - require('bufdelete').bufdelete(0, false) - end, { silent = true, desc = 'Quit Buffer' }) - end, - }, - -- Better Escape - { - 'max397574/better-escape.nvim', - config = function() - require('better_escape').setup() - end, - }, - -- Comment - { - { - 'LudoPinelli/comment-box.nvim', - opts = {}, - vscode = true, - keys = { - { 'cb', 'CBccbox', mode = { 'n', 'v' }, desc = 'Comment Box' }, - { 'ct', 'CBllline', mode = { 'n', 'v' }, desc = 'Tiled line' }, - { 'cl', 'CBline', desc = 'Line' }, - { 'cm', 'CBllbox14', mode = { 'n', 'v' }, desc = 'Marked' }, - { 'cc', 'CBcatalog', desc = 'Catalog' }, - { 'cd', 'CBd', mode = { 'n', 'v' }, desc = 'Delete Comment Style' }, - }, - }, - }, - -- Code Screnshot - { - 'mistricky/codesnap.nvim', - build = 'make', - cmd = { 'CodeSnap', 'CodeSnapSave' }, - vscode = false, - keys = { - { 'cp', mode = 'v', "'<,'>CodeSnap", desc = 'Screenshot (Clipboard)' }, - { 'cP', mode = 'v', "'<,'>CodeSnapSave", desc = 'Screenshot (Save)' }, - }, - cond = vim.env.KITTY_SCROLLBACK_NVIM == nil, - opts = { - save_path = (os.getenv('HOME') .. '/Pictures/screenshots/'), - title = 'CodeSnap.nvim', - watermark = '', - bg_theme = 'summer', - }, - }, - -- Generate dotfyle metadata for your config - { - 'creativenull/dotfyle-metadata.nvim', - cmd = { 'DotfyleGenerate', 'DotfyleOpen' }, - }, - -- improve the default vim.ui interfaces - { - 'stevearc/dressing.nvim', - event = 'VeryLazy', - }, - -- Show diagnostics and lsp info inside a custom window, following the mouse position - { - 'soulis-1256/eagle.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - require('eagle').setup({}) - end, - }, - -- Navigate your code with search labels, enhanced character motions and Treesitter integration - { - 'folke/flash.nvim', - event = { 'CursorHold', 'CursorHoldI' }, - vscode = true, - opts = {}, - keys = { - { - 's', - mode = { 'n', 'x', 'o' }, - function() - require('flash').jump() - end, - desc = 'Flash', - }, - { - 'S', - mode = { 'n', 'o', 'x' }, - function() - require('flash').treesitter() - end, - desc = 'Flash Treesitter', - }, - { - 'r', - mode = 'o', - function() - require('flash').remote() - end, - desc = 'Remote Flash', - }, - { - 'R', - mode = { 'o', 'x' }, - function() - require('flash').treesitter_search() - end, - desc = 'Treesitter Search', - }, - { - '', - mode = { 'c' }, - function() - require('flash').toggle() - end, - desc = 'Toggle Flash Search', - }, - }, - }, - --open files in neovim without creating a nested sessions - { - 'willothy/flatten.nvim', - priority = 1001, - opts = { - window = { - open = 'alternate', - }, - }, - }, - -- highlight arguments - { - 'm-demare/hlargs.nvim', - event = { 'BufReadPost', 'BufNewFile' }, - }, - -- emoji picker - { - 'ziontee113/icon-picker.nvim', - enabled = true, - cmd = { 'IconPickerInsert' }, - vim.keymap.set('n', 'se', 'IconPickerInsert emoji'), - config = function() - require('icon-picker').setup({ disable_legacy_commands = true }) - end, - }, - -- Incremental rename - { - 'smjonas/inc-rename.nvim', - cmd = 'IncRename', - config = true, - }, - -- automtically guess indent - { - 'nmac427/guess-indent.nvim', - event = 'FileType', - config = function() - require('guess-indent').setup({}) - end, - }, - -- Faster LuaLS setup - { - 'folke/lazydev.nvim', - ft = 'lua', -- only load on lua files - cmd = 'LazyDev', - lazy = true, - event = 'LspAttach', - opts = { - library = {}, - }, - }, - -- Snippets - { - 'L3MON4D3/LuaSnip', - event = { 'BufReadPost', 'BufNewFile' }, - dependencies = { - 'rafamadriz/friendly-snippets', - 'mstuttgart/odoo-snippets', - }, - opts = { - history = true, - updateevents = 'TextChanged,TextChangedI', - }, - keys = function() - return {} - end, - config = function() - require('luasnip.loaders.from_vscode').lazy_load() - end, - }, - -- Markdown preview - { - 'iamcco/markdown-preview.nvim', - build = 'cd app && yarn install', - ft = { 'markdown' }, - keys = { - { - 'mp', - 'MarkdownPreviewToggle', - desc = 'toggle markdown preview', - }, - }, - }, - -- Colorscheme - { - 'bluz71/vim-moonfly-colors', - name = 'moonfly', - lazy = false, - priority = 1000, - config = function() - require('moonfly').custom_colors({ - bg = '#000000', - }) - vim.cmd([[colorscheme moonfly]]) - end, - }, - -- navigate between neovim and terminal - { - 'numToStr/Navigator.nvim', - keys = { - { '', 'NavigatorLeft' }, - { '', 'NavigatorDown' }, - { '', 'NavigatorUp' }, - { '', 'NavigatorRight' }, - { '', 'NavigatorPrevious' }, - }, - config = function() - require('Navigator').setup() - end, - }, - -- popup display that provides breadcrumbs like navigation features - { - 'SmiteshP/nvim-navbuddy', - dependencies = { - 'neovim/nvim-lspconfig', - 'SmiteshP/nvim-navic', - }, - keys = { - { 'nv', 'Navbuddy', desc = 'Nav' }, - }, - config = function() - local actions = require('nvim-navbuddy.actions') - local navbuddy = require('nvim-navbuddy') - navbuddy.setup({ - window = { - border = 'double', - }, - mappings = { - ['k'] = actions.next_sibling, - ['i'] = actions.previous_sibling, - ['j'] = actions.parent, - ['l'] = actions.children, - }, - lsp = { auto_attach = true }, - }) - end, - }, - -- smooth scrolling - { - 'karb94/neoscroll.nvim', - event = 'UIEnter', - config = function() - require('neoscroll').setup({ - mappings = { -- Keys to be mapped to their corresponding default scrolling animation - '', - '', - '', - '', - '', - '', - 'zt', - 'zz', - 'zb', - }, - hide_cursor = true, -- Hide cursor while scrolling - stop_eof = true, -- Stop at when scrolling downwards - respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file - cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further - easing = 'linear', -- Default easing function - pre_hook = nil, -- Function to run before the scrolling animation starts - post_hook = nil, -- Function to run after the scrolling animation ends - performance_mode = false, -- Disable "Performance Mode" on all buffers. - }) - end, - }, - -- Notifications - { - 'rcarriga/nvim-notify', - event = 'VeryLazy', - keys = { - { - 'un', - function() - require('notify').dismiss({ silent = true, pending = true }) - end, - desc = 'Dismiss All Notifications', - }, - }, - opts = { - level = 2, - minimum_width = 50, - stages = 'fade', - timeout = 3000, - top_down = true, - render = 'compact', - background_colour = '#000000', - }, - }, - -- Ui components - { - 'MunifTanjim/nui.nvim', - lazy = true, - }, - -- Peek lines just when you intend - { - 'nacro90/numb.nvim', - event = 'CmdlineEnter', - config = function() - require('numb').setup({ - show_numbers = true, -- Enable 'number' for the window while peeking - show_cursorline = true, -- Enable 'cursorline' for the window while peeking - hide_relativenumbers = true, -- Enable turning off 'relativenumber' for the window while peeking - number_only = false, -- Peek only when the command is only a number instead of when it starts with a number - centered_peeking = true, -- Peeked line will be centered relative to window - }) - end, - }, - { - 'nvim-lua/plenary.nvim', - lazy = true, - }, - -- Session Management - { - 'folke/persistence.nvim', - event = 'BufReadPre', - opts = { options = vim.opt.sessionoptions:get() }, - keys = { - { - 'ss', - function() - require('persistence').load() - end, - desc = 'Restore Session', - }, - { - 'sl', - function() - require('persistence').load({ last = true }) - end, - desc = 'Restore Last Session', - }, - { - 'sd', - function() - require('persistence').stop() - end, - desc = "Don't Save Current Session", - }, - }, - }, - -- alternating syntax highlighting - { - 'HiPhish/rainbow-delimiters.nvim', - event = { 'BufReadPost', 'BufNewFile' }, - config = function() - local rainbow_delimiters = require('rainbow-delimiters') - require('rainbow-delimiters.setup').setup({ - { - strategy = { - [''] = rainbow_delimiters.strategy['global'], - vim = rainbow_delimiters.strategy['local'], - }, - query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', - }, - priority = { - [''] = 110, - lua = 210, - }, - highlight = { - 'RainbowDelimiterRed', - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterOrange', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', - }, - }, - }) - end, - }, - -- Enhance the usage of macros - { - 'chrisgrieser/nvim-recorder', - dependencies = { 'rcarriga/nvim-notify' }, - event = 'VeryLazy', - vscode = true, - keys = { - { 'q', desc = 'Start Recording' }, - { 'Q', desc = 'Play Recording' }, - { '', desc = 'Switch Slot' }, - { 'cq', desc = 'Edit Macro' }, - { 'yq', desc = 'Yank Macro' }, - { 'dq', desc = 'Delete All Macros' }, - }, - opts = { - useNerdFontsIcons = false, - slots = { 'a', 'b', 'c', 'd' }, - mapping = { - startStopRecording = 'q', - playMacro = 'Q', - editMacro = 'cq', - switchSlot = '', - deleteAllMacros = 'dq', - yankMacro = 'yq', - }, - }, - }, - -- Screencast the keys - { - 'NStefan002/screenkey.nvim', - cmd = 'Screenkey', - version = '*', - vim.keymap.set('n', 'kt', 'Screenkey', { desc = 'Toggle keys' }), - config = function() - require('screenkey').setup({ - -- see :h nvim_open_win - win_opts = { - relative = 'editor', - anchor = 'SE', - width = 40, - height = 1, - border = 'single', - }, - -- compress input when repeated times - compress_after = 3, - -- clear the input after seconds of inactivity - clear_after = 3, - -- temporarily disable screenkey (for example when inside of the terminal) - disable = { - filetypes = {}, -- for example: "toggleterm" - -- :h 'buftype' - buftypes = {}, -- for example: "terminal" - }, - }) - end, - }, - -- search panel - { - 'nvim-pack/nvim-spectre', - build = false, - cmd = 'Spectre', - opts = { open_cmd = 'noswapfile vnew' }, - keys = { - { - 'sr', - function() - require('spectre').open() - end, - desc = 'Replace in Files (Spectre)', - }, - }, - }, - { - 'luukvbaal/statuscol.nvim', - event = 'BufReadPre', - config = function() - local builtin = require('statuscol.builtin') - require('statuscol').setup({ - setopt = true, - separator = '', - foldfunc = 'builtin', - relculright = true, - segments = { - { text = { '%s' }, click = 'v:lua.ScSa' }, - { - text = { builtin.lnumfunc, ' ' }, - click = 'v:lua.ScLa', - }, - }, - }) - end, - }, - -- undo history visualizer - { - 'mbbill/undotree', - keys = { - { 'uu', 'UndotreeToggle', desc = 'Toggle Undotree' }, - }, - }, - -- maximizer & restore current window - { - 'szw/vim-maximizer', - - keys = { - { 'sm', 'MaximizerToggle', desc = 'Maximize/minimize a split' }, - }, - }, - -- for programming activity - { - 'wakatime/vim-wakatime', - lazy = false, - }, - -- show keymaps - { - 'folke/which-key.nvim', - event = 'UIEnter', - opts = { - preset = 'helix', - }, - keys = { - { - '?', - function() - require('which-key').show({ global = false }) - end, - desc = 'Buffer Local Keymaps (which-key)', - }, - }, - }, - -- Distraction-free coding - { - 'folke/zen-mode.nvim', - cmd = { 'ZenMode' }, - opts = {}, - keys = { - { 'zz', 'ZenMode', desc = 'Toggle zen mode' }, - }, - }, - -- Prismatic line decorations - { - 'mvllow/modes.nvim', - event = { 'BufReadPost', 'BufNewFile' }, - tag = 'v0.2.0', - config = function() - require('modes').setup({ - - colors = { - visual = '#f5c359', - delete = '#c75c6a', - copy = '#78ccc5', - insert = '#c5739a', - }, - line_opacity = 0.15, - set_cursor = true, - set_cursorline = true, - set_number = true, - ignore_filetypes = { 'NvimTree', 'TelescopePrompt' }, - }) - end, - }, - -- Make editing big files faster - { - 'LunarVim/bigfile.nvim', - event = { 'BufEnter', 'WinEnter' }, - opts = { - -- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines) - pattern = function(bufnr, filesize_mib) - if filesize_mib >= 2 then - return true - end - -- you can't use `nvim_buf_line_count` because this runs on BufReadPre - local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr)) - local file_length = #file_contents - if file_length > 5000 then - return true - end - - return false - end, - }, - }, - -- url-opener - { - 'sontungexpt/url-open', - event = { 'BufEnter', 'WinEnter' }, - cmd = 'URLOpenUnderCursor', - config = function() - local status_ok, url_open = pcall(require, 'url-open') - if not status_ok then - return - end - url_open.setup({}) - end, - vim.keymap.set('n', 'gx', ':URLOpenUnderCursor'), - }, -} diff --git a/lazy-lock.json b/lua/lock.json similarity index 77% rename from lazy-lock.json rename to lua/lock.json index ef99851..fbbe76c 100644 --- a/lazy-lock.json +++ b/lua/lock.json @@ -5,7 +5,7 @@ "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "better-escape.nvim": { "branch": "master", "commit": "d337e02b140d909345441392de47a42d283747c1" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, + "bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, @@ -13,20 +13,17 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" }, - "codesnap.nvim": { "branch": "main", "commit": "c2924bf6c9a2c2c03318fae9b7fe0706412b9d9c" }, "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, "dotfyle-metadata.nvim": { "branch": "main", "commit": "342ef8f3f98f3ccc451c9cf2be74e95149ced05d" }, "dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" }, - "eagle.nvim": { "branch": "main", "commit": "f590404f510be11ef2cf7c68e135441bfa48c9a8" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, + "hardtime.nvim": { "branch": "main", "commit": "91c6be1a54fa057002e21ae209a49436bd215355" }, "hlargs.nvim": { "branch": "main", "commit": "cc0d9ee75e5ffba730393049119361b9e3a5b1b6" }, - "icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, + "indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, "lspsaga.nvim": { "branch": "main", "commit": "4ce44df854f447cf0a8972e5387b3aeb5efc798b" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, @@ -36,33 +33,30 @@ "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.nvim": { "branch": "main", "commit": "7e30f58071dd963f2a6e81415aa121eb090da2c0" }, + "mini.files": { "branch": "main", "commit": "170d0dd321ca377cb427fb5576d4d75601c1c2da" }, + "mini.nvim": { "branch": "main", "commit": "d6e6a6fb010cc452b491704aa9ecc96a8aa2cde1" }, "modes.nvim": { "branch": "main", "commit": "3188692abf02a8838ec75e59d68c2ce3e4323f5c" }, "moonfly": { "branch": "master", "commit": "4f7d18cb471ede7407dd966c7563868cae7f4f99" }, "neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" }, - "neoscroll.nvim": { "branch": "master", "commit": "532dcc8cea4287c4cad6bb77532989a8217cfc7b" }, "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-vitest": { "branch": "main", "commit": "e939b7c0ca705ad1f4be18894e30e7b4340a0148" }, + "neotest-python": { "branch": "master", "commit": "e5bff6dcf3cb33e6dfb97722e142961099c6021e" }, + "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, "noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" }, "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" }, - "nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-cokeline": { "branch": "main", "commit": "adfd1eb87e0804b6b86126e03611db6f62bb2909" }, - "nvim-dap": { "branch": "master", "commit": "2b428ff2632e73295e9decbcf1c40d8e26213305" }, - "nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" }, + "nvim-dap": { "branch": "master", "commit": "281a2e4cd1e7a17cea7ecb1745d84a8ab1249925" }, "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" }, "nvim-lspconfig": { "branch": "master", "commit": "a89de2e049b5f89a0ee55029d5a31213bd4de6f8" }, - "nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-recorder": { "branch": "main", "commit": "2b307756704a0ba26e8a3adfe98d02eeaecaa52e" }, + "nvim-recorder": { "branch": "main", "commit": "ce96792c1ff750977fc3affc56f0561b0c20a7e2" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, - "nvim-treesitter": { "branch": "master", "commit": "63e1337f1b60c84a4100ebedfb1dc80924c49122" }, + "nvim-treesitter": { "branch": "master", "commit": "ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631" }, "nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ced6375723b20616282f9f6a1018a63ae19b106a" }, "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, @@ -71,23 +65,24 @@ "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "c097f728a409d9923a3c70c1507e8389978a9b85" }, - "screenkey.nvim": { "branch": "main", "commit": "a96a13fede30bba0b37f6a87cb0a2cdd1679e422" }, - "statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" }, + "screenkey.nvim": { "branch": "main", "commit": "b1516d5d610c89555062397d29fa7f32fc8ec431" }, + "tdo.nvim": { "branch": "main", "commit": "f8d4ee275309c8a696236fcee92d78ecd98971bd" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "a46780830b576049c675680650f773bedfa8677a" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope-undo.nvim": { "branch": "main", "commit": "51be9ae7c42fc27c0b05505e3a0162e0f05fbb6a" }, "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, "termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" }, - "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, + "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "1420fb9e07b1d80cc6d87e7d90827fb2c1109cb3" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, - "url-open": { "branch": "main", "commit": "9f8f4a56ac709f26aa17d8ef921b272bf2262a30" }, "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, "vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" }, "vim-dadbod-ui": { "branch": "master", "commit": "0f51d8de368c8c6220973e8acd156d17da746f4c" }, "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, "vim-wakatime": { "branch": "master", "commit": "53bba6bb8342de9cbdafc82142a9b5e82008d858" }, "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "yanky.nvim": { "branch": "main", "commit": "73215b77d22ebb179cef98e7e1235825431d10e4" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" } } diff --git a/lua/plugins/auto-pairs.lua b/lua/plugins/auto-pairs.lua deleted file mode 100644 index 164e972..0000000 --- a/lua/plugins/auto-pairs.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - { - { - 'windwp/nvim-autopairs', - keys = { - { '', mode = 'i' }, - { '', mode = 'i' }, - { '{', mode = 'i' }, - { '[', mode = 'i' }, - { '(', mode = 'i' }, - { '"', mode = 'i' }, - { "'", mode = 'i' }, - { '`', mode = 'i' }, - { '<', mode = 'i' }, - }, - lazy = true, - init = function() - vim.api.nvim_create_autocmd('User', { - pattern = 'IntPairsComp', - callback = function() - require('cmp').event:on( - 'confirm_done', - require('nvim-autopairs.completion.cmp').on_confirm_done() - ) - end, - once = true, - }) - end, - config = function() - require('nvim-autopairs').setup({ - map_bs = false, - check_ts = true, - fast_wrap = { highlight = 'Question', highlight_grey = 'LspCodeLens' }, - }) - end, - }, - { - 'hrsh7th/nvim-cmp', - optional = true, - opts = function() - require('cmp').event:on('menu_opened', function() - if vim.api.nvim_get_mode().mode:sub(1, 1) ~= 'c' then - vim.api.nvim_exec_autocmds('User', { pattern = 'IntPairsComp', modeline = false }) - end - end) - end, - }, - }, - { - 'altermo/ultimate-autopair.nvim', - keys = { - { '', mode = { 'i', 'c' } }, - { '', mode = { 'i', 'c' } }, - { '', mode = { 'i', 'c' } }, - { '{', mode = 'c' }, - { '[', mode = 'c' }, - { '(', mode = 'c' }, - { '"', mode = 'c' }, - { "'", mode = 'c' }, - { '`', mode = 'c' }, - }, - lazy = true, - config = function() - require('ultimate-autopair').setup({ - pair_map = true, - cr = { enable = false }, - space2 = { enable = true }, - fastwarp = { enable = false }, - }) - end, - }, -} diff --git a/lua/plugins/barbecue.lua b/lua/plugins/barbecue.lua deleted file mode 100644 index 84d0c6c..0000000 --- a/lua/plugins/barbecue.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - 'utilyre/barbecue.nvim', - name = 'barbecue', - version = '*', - event = { 'BufReadPost', 'BufAdd', 'BufNewFile' }, - dependencies = { - 'SmiteshP/nvim-navic', - 'nvim-tree/nvim-web-devicons', -- optional dependency - }, - opts = {}, - keys = { - { - 'bq', - function() - require('barbecue.ui').toggle() - end, - desc = 'toggle barbecue', - }, - }, - config = function() - require('barbecue').setup({ - create_autocmd = false, -- prevent barbecue from updating itself automatically - }) - - vim.api.nvim_create_autocmd({ - 'WinScrolled', -- or WinResized on NVIM-v0.9 and higher - 'BufWinEnter', - 'CursorHold', - 'InsertLeave', - - -- include this if you have set `show_modified` to `true` - -- "BufModifiedSet", - }, { - group = vim.api.nvim_create_augroup('barbecue.updater', {}), - callback = function() - require('barbecue.ui').update() - end, - }) - end, -} diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua deleted file mode 100644 index a727af4..0000000 --- a/lua/plugins/codeium.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - { - 'Exafunction/codeium.vim', - event = 'InsertEnter', - config = function() - local cmp = require('cmp') - cmp.event:on('menu_opened', function() - vim.g.codeium_manual = true - vim.fn['codeium#Clear']() - end) - cmp.event:on('menu_closed', function() - vim.g.codeium_manual = false - vim.fn['codeium#Complete']() - end) - - vim.g.codeium_filetypes = { - TelescopePrompt = false, - DressingInput = false, - ['neo-tree-popup'] = false, - ['dap-repl'] = false, - } - - local opts = { expr = true, silent = true } - vim.g.codeium_disable_bindings = 1 - - vim.keymap.set('i', '', function() - return vim.fn['codeium#Accept']() - end, opts) - - vim.keymap.set('n', 'ch', function() - return vim.fn['codeium#Chat']() - end, { desc = 'Chat with IA (Codeium)' }) - - vim.keymap.set('i', '', function() - return vim.fn['codeium#CycleCompletions'](1) - end, opts) - - vim.keymap.set('i', '', function() - return vim.fn['codeium#CycleCompletions'](-1) - end, opts) - - vim.keymap.set('i', '', function() - return vim.fn['codeium#Clear']() - end, opts) - - vim.keymap.set('n', 'cI', 'CodeiumToggle', { desc = 'Toggle IA (Codeium)' }) - end, - }, -} diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua new file mode 100644 index 0000000..f382178 --- /dev/null +++ b/lua/plugins/coding.lua @@ -0,0 +1,211 @@ +return { + { + 'max397574/better-escape.nvim', + event = 'InsertEnter', + opts = { + k = function() + vim.api.nvim_input('') + local current_line = vim.api.nvim_get_current_line() + if current_line:match('^%s+j$') then + vim.schedule(function() + vim.api.nvim_set_current_line('') + end) + end + end, + }, + }, + { + 'L3MON4D3/LuaSnip', + event = { 'BufReadPost', 'BufNewFile' }, + dependencies = { + 'rafamadriz/friendly-snippets', + 'mstuttgart/odoo-snippets', + }, + opts = { + history = true, + updateevents = 'TextChanged,TextChangedI', + }, + keys = function() + return {} + end, + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, + { + 'altermo/ultimate-autopair.nvim', + event = { 'InsertEnter', 'CmdlineEnter' }, + branch = 'v0.6', --recommended as each new version will have breaking changes + opts = {}, + }, + { + 'hrsh7th/nvim-cmp', + event = { 'InsertEnter' }, + dependencies = { + -- autocomplete plugins + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-nvim-lua', + 'saadparwaiz1/cmp_luasnip', + -- "hrsh7th/cmp-nvim-lsp-signature-help", + -- "hrsh7th/cmp-calc", + + -- vscode like icons to autocomplete list + 'onsails/lspkind.nvim', + -- snippet plugin + { 'L3MON4D3/LuaSnip', event = { 'BufReadPost', 'BufNewFile' } }, + { 'rafamadriz/friendly-snippets', event = { 'BufReadPost', 'BufNewFile' } }, + }, + config = function() + require('configs.cmp') + end, + }, + { + 'Exafunction/codeium.vim', + event = 'InsertEnter', + config = function() + local cmp = require('cmp') + cmp.event:on('menu_opened', function() + vim.g.codeium_manual = true + vim.fn['codeium#Clear']() + end) + cmp.event:on('menu_closed', function() + vim.g.codeium_manual = false + vim.fn['codeium#Complete']() + end) + + vim.g.codeium_filetypes = { + TelescopePrompt = false, + DressingInput = false, + ['neo-tree-popup'] = false, + ['dap-repl'] = false, + } + + local opts = { expr = true, silent = true } + vim.g.codeium_disable_bindings = 1 + + vim.keymap.set('i', '', function() + return vim.fn['codeium#Accept']() + end, opts) + + vim.keymap.set('n', 'ch', function() + return vim.fn['codeium#Chat']() + end, { desc = 'Chat with IA (Codeium)' }) + + vim.keymap.set('i', '', function() + return vim.fn['codeium#CycleCompletions'](1) + end, opts) + + vim.keymap.set('i', '', function() + return vim.fn['codeium#CycleCompletions'](-1) + end, opts) + + vim.keymap.set('i', '', function() + return vim.fn['codeium#Clear']() + end, opts) + + vim.keymap.set('n', 'cI', 'CodeiumToggle', { desc = 'Toggle IA (Codeium)' }) + end, + }, + { + 'nacro90/numb.nvim', + event = 'CmdlineEnter', + config = function() + require('numb').setup({ + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true, -- Enable 'cursorline' for the window while peeking + hide_relativenumbers = true, -- Enable turning off 'relativenumber' for the window while peeking + number_only = false, -- Peek only when the command is only a number instead of when it starts with a number + centered_peeking = true, -- Peeked line will be centered relative to window + }) + end, + }, + { + 'NStefan002/screenkey.nvim', + cmd = 'Screenkey', + version = '*', + vim.keymap.set('n', 'kt', 'Screenkey', { desc = 'Toggle keys' }), + config = function() + require('screenkey').setup({ + win_opts = { + relative = 'editor', + anchor = 'SE', + width = 40, + height = 1, + border = 'single', + }, + compress_after = 3, + clear_after = 3, + disable = { + filetypes = {}, -- for example: "toggleterm" + buftypes = {}, -- for example: "terminal" + }, + }) + end, + }, + { + 'gbprod/yanky.nvim', + event = 'BufReadPost', + keys = { + { '', '(YankyCycleForward)' }, + { '', '(YankyCycleBackward)' }, + { + 'yp', + function() + require('telescope').extensions.yank_history.yank_history({}) + end, + desc = 'Open Yank History', + }, + { 'y', '(YankyYank)', mode = { 'n', 'x' }, desc = 'Yank text' }, + { 'p', '(YankyPutAfter)', mode = { 'n', 'x' }, desc = 'Put yanked text after cursor' }, + { 'P', '(YankyPutBefore)', mode = { 'n', 'x' }, desc = 'Put yanked text before cursor' }, + { 'gp', '(YankyGPutAfter)', mode = { 'n', 'x' }, desc = 'Put yanked text after selection' }, + { 'gP', '(YankyGPutBefore)', mode = { 'n', 'x' }, desc = 'Put yanked text before selection' }, + -- This is not plugin keymaps + { 'yP', 'CopyAbsolutePath', desc = 'Absolute Path' }, + { 'ya', '%y+', desc = 'Copy Whole File' }, + { 'yf', 'CopyFileName', desc = 'File Name' }, + { 'yg', 'lua require"gitlinker".get_buf_range_url()', desc = 'Copy Git URL' }, + { 'yp', 'CopyRelativePath', desc = 'Relative Path' }, + }, + opts = { + highlight = { + timer = 150, + }, + }, + }, + { + { + 'LudoPinelli/comment-box.nvim', + opts = {}, + vscode = true, + keys = { + { 'Cb', 'CBccbox', mode = { 'n', 'v' }, desc = 'Comment Box' }, + { 'Ct', 'CBllline', mode = { 'n', 'v' }, desc = 'Tiled line' }, + { 'Cl', 'CBline', desc = 'Line' }, + { 'Cm', 'CBllbox14', mode = { 'n', 'v' }, desc = 'Marked' }, + { 'Cc', 'CBcatalog', desc = 'Catalog' }, + { 'Cd', 'CBd', mode = { 'n', 'v' }, desc = 'Delete Comment Style' }, + }, + }, + }, + { + 'm-demare/hlargs.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + }, + { + 'numToStr/Navigator.nvim', + keys = { + { '', 'NavigatorLeft' }, + { '', 'NavigatorDown' }, + { '', 'NavigatorUp' }, + { '', 'NavigatorRight' }, + { '', 'NavigatorPrevious' }, + }, + config = function() + require('Navigator').setup() + end, + }, +} diff --git a/lua/plugins/cokeline.lua b/lua/plugins/cokeline.lua deleted file mode 100644 index ba6d1e5..0000000 --- a/lua/plugins/cokeline.lua +++ /dev/null @@ -1,78 +0,0 @@ -return { - 'willothy/nvim-cokeline', - event = 'UIEnter', - config = function() - local get_hex = require('cokeline.hlgroups').get_hl_attr - - local yellow = vim.g.terminal_color_3 - - require('cokeline').setup({ - default_hl = { - fg = function(buffer) - return buffer.is_focused and get_hex('Normal', 'fg') or get_hex('Comment', 'fg') - end, - bg = function() - return get_hex('ColorColumn', 'bg') - end, - }, - - sidebar = { - filetype = { 'NvimTree', 'neo-tree' }, - components = { - { - text = function(buf) - -- Center the text by adding padding spaces - local total_width = vim.api.nvim_win_get_width(0) - local padding = math.floor((total_width - #buf.filetype) / 2) - return string.rep(' ', padding) .. buf.filetype .. string.rep(' ', padding) - end, - fg = yellow, - bg = function() - return get_hex('NvimTreeNormal', 'bg') - end, - bold = true, - }, - }, - }, - - components = { - { - text = function(buffer) - return (buffer.index ~= 1) and '▏' or '' - end, - }, - { - text = ' ', - }, - { - text = function(buffer) - return buffer.devicon.icon - end, - fg = function(buffer) - return buffer.devicon.color - end, - }, - { - text = ' ', - }, - { - text = function(buffer) - return buffer.filename .. ' ' - end, - bold = function(buffer) - return buffer.is_focused - end, - }, - { - text = '', - on_click = function(_, _, _, _, buffer) - buffer:delete() - end, - }, - { - text = ' ', - }, - }, - }) - end, -} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..b8233e9 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,14 @@ +return { + { + 'bluz71/vim-moonfly-colors', + name = 'moonfly', + lazy = false, + priority = 1000, + config = function() + require('moonfly').custom_colors({ + bg = '#000000', + }) + vim.cmd([[colorscheme moonfly]]) + end, + }, +} diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua deleted file mode 100644 index d78e26f..0000000 --- a/lua/plugins/completions.lua +++ /dev/null @@ -1,89 +0,0 @@ --- configure autocomplete -return { - 'hrsh7th/nvim-cmp', - event = { 'InsertEnter' }, - dependencies = { - -- autocomplete plugins - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-nvim-lua', - 'saadparwaiz1/cmp_luasnip', - -- "hrsh7th/cmp-nvim-lsp-signature-help", - -- "hrsh7th/cmp-calc", - - -- vscode like icons to autocomplete list - 'onsails/lspkind.nvim', - -- snippet plugin - { 'L3MON4D3/LuaSnip', event = { 'BufReadPost', 'BufNewFile' } }, - { 'rafamadriz/friendly-snippets', event = { 'BufReadPost', 'BufNewFile' } }, - }, - config = function() - local cmp = require('cmp') - local luasnip = require('luasnip') - require('luasnip/loaders/from_vscode').lazy_load() - - cmp.setup({ - completion = { - keyword_length = 1, - completeopt = 'menu,menuone', - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - formatting = { - fields = { 'kind', 'abbr', 'menu' }, - format = function(entry, vim_item) - local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50 })(entry, vim_item) - local strings = vim.split(kind.kind, '%s', { trimempty = true }) - kind.kind = ' ' .. (strings[1] or '') .. ' ' - kind.menu = ' (' .. (strings[2] or '') .. ')' - - return kind - end, - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), -- show completion suggestions - [''] = cmp.mapping.abort(), -- close completion window - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }), - }, - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'cmdline' }, - }, - }), - cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' }, - }, - }), - -- sources for autocompletion - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- snippets - { name = 'buffer' }, -- text within current buffer - { name = 'path' }, -- file system paths - { name = 'codeium' }, -- AI for autocompletion - -- { name = "nvim_lsp_signature_help" }, - -- { name = "calc" }, --for maths calculations - }, - }) - end, -} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..19d0c79 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,132 @@ +return { + { + 'mfussenegger/nvim-dap', + dependencies = { + 'rcarriga/nvim-dap-ui', + }, + cmd = { 'DapUIToggle', 'DapToggleRepl', 'DapToggleBreakpoint' }, + keys = { + { 'bO', 'DapStepOut', desc = 'Out' }, + { 'bR', 'DapRestartFrame', desc = 'Restart Frame' }, + { 'bb', 'DapToggleBreakpoint', desc = 'Breakpoint' }, + { 'bc', 'DapContinue', desc = 'Continue' }, + { 'bi', 'DapStepInto', desc = 'Into' }, + { 'bl', "lua require'dap'.run_last()", desc = 'Last' }, + { 'bo', 'DapStepOver', desc = 'Over' }, + { 'br', 'DapToggleRepl', desc = 'Repl' }, + { 'bt', 'DapUIToggle', desc = 'Debugger' }, + { 'bx', 'DapTerminate', desc = 'Exit' }, + }, + config = function() + local dap = require('dap') + local dapui = require('dapui') + + dapui.setup({ + icons = { expanded = ' ', collapsed = ' ' }, + mappings = { + expand = { '', '<2-LeftMouse>' }, + open = 'o', + remove = 'd', + edit = 'e', + repl = 'r', + toggle = 't', + }, + expand_lines = vim.fn.has('nvim-0.7'), + layouts = { + { + elements = { + { id = 'scopes', size = 0.25 }, + 'breakpoints', + 'stacks', + 'watches', + }, + size = 40, + position = 'right', + }, + { + elements = { + 'repl', + 'console', + }, + size = 0.25, + position = 'bottom', + }, + }, + floating = { + max_height = nil, + max_width = nil, + border = 'rounded', + mappings = { + close = { 'q', '' }, + }, + }, + windows = { indent = 1 }, + render = { + max_type_length = nil, + }, + }) + + vim.fn.sign_define( + 'DapBreakpoint', + { text = ' ', texthl = 'DiagnosticSignError', linehl = '', numhl = '' } + ) + + dap.listeners.after.event_initialized['dapui_config'] = function() + dapui.open() + end + dap.listeners.before.event_terminated['dapui_config'] = function() + dapui.close() + end + dap.listeners.before.event_exited['dapui_config'] = function() + dapui.close() + end + + dap.adapters.python = { + type = 'executable', + command = '/usr/bin/python', + args = { '-m', 'debugpy.adapter' }, + } + + dap.configurations.python = { + { + type = 'python', + request = 'launch', + name = 'Launch file', + + program = '${file}', + pythonPath = function() + local cwd = vim.fn.getcwd() + if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then + return cwd .. '/venv/bin/python' + elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then + return cwd .. '/.venv/bin/python' + else + return '/usr/bin/python' + end + end, + }, + } + + -- dap.adapters.ruby = { + -- type = 'executable', + -- command = 'bundle', + -- args = { 'exec', 'readapt', 'stdio' }, + -- } + + -- dap.configurations.ruby = { + -- { + -- type = 'ruby', + -- request = 'launch', + -- name = 'Rails', + -- program = 'bundle', + -- programArgs = { 'exec', 'rails', 's' }, + -- useBundler = true, + -- }, + -- } + + vim.api.nvim_create_user_command('DapUIToggle', function() + require('dapui').toggle() + end, {}) + end, + }, +} diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua new file mode 100644 index 0000000..8f3084b --- /dev/null +++ b/lua/plugins/editor.lua @@ -0,0 +1,281 @@ +return { + { + 'echasnovski/mini.files', + version = false, + keys = { + { '-', "lua require('mini.files').open(vim.api.nvim_buf_get_name(0))", { silent = true } }, + }, + }, + { + 'nvim-neo-tree/neo-tree.nvim', + keys = { + { 'ee', ':Neotree toggle float', silent = true, desc = 'Float File Explorer' }, + { '', ':Neotree toggle left', silent = true, desc = ' Left File Explorer' }, + }, + cmd = { 'Neotree' }, + opts = { + filesystem = { + filtered_items = { + visible = true, + show_hidden_count = true, + hide_dotfiles = false, + hide_gitignored = true, + hide_by_name = { + '.git', + '.DS_Store', + 'thumbs.db', + '.venv', + }, + never_show = {}, + }, + }, + window = { + position = 'right', + width = 35, + }, + }, + }, + { + 'folke/flash.nvim', + event = 'VeryLazy', + opts = { + modes = { + char = { + jump_labels = true, + }, + }, + }, + -- stylua: ignore + keys = { + { + 'jN', + "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})", mode = { "n", "v" }, + desc = 'Search Backward', + }, + { 'jc', '*', desc = 'Word' }, + { 'jd', 'FlashDiagnostics', mode = { "n", "v" }, desc = 'Diagnostics' }, + { 'jf', 'Telescope jumplist', desc = 'Jumplist' }, + { 'jh', '', desc = 'Backward' }, + { 'jj', "lua require('flash').remote()", mode = { "n", "v" }, desc = 'Remote' }, + { 'jk', "lua require('flash').treesitter()", mode = { "n", "v" }, desc = 'Treesitter' }, + { 'jl', '', desc = 'Forward' }, + { + 'jn', + "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})", mode = { "n", "v" }, + desc = 'Search Forward', + }, + { 'jp', "lua require('flash').jump({continue = true})", mode = { "n", "v" }, desc = 'Previous Jump' }, + { 'js', "lua require('flash').jump()", mode = { "n", "v" }, desc = 'Search' }, + { 'jt', "lua require('flash').treesitter_search()", mode = { "n", "v" }, desc = 'Remote Treesitter' }, + { + 'jw', + 'lua require("flash").jump({ pattern = vim.fn.expand("")})', mode = { "n", "v" }, + desc = 'Current Word', + }, + + }, + }, + { + 'folke/trouble.nvim', + lazy = true, + cmd = { 'Trouble', 'TroubleToggle', 'TroubleRefresh' }, + opts = { + modes = { + lsp = { + win = { position = 'right' }, + }, + }, + }, + keys = { + { 'xx', 'Trouble diagnostics toggle', desc = 'Diagnostics (Trouble)' }, + { 'xX', 'Trouble diagnostics toggle filter.buf=0', desc = 'Buffer Diagnostics (Trouble)' }, + { 'xs', 'Trouble symbols toggle', desc = 'Symbols (Trouble)' }, + { 'xS', 'Trouble lsp toggle', desc = 'LSP references/definitions/... (Trouble)' }, + { 'xL', 'Trouble loclist toggle', desc = 'Location List (Trouble)' }, + { 'xQ', 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)' }, + { + '[q', + function() + if require('trouble').is_open() then + require('trouble').prev({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = 'Previous Trouble/Quickfix Item', + }, + { + ']q', + function() + if require('trouble').is_open() then + require('trouble').next({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cnext) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = 'Next Trouble/Quickfix Item', + }, + }, + }, + { + 'nvim-telescope/telescope.nvim', + cmd = 'Telescope', + version = false, + lazy = true, + dependencies = { + { 'nvim-tree/nvim-web-devicons' }, + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'zig' }, + { 'nvim-telescope/telescope-ui-select.nvim' }, + { 'nvim-telescope/telescope-symbols.nvim' }, + { 'nvim-telescope/telescope-file-browser.nvim' }, + { 'debugloop/telescope-undo.nvim' }, + }, + keys = { + { 'ff', 'Telescope find_files', desc = 'Find Files (CWD)' }, + { 'fg', 'Telescope live_grep', desc = 'Live Grep' }, + { 'fb', 'Telescope buffers', desc = 'Buffers' }, + { 'fh', 'Telescope help_tags', desc = 'Find Help' }, + { 'fo', 'Telescope oldfiles', desc = 'Old Recent Files' }, + { 'fm', 'Telescope marks', desc = 'Marks' }, + { 'fH', 'Telescope highlights', desc = 'Find Highlight Groups' }, + { 'fG', 'Telescope grep_string', desc = 'Grep String' }, + { 'kk', 'Telescope keymaps', desc = 'Keymaps' }, + { 'kc', 'Telescope commands', desc = 'Commands' }, + { 'kh', 'Telescope command_history', desc = 'Command History' }, + { 'ks', 'Telescope search_history', desc = 'Search History' }, + { 'fd', 'Telescope diagnostics', desc = 'Diagnostics' }, + { 'ef', 'Telescope file_browser', desc = 'File Browser' }, + { 'cr', 'Telescope reloader', desc = 'Reload Module' }, + { 'cn', 'Telescope notify', desc = 'Notifications' }, + { 'fu', 'Telescope undo', desc = 'Undo History' }, + { 'fb', 'Telescope buffers', desc = 'Buffers' }, + { 'fq', 'Telescope quickfix', desc = 'Quickfix' }, + { 'fs', 'Telescope current_buffer_fuzzy_find', desc = 'Fuzzy Find in File' }, + }, + + config = function() + require('configs.telescope') + end, + }, + { + 'smjonas/inc-rename.nvim', + cmd = 'IncRename', + config = true, + }, + { + + 'akinsho/toggleterm.nvim', + cmd = { 'ToggleTerm' }, + version = 'v2.*', + keys = { + { 't1', '1ToggleTerm', desc = 'Toggle Terminal', mode = 'n' }, + { 't2', '2ToggleTerm', desc = 'Toggle Terminal', mode = 'n' }, + }, + config = function() + require('configs.toggleterm') + end, + }, + { + '2kabhishek/termim.nvim', + cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' }, + keys = { + { 'th', 'Sterm', desc = 'Horizontal Terminal' }, + { 'tv', 'Vterm', desc = 'Vertical Terminal' }, + }, + }, + { + 'nvimdev/lspsaga.nvim', + lazy = true, + event = 'LspAttach', + config = function() + vim.keymap.set( + 'n', + 'lo', + 'Lspsaga outline', + { desc = 'Lspsaga | Code Outline', silent = true } + ) + require('lspsaga').setup({ + ui = { + theme = 'round', + border = 'rounded', + winblend = 0, + expand = '', + collaspe = '', + preview = ' ', + code_action = '󱧣 ', + diagnostic = ' ', + hover = ' ', + kind = {}, + }, + lightbulb = { + enable = false, + enable_in_insert = true, + sign = true, + sign_priority = 40, + virtual_text = true, + }, + symbol_in_winbar = { + enable = false, + separator = '  ', + hide_keyword = true, + show_file = true, + folder_level = 0, + }, + }) + end, + }, + { + 'HiPhish/rainbow-delimiters.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + config = function() + local rainbow_delimiters = require('rainbow-delimiters') + require('rainbow-delimiters.setup').setup({ + { + strategy = { + [''] = rainbow_delimiters.strategy['global'], + vim = rainbow_delimiters.strategy['local'], + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + }, + priority = { + [''] = 110, + lua = 210, + }, + highlight = { + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterOrange', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, + }, + }) + end, + }, + { + '2kabhishek/tdo.nvim', + dependencies = 'nvim-telescope/telescope.nvim', + cmd = { 'Tdo', 'TdoEntry', 'TdoNote', 'TdoTodos', 'TdoToggle', 'TdoFind', 'TdoFiles' }, + keys = { + { 'nd', 'Tdo', desc = "Today's Todo" }, + { 'ne', 'TdoEntry', desc = "Today's Entry" }, + { 'nf', 'TdoFiles', desc = 'All Notes' }, + { 'ng', 'TdoFind', desc = 'Find Notes' }, + { 'nh', 'Tdo -1', desc = "Yesterday's Todo" }, + { 'nl', 'Tdo 1', desc = "Tomorrow's Todo" }, + { 'nn', 'TdoNote', desc = 'New Note' }, + { 'nt', 'TdoTodos', desc = 'Incomplete Todos' }, + { 'nx', 'TdoToggle', desc = 'Toggle Todo' }, + }, + }, +} diff --git a/lua/plugins/linter_formatter.lua b/lua/plugins/linter_formatter.lua new file mode 100644 index 0000000..aea0654 --- /dev/null +++ b/lua/plugins/linter_formatter.lua @@ -0,0 +1,24 @@ +return { + { + 'williamboman/mason.nvim', + cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' }, + dependencies = { + { 'williamboman/mason-lspconfig.nvim', event = { 'BufReadPre', 'BufNewFile' } }, + { 'WhoIsSethDaniel/mason-tool-installer.nvim' }, + { 'zapling/mason-lock.nvim', cmd = { 'MasonLock', 'MasonLockRestore' }, opts = {} }, + }, + config = function() + require('mason').setup() + end, + }, + { + 'nvimtools/none-ls.nvim', -- configure formatters & linters + event = { 'BufRead', 'FileType' }, + dependencies = { + 'jay-babu/mason-null-ls.nvim', + }, + config = function() + require('configs.none-ls') + end, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..59d56a1 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,13 @@ +return { + { + 'neovim/nvim-lspconfig', + event = { 'BufReadPost', 'BufNewFile', 'BufWritePre' }, + dependencies = { + 'hrsh7th/cmp-nvim-lsp', + { 'antosha417/nvim-lsp-file-operations', config = true }, + }, + config = function() + require('configs.lsp') + end, + }, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua deleted file mode 100644 index 4a0fdb9..0000000 --- a/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,169 +0,0 @@ -return { - 'neovim/nvim-lspconfig', - event = { 'BufReadPost', 'FileType' }, - dependencies = { - 'hrsh7th/cmp-nvim-lsp', - { 'antosha417/nvim-lsp-file-operations', config = true }, - }, - config = function() - -- import lspconfig plugin - local lspconfig = require('lspconfig') - -- import cmp-nvim-lsp plugin - local cmp_nvim_lsp = require('cmp_nvim_lsp') - - local keymap = vim.keymap -- for conciseness - - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('UserLspConfig', {}), - callback = function(ev) - -- Buffer local mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local opts = { buffer = ev.buf, silent = true } - - -- set keybinds - opts.desc = 'Show LSP references' - keymap.set('n', 'gR', 'Telescope lsp_references', opts) -- show definition, references - - opts.desc = 'Go to declaration' - keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- go to declaration - - opts.desc = 'Show LSP definitions' - keymap.set('n', 'gd', 'Telescope lsp_definitions', opts) -- show lsp definitions - - opts.desc = 'Show LSP implementations' - keymap.set('n', 'gi', 'Telescope lsp_implementations', opts) -- show lsp implementations - - opts.desc = 'Show LSP type definitions' - keymap.set('n', 'gt', 'Telescope lsp_type_definitions', opts) -- show lsp type definitions - - opts.desc = 'See available code actions' - keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - - opts.desc = 'Smart rename' - keymap.set('n', 'rn', vim.lsp.buf.rename, opts) -- smart rename - - opts.desc = 'Show buffer diagnostics' - keymap.set('n', 'D', 'Telescope diagnostics bufnr=0', opts) -- show diagnostics for file - - opts.desc = 'Show line diagnostics' - keymap.set('n', 'd', vim.diagnostic.open_float, opts) -- show diagnostics for line - - opts.desc = 'Show documentation for what is under cursor' - keymap.set('n', 'K', vim.lsp.buf.hover, opts) -- show documentation for what is under cursor - - opts.desc = 'Restart LSP' - keymap.set('n', 'rs', ':LspRestart', opts) -- mapping to restart lsp if necessary - end, - }) - - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = cmp_nvim_lsp.default_capabilities() - - -- configure matlab server - lspconfig['clangd'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - -- configure bash server - lspconfig['bashls'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - -- configure html server - lspconfig['html'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - -- configure typescript server with plugin - lspconfig['tsserver'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure css server - lspconfig['cssls'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure tailwindcss server - lspconfig['tailwindcss'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure svelte server - lspconfig['svelte'].setup({ - capabilities = capabilities, - on_attach = function(client, bufnr) - on_attach(client, bufnr) - - vim.api.nvim_create_autocmd('BufWritePost', { - pattern = { '*.js', '*.ts' }, - callback = function(ctx) - if client.name == 'svelte' then - client.notify('$/onDidChangeTsOrJsFile', { uri = ctx.file }) - end - end, - }) - end, - }) - -- configure python server - lspconfig['pyright'].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure lua server (with special settings) - lspconfig['lua_ls'].setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { -- custom settings for lua - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - -- make language server aware of runtime files - library = { - [vim.fn.expand('$VIMRUNTIME/lua')] = true, - [vim.fn.stdpath('config') .. '/lua'] = true, - }, - }, - }, - }, - }) - - local x = vim.diagnostic.severity - local config = { - -- Enable virtual text - virtual_text = { -- or false for disable - prefix = '', -- ■  󰊠 - suffix = '', - format = function(diagnostic) - local prefix = '󰊠 ' - local suffix = ' ' - -- return full message with custom prefix & suffix - return prefix .. diagnostic.message .. suffix - end, - }, - update_in_insert = true, - signs = { text = { [x.ERROR] = '', [x.WARN] = '', [x.HINT] = '󰌵', [x.INFO] = '' } }, - underline = false, - severity_sort = true, - float = { - focusable = false, - style = 'minimal', - border = 'rounded', - source = 'always', - header = '', - prefix = '', - }, - } - - vim.diagnostic.config(config) - -- add borders to lsp info window - require('lspconfig.ui.windows').default_options.border = 'single' - end, -} diff --git a/lua/plugins/lspsaga.lua b/lua/plugins/lspsaga.lua deleted file mode 100644 index 87d61c9..0000000 --- a/lua/plugins/lspsaga.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - 'nvimdev/lspsaga.nvim', - lazy = true, - event = 'LspAttach', - config = function() - vim.keymap.set( - 'n', - 'ot', - 'Lspsaga outline', - { desc = 'Lspsaga | Code Outline', silent = true } - ) - require('lspsaga').setup({ - ui = { - theme = 'round', - border = 'rounded', - winblend = 0, - expand = '', - collaspe = '', - preview = ' ', - code_action = '󱧣 ', - diagnostic = ' ', - hover = ' ', - kind = {}, - }, - lightbulb = { - enable = false, - enable_in_insert = true, - sign = true, - sign_priority = 40, - virtual_text = true, - }, - symbol_in_winbar = { - enable = false, - separator = '  ', - hide_keyword = true, - show_file = true, - folder_level = 0, - }, - }) - end, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 35a06d6..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,210 +0,0 @@ -return { - 'nvim-lualine/lualine.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - event = 'UIEnter', - config = function() - -- Eviline config for lualine - -- Author: shadmansaleh - -- Credit: glepnir - local lualine = require('lualine') - --- Color table for highlights - -- stylua: ignore - local colors = { - bg = 'none', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', - } - - local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, - } - - -- Config - local config = { - options = { - -- Disable sections and component separators - component_separators = '', - section_separators = '', - disabled_filetypes = { - 'NeoTree', - 'NvimTree', - 'Outline', - 'alpha', - }, - theme = { - -- We are going to use lualine_c an lualine_x as left and - -- right section. Both are highlighted by c theme . So we - -- are just setting default looks o statusline - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - } - - -- Inserts a component in lualine_c at left section - local function ins_left(component) - table.insert(config.sections.lualine_c, component) - end - - -- Inserts a component in lualine_x at right section - local function ins_right(component) - table.insert(config.sections.lualine_x, component) - end - - ins_left({ - function() - return '▊' - end, - color = { fg = colors.blue }, -- Sets highlighting of component - padding = { left = 0, right = 1 }, -- We don't need space before this - }) - - ins_left({ - -- mode component - function() - return '' - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.red, - i = colors.green, - v = colors.blue, - ['␖'] = colors.blue, - V = colors.blue, - c = colors.magenta, - no = colors.red, - s = colors.orange, - S = colors.orange, - ['␓'] = colors.orange, - ic = colors.yellow, - R = colors.violet, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, - }) - - ins_left({ - 'filename', - cond = conditions.buffer_not_empty, - color = { fg = colors.magenta, gui = 'bold' }, - }) - - ins_left({ - 'diagnostics', - sources = { 'nvim_diagnostic' }, - symbols = { error = ' ', warn = ' ', info = ' ' }, - diagnostics_color = { - error = { fg = colors.red }, - warn = { fg = colors.yellow }, - info = { fg = colors.cyan }, - }, - }) - - -- Insert mid section. You can make any number of sections in neovim :) - -- for lualine it's any number greater then 2 - ins_left({ - function() - return '%=' - end, - }) - - ins_left({ - -- Lsp server name . - function() - local msg = 'No Active Lsp' - local clients = vim.lsp.get_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes) ~= -1 then - return client.name - end - end - return msg - end, - icon = ' LSP:', - color = { fg = '#ffffff', gui = 'bold' }, - }) - - ins_right({ - 'diff', - -- Is it me or the symbol for modified us really weird - symbols = { added = ' ', modified = ' ', removed = ' ' }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, - }) - - ins_right({ - 'branch', - icon = '', - color = { fg = colors.violet, gui = 'bold' }, - }) - - ins_right({ - function() - return '▊' - end, - color = { fg = colors.blue }, - padding = { left = 1 }, - }) - - -- Now don't forget to initialize lualine - lualine.setup(config) - end, -} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua deleted file mode 100644 index 4398482..0000000 --- a/lua/plugins/mason.lua +++ /dev/null @@ -1,57 +0,0 @@ -return { - 'williamboman/mason.nvim', - cmd = { 'Mason', 'MasonInstall', 'MasonInstallAll', 'MasonUpdate' }, - dependencies = { - { 'williamboman/mason-lspconfig.nvim', event = { 'BufReadPre', 'BufNewFile' } }, - 'WhoIsSethDaniel/mason-tool-installer.nvim', - { 'zapling/mason-lock.nvim', cmd = { 'MasonLock', 'MasonLockRestore' }, opts = {} }, - }, - config = function() - local mason = require('mason') - local mason_lspconfig = require('mason-lspconfig') - local mason_tool_installer = require('mason-tool-installer') - - -- enable mason and configure icons - mason.setup({ - ui = { - border = 'rounded', - icons = { - package_installed = '✓', - package_pending = '➜', - package_uninstalled = '✗', - }, - }, - }) - - mason_lspconfig.setup({ - -- list of servers for mason to install - ensure_installed = { - 'tsserver', - 'html', - 'cssls', - 'tailwindcss', - 'svelte', - 'lua_ls', - 'pyright', - 'jdtls', - 'bashls', - 'jsonls', - 'clangd', - }, - }) - - mason_tool_installer.setup({ - ensure_installed = { - 'prettier', -- prettier formatter - 'biome', -- js formatter - 'stylua', -- lua formatter - 'black', -- python formatter - 'isort', -- python formatter - 'clang-format', -- c/c++ formatter - 'luacheck', - 'pylint', - 'eslint_d', - }, - }) - end, -} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 8158daf..0819162 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -5,15 +5,9 @@ return { version = false, config = function() require('mini.comment').setup({}) + require('mini.ai').setup({}) require('mini.cursorword').setup() -- require("mini.tabline").setup() - local statusline = require('mini.statusline') - statusline.setup({ use_icons = true }) - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end - require('mini.bracketed').setup({ file = { suffix = '' }, window = { suffix = '' }, @@ -31,6 +25,9 @@ return { highlight = 'gsh', -- Highlight surrounding update_n_lines = 'gsn', -- Update `n_lines` }, + keys = { + { 'gz', '', desc = '+surround' }, + }, }) require('mini.pairs').setup({ odes = { command = true }, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua deleted file mode 100644 index 44b72a5..0000000 --- a/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - 'nvim-neo-tree/neo-tree.nvim', - enabled = true, - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', - }, - keys = { - { 'ee', ':Neotree toggle float', silent = true, desc = 'Float File Explorer' }, - { '', ':Neotree toggle left', silent = true, desc = 'Left File Explorer' }, - }, - cmd = { 'Neotree' }, - opts = { - filesystem = { - filtered_items = { - visible = true, - show_hidden_count = true, - hide_dotfiles = false, - hide_gitignored = true, - hide_by_name = { - '.git', - '.DS_Store', - 'thumbs.db', - '.venv', - }, - never_show = {}, - }, - }, - window = { - position = 'right', - width = 35, - }, - }, -} diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua deleted file mode 100644 index 7e8b872..0000000 --- a/lua/plugins/neotest.lua +++ /dev/null @@ -1,73 +0,0 @@ -return { - 'nvim-neotest/neotest', - dependencies = { 'haydenmeade/neotest-jest', 'marilari88/neotest-vitest' }, - cmd = 'Neotest', - config = function() - require('neotest').setup({ - status = { virtual_text = true }, - output = { open_on_run = true }, - adapters = { - require('neotest-vitest'), - require('neotest-jest')({ - jestCommand = 'npm test --', - jestConfigFile = 'custom.jest.config.ts', - env = { CI = true }, - cwd = function(path) - return vim.fn.getcwd() - end, - }), - }, - }) - end, - keys = { - { - 'tw', - function() - require('neotest').run.run(vim.fn.expand('%')) - end, - desc = 'Run File', - }, - { - 'tT', - function() - require('neotest').run.run(vim.loop.cwd()) - end, - desc = 'Run All Test Files', - }, - { - 'tr', - function() - require('neotest').run.run() - end, - desc = 'Run Nearest', - }, - { - 'ts', - function() - require('neotest').summary.toggle() - end, - desc = 'Toggle Summary', - }, - { - 'to', - function() - require('neotest').output.open({ enter = true, auto_close = true }) - end, - desc = 'Show Output', - }, - { - 'tO', - function() - require('neotest').output_panel.toggle() - end, - desc = 'Toggle Output Panel', - }, - { - 'tS', - function() - require('neotest').run.stop() - end, - desc = 'Stop', - }, - }, -} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua deleted file mode 100644 index 8379300..0000000 --- a/lua/plugins/noice.lua +++ /dev/null @@ -1,101 +0,0 @@ --- override nvim ui -return { - 'folke/noice.nvim', - event = 'UIEnter', - dependencies = { - 'nvim-treesitter/nvim-treesitter', - 'MunifTanjim/nui.nvim', - 'rcarriga/nvim-notify', - }, - opts = { - cmdline = { - view = 'cmdline', - format = { - cmdline = { icon = '▍' }, - substitute = { - pattern = '^:%%?s/', - icon = ' ', - ft = 'regex', - opts = { border = { text = { top = ' sub (old/new/) ' } } }, - }, - input = { view = 'cmdline_input', icon = '█' }, - }, - }, - routes = { - { - view = 'notify', - filter = { event = 'msg_showmode' }, - }, - { - filter = { - event = 'msg_show', - kind = '', - find = 'written', - }, - opts = { skip = true }, - }, - }, - lsp = { - progress = { - enabled = false, - -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin - -- See the section on formatting for more details on how to customize. - format = 'lsp_progress', - format_done = 'lsp_progress_done', - throttle = 1000 / 30, -- frequency to update lsp progress message - view = 'mini', - }, - override = { - -- override the default lsp markdown formatter with Noice - ['vim.lsp.util.convert_input_to_markdown_lines'] = true, - -- override the lsp markdown formatter with Noice - ['vim.lsp.util.stylize_markdown'] = true, - -- override cmp documentation with Noice (needs the other options to work) - ['cmp.entry.get_documentation'] = true, - }, - hover = { - enabled = true, - silent = false, -- set to true to not show a message if hover is not available - view = nil, -- when nil, use defaults from documentation - opts = {}, -- merged with defaults from documentation - }, - signature = { - enabled = false, - auto_open = { - enabled = true, - trigger = true, -- Automatically show signature help when typing a trigger character from the LSP - luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes - throttle = 50, -- Debounce lsp signature help request by 50ms - }, - view = nil, -- when nil, use defaults from documentation - opts = {}, -- merged with defaults from documentation - }, - message = { - -- Messages shown by lsp servers - enabled = true, - view = 'notify', - opts = {}, - }, - -- defaults for hover and signature help - documentation = { - view = 'hover', - opts = { - lang = 'markdown', - replace = true, - render = 'plain', - format = { '{message}' }, - win_options = { concealcursor = 'n', conceallevel = 3 }, - }, - }, - }, - presets = { - -- you can enable a preset by setting it to true, or a table that will override the preset config - -- you can also add custom presets that you can enable/disable with enabled=true - bottom_search = true, -- use a classic bottom cmdline for search - command_palette = false, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = true, -- add a border to hover docs and signature help - }, - }, -} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua deleted file mode 100644 index 777f90d..0000000 --- a/lua/plugins/none-ls.lua +++ /dev/null @@ -1,70 +0,0 @@ -return { - 'nvimtools/none-ls.nvim', -- configure formatters & linters - event = { 'BufRead', 'FileType' }, - dependencies = { - 'jay-babu/mason-null-ls.nvim', - }, - config = function() - local mason_null_ls = require('mason-null-ls') - - local null_ls = require('null-ls') - - local null_ls_utils = require('null-ls.utils') - - mason_null_ls.setup({ - ensure_installed = { - 'prettier', -- prettier formatter - 'biome', -- js formatter - 'clang-format', -- c/c++ formatter - 'stylua', -- lua formatter - 'black', -- python formatter - 'pylint', -- python linter - -- "eslint_d", -- js linter - }, - }) - - -- for conciseness - local formatting = null_ls.builtins.formatting -- to setup formatters - local diagnostics = null_ls.builtins.diagnostics -- to setup linters - - -- to setup format on save - local augroup = vim.api.nvim_create_augroup('LspFormatting', {}) - - -- configure null_ls - null_ls.setup({ - root_dir = null_ls_utils.root_pattern('.null-ls-root', 'Makefile', '.git', 'package.json'), - sources = { - formatting.prettier, -- js/ts formatter - formatting.stylua, -- lua formatter - formatting.isort, - formatting.black, - formatting.clang_format, - diagnostics.pylint, - -- diagnostics.eslint_d.with({ -- js/ts linter - -- condition = function(utils) - -- return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs - -- end, - -- }), - }, - -- configure format on save - on_attach = function(current_client, bufnr) - if current_client.supports_method('textDocument/formatting') then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd('BufWritePre', { - group = augroup, - buffer = bufnr, - callback = function() - vim.lsp.buf.format({ - filter = function(client) - -- only use null-ls for formatting instead of lsp server - return client.name == 'null-ls' - end, - bufnr = bufnr, - }) - end, - }) - end - end, - }) - end, -} diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua deleted file mode 100644 index 8e30c2e..0000000 --- a/lua/plugins/nvim-dap.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - 'mfussenegger/nvim-dap', - dependencies = { - 'leoluz/nvim-dap-go', - 'rcarriga/nvim-dap-ui', - 'nvim-neotest/nvim-nio', - }, - lazy = true, - config = function() - require('dap-go').setup() - require('dapui').setup() - local dap = require('dap') - local keymap = vim.keymap - local dapui = require('dapui') - - keymap.set('n', 'dt', dap.toggle_breakpoint, {}) - keymap.set('n', 'dc', dap.continue, {}) - - dap.listeners.before.attach.dapui_config = function() - dapui.open() - end - dap.listeners.before.launch.dapui_config = function() - dapui.open() - end - dap.listeners.before.event_terminated.dapui_config = function() - dapui.close() - end - dap.listeners.before.event_exited.dapui_config = function() - dapui.close() - end - end, -} diff --git a/lua/plugins/other.lua b/lua/plugins/other.lua new file mode 100644 index 0000000..903e3f2 --- /dev/null +++ b/lua/plugins/other.lua @@ -0,0 +1,170 @@ +return { + { + 'folke/persistence.nvim', + event = 'BufReadPre', + opts = { options = vim.opt.sessionoptions:get() }, + keys = { + { + 'ms', + function() + require('persistence').load() + end, + desc = 'Restore Session', + }, + { + 'ml', + function() + require('persistence').load({ last = true }) + end, + desc = 'Restore Last Session', + }, + { + 'md', + function() + require('persistence').stop() + end, + desc = "Don't Save Current Session", + }, + }, + }, + { + 'nvim-lua/plenary.nvim', + lazy = true, + }, + { + 'iamcco/markdown-preview.nvim', + build = 'cd app && yarn install', + ft = { 'markdown' }, + keys = { + { + 'cm', + 'MarkdownPreviewToggle', + desc = 'toggle markdown preview', + }, + }, + }, + { + 'nvim-pack/nvim-spectre', + build = false, + cmd = 'Spectre', + opts = { open_cmd = 'noswapfile vnew' }, + keys = { + { + 'mr', + function() + require('spectre').open() + end, + desc = 'Replace in Files (Spectre)', + }, + }, + }, + { + 'szw/vim-maximizer', + + keys = { + { 'mm', 'MaximizerToggle', desc = 'Maximize/minimize a split' }, + }, + }, + { + 'folke/zen-mode.nvim', + cmd = { 'ZenMode' }, + opts = {}, + keys = { + { 'wz', 'ZenMode', desc = 'Toggle zen mode' }, + }, + }, + { + 'chrisgrieser/nvim-recorder', + dependencies = { 'rcarriga/nvim-notify' }, + event = 'VeryLazy', + vscode = true, + keys = { + { 'q', desc = 'Start Recording' }, + { 'Q', desc = 'Play Recording' }, + { '', desc = 'Switch Slot' }, + { 'cq', desc = 'Edit Macro' }, + { 'yq', desc = 'Yank Macro' }, + { 'dq', desc = 'Delete All Macros' }, + }, + opts = { + useNerdFontsIcons = false, + slots = { 'a', 'b', 'c', 'd' }, + mapping = { + startStopRecording = 'q', + playMacro = 'Q', + editMacro = 'cq', + switchSlot = '', + deleteAllMacros = 'dq', + yankMacro = 'yq', + }, + }, + }, + { + 'creativenull/dotfyle-metadata.nvim', + cmd = { 'DotfyleGenerate', 'DotfyleOpen' }, + }, + { + 'willothy/flatten.nvim', + priority = 1001, + opts = { + window = { + open = 'alternate', + }, + }, + }, + { + 'wakatime/vim-wakatime', + lazy = false, + }, + { + 'mvllow/modes.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + tag = 'v0.2.0', + config = function() + require('modes').setup({ + + colors = { + visual = '#f5c359', + delete = '#c75c6a', + copy = '#78ccc5', + insert = '#c5739a', + }, + line_opacity = 0.15, + set_cursor = true, + set_cursorline = true, + set_number = true, + ignore_filetypes = { 'NvimTree', 'TelescopePrompt' }, + }) + end, + }, + { + 'LunarVim/bigfile.nvim', + event = { 'BufEnter', 'WinEnter' }, + opts = { + -- Disables LSP/treesitter, etc for files above 5000 lives (even if they have really long lines) + pattern = function(bufnr, filesize_mib) + if filesize_mib >= 2 then + return true + end + -- you can't use `nvim_buf_line_count` because this runs on BufReadPre + local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr)) + local file_length = #file_contents + if file_length > 5000 then + return true + end + + return false + end, + }, + }, + { + 'm4xshen/hardtime.nvim', + config = function() + require('hardtime').setup({ enabled = true }) + end, + cmd = 'Hardtime', + init = function() + vim.keymap.set('n', 'ch', 'HardtimeToggle', { desc = 'Toggle Hardtime' }) + end, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100644 index b85044c..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,145 +0,0 @@ -return { - { - 'nvim-telescope/telescope.nvim', - cmd = 'Telescope', - version = false, - lazy = true, - dependencies = { - { 'nvim-lua/plenary.nvim' }, - { 'nvim-tree/nvim-web-devicons' }, - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'zig' }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - { 'nvim-telescope/telescope-file-browser.nvim' }, - }, - keys = { - { - 'sf', - function() - require('telescope.builtin').find_files() - end, - desc = 'Find File (CWD)', - }, - { - 'sh', - function() - require('telescope.builtin').help_tags() - end, - desc = 'Find Help', - }, - { - 'sH', - function() - require('telescope.builtin').highlights() - end, - desc = 'Find highlight groups', - }, - { - 'sM', - function() - require('telescope.builtin').man_pages() - end, - desc = 'Map Pages', - }, - { - 'so', - function() - require('telescope.builtin').oldfiles() - end, - desc = 'Open Recent File', - }, - { - 'sg', - function() - require('telescope.builtin').live_grep() - end, - desc = 'Live Grep', - }, - { - 'sw', - function() - require('telescope.builtin').grep_string() - end, - desc = 'Grep String', - }, - { - 'sk', - function() - require('telescope.builtin').keymaps() - end, - desc = 'Keymaps', - }, - { - 'sC', - function() - require('telescope.builtin').commands() - end, - desc = 'Commands', - }, - { - '', - function() - require('telescope.builtin').buffers() - end, - desc = 'Buffers', - }, - { - 'sd', - function() - require('telescope.builtin').diagnostics() - end, - desc = 'diagnostics', - }, - { - 'sF', - 'Telescope file_browser', - desc = 'File Browser', - }, - }, - config = function() - local telescope = require('telescope') - local fb_actions = require('telescope').extensions.file_browser.actions - telescope.setup({ - file_ignore_patterns = { '%.git/.' }, - defaults = { - preview = { - treesitter = false, - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = 'smart_case', -- or "ignore_case" or "respect_case" - }, - file_browser = { - theme = 'ivy', - hijack_netrw = true, - mapping = { - ['i'] = { - [''] = fb_actions.create, - [''] = fb_actions.rename, - [''] = fb_actions.remove, - [''] = fb_actions.toggle_hidden, - }, - ['n'] = { - [''] = fb_actions.create, - ['1', '1ToggleTerm', desc = 'Toggle Terminal', mode = 'n' }, - { '', 'ToggleTerm size=' .. size() .. '', desc = 'Toggle Terminal', mode = 'n' }, - { '2', '2ToggleTerm', desc = 'Toggle Terminal', mode = 'n' }, - }, - opts = { - size = 10, - open_mapping = [[]], - hide_numbers = true, - shade_filetypes = {}, - shade_terminals = true, - shading_factor = '2', - start_in_insert = true, - insert_mappings = true, - terminal_mappings = true, - persist_size = true, - direction = 'float', -- Use 'float' for floating terminal windows - close_on_exit = true, - shell = vim.o.shell, - float_opts = { - border = 'curved', -- or 'single', 'double', 'shadow', etc. - winblend = 0, -- Set to 0 for full transparency - highlights = { - border = 'Normal', - background = 'Normal', - }, - }, - }, - { - '2kabhishek/termim.nvim', - cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' }, - keys = { - { 'th', 'Sterm', desc = 'Horizontal Terminal' }, - { 'tv', 'Vterm', desc = 'Vertical Terminal' }, - }, - }, -} diff --git a/lua/plugins/test.lua b/lua/plugins/test.lua new file mode 100644 index 0000000..536de3d --- /dev/null +++ b/lua/plugins/test.lua @@ -0,0 +1,40 @@ +return { + 'nvim-neotest/neotest', + dependencies = { + 'nvim-neotest/nvim-nio', + 'olimorris/neotest-rspec', + 'nvim-neotest/neotest-jest', + 'nvim-neotest/neotest-python', + }, + cmd = 'Neotest', + config = function() + require('neotest').setup({ + status = { virtual_text = true }, + output = { open_on_run = true }, + adapters = { + require('neotest-vitest'), + require('neotest-jest')({ + jestCommand = 'npm test --', + jestConfigFile = 'custom.jest.config.ts', + env = { CI = true }, + cwd = function(path) + return vim.fn.getcwd() + end, + }), + }, + }) + end, + keys = { + { 'uc', 'lua require("neotest").run.run()', desc = 'Run Current Test' }, + { 'uf', 'lua require("neotest").run.run(vim.fn.expand("%"))', desc = 'Run Test File' }, + { + 'uo', + 'lua require("neotest").output.open({ enter = true, auto_close = true })', + desc = 'Show Output', + }, + { 'uS', 'lua require("neotest").summary.toggle', desc = 'Toggle Summary' }, + { 'ur', 'lua require("neotest").run.run()', desc = 'Run Nearest Test' }, + { 'us', 'lua require("neotest").run.stop()', desc = 'Stop' }, + { 'uO', 'lua require("neotest").output_panel.toggle', desc = 'Toggle Output Panel' }, + }, +} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/treesitter.lua similarity index 77% rename from lua/plugins/nvim-treesitter.lua rename to lua/plugins/treesitter.lua index 6417bbd..930ed5a 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -7,7 +7,7 @@ return { cmd = { 'TSInstall', 'TSBufEnable', 'TSBufDisable', 'TSModuleInfo' }, dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', - 'windwp/nvim-ts-autotag', + { 'windwp/nvim-ts-autotag', event = { 'BufReadPost', 'BufNewFile', 'BufWritePre' } }, }, config = function() require('nvim-ts-autotag').setup() @@ -46,7 +46,6 @@ return { textobjects = { select = { enable = true, - -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, keymaps = { ['af'] = { query = '@function.outer', desc = 'Select outer part of a function region' }, @@ -72,19 +71,12 @@ return { end, }, { - 'nvim-treesitter/nvim-treesitter-context', - dependencies = { 'nvim-treesitter/nvim-treesitter' }, - config = function() - require('treesitter-context').setup({ enable = false }) - end, - cmd = 'TSContextToggle', - init = function() - vim.keymap.set('n', '[c', function() - require('treesitter-context').go_to_context() - end, { silent = true, desc = 'Go to TS context' }) - vim.keymap.set('n', 'tc', function() - require('treesitter-context').toggle() - end, { silent = true, desc = 'Toggle TS Context' }) - end, + { + 'nvim-treesitter/nvim-treesitter-context', + event = 'VeryLazy', + config = function(_, opts) + require('treesitter-context').setup({ mode = 'cursor', max_lines = 3 }) + end, + }, }, } diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua deleted file mode 100644 index 7dfac42..0000000 --- a/lua/plugins/trouble.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - 'folke/trouble.nvim', - lazy = true, - cmd = { 'Trouble', 'TroubleToggle', 'TroubleRefresh' }, - opts = { - modes = { - lsp = { - win = { position = 'right' }, - }, - }, - }, - keys = { - { 'xx', 'Trouble diagnostics toggle', desc = 'Diagnostics (Trouble)' }, - { 'xX', 'Trouble diagnostics toggle filter.buf=0', desc = 'Buffer Diagnostics (Trouble)' }, - { 'cs', 'Trouble symbols toggle', desc = 'Symbols (Trouble)' }, - { 'cS', 'Trouble lsp toggle', desc = 'LSP references/definitions/... (Trouble)' }, - { 'xL', 'Trouble loclist toggle', desc = 'Location List (Trouble)' }, - { 'xQ', 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)' }, - { - '[q', - function() - if require('trouble').is_open() then - require('trouble').prev({ skip_groups = true, jump = true }) - else - local ok, err = pcall(vim.cmd.cprev) - if not ok then - vim.notify(err, vim.log.levels.ERROR) - end - end - end, - desc = 'Previous Trouble/Quickfix Item', - }, - { - ']q', - function() - if require('trouble').is_open() then - require('trouble').next({ skip_groups = true, jump = true }) - else - local ok, err = pcall(vim.cmd.cnext) - if not ok then - vim.notify(err, vim.log.levels.ERROR) - end - end - end, - desc = 'Next Trouble/Quickfix Item', - }, - }, -} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua new file mode 100644 index 0000000..914cef9 --- /dev/null +++ b/lua/plugins/ui.lua @@ -0,0 +1,222 @@ +return { + { + 'rcarriga/nvim-notify', + event = 'VeryLazy', + keys = { + { + 'mn', + function() + require('notify').dismiss({ silent = true, pending = true }) + end, + desc = 'Dismiss All Notifications', + }, + }, + opts = { + level = 2, + minimum_width = 50, + stages = 'fade', + timeout = 3000, + top_down = true, + render = 'compact', + background_colour = '#000000', + }, + }, + { + 'folke/noice.nvim', + event = 'UIEnter', + dependencies = { + { 'MunifTanjim/nui.nvim', lazy = true }, + 'rcarriga/nvim-notify', + }, + opts = { + cmdline = { + view = 'cmdline', + format = { + cmdline = { icon = '▍' }, + substitute = { + pattern = '^:%%?s/', + icon = ' ', + ft = 'regex', + opts = { border = { text = { top = ' sub (old/new/) ' } } }, + }, + input = { view = 'cmdline_input', icon = '█' }, + }, + }, + routes = { + { + view = 'notify', + filter = { event = 'msg_showmode' }, + }, + { + filter = { + event = 'msg_show', + kind = '', + find = 'written', + }, + opts = { skip = true }, + }, + }, + lsp = { + progress = { + enabled = false, + -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin + -- See the section on formatting for more details on how to customize. + format = 'lsp_progress', + format_done = 'lsp_progress_done', + throttle = 1000 / 30, -- frequency to update lsp progress message + view = 'mini', + }, + override = { + -- override the default lsp markdown formatter with Noice + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + -- override the lsp markdown formatter with Noice + ['vim.lsp.util.stylize_markdown'] = true, + -- override cmp documentation with Noice (needs the other options to work) + ['cmp.entry.get_documentation'] = true, + }, + hover = { + enabled = true, + silent = false, -- set to true to not show a message if hover is not available + view = nil, -- when nil, use defaults from documentation + opts = {}, -- merged with defaults from documentation + }, + signature = { + enabled = false, + auto_open = { + enabled = true, + trigger = true, -- Automatically show signature help when typing a trigger character from the LSP + luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes + throttle = 50, -- Debounce lsp signature help request by 50ms + }, + view = nil, -- when nil, use defaults from documentation + opts = {}, -- merged with defaults from documentation + }, + message = { + -- Messages shown by lsp servers + enabled = true, + view = 'notify', + opts = {}, + }, + -- defaults for hover and signature help + documentation = { + view = 'hover', + opts = { + lang = 'markdown', + replace = true, + render = 'plain', + format = { '{message}' }, + win_options = { concealcursor = 'n', conceallevel = 3 }, + }, + }, + }, + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = false, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + }, + }, + { + 'stevearc/dressing.nvim', + event = 'VeryLazy', + }, + { + 'akinsho/bufferline.nvim', + event = 'UIEnter', + version = '*', + config = function() + require('bufferline').setup({ + options = { + close_command = function() + require('bufdelete').bufdelete(0, true) + end, + right_mouse_command = function() + require('bufdelete').bugdelete(0, false) + end, + diagnostics = 'nvim_lsp', + always_show_bufferline = true, + buffer_close_icon = '', + modified_icon = '', + close_icon = '', + left_trunc_marker = '', + right_trunc_marker = '', + offsets = { + { + filetype = 'neo-tree', + text = 'Neo-tree', + highlight = 'Directory', + text_align = 'left', + }, + }, + }, + }) + end, + }, + { + 'nvim-lualine/lualine.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + config = function() + require('configs.lualine') + end, + }, + { + 'nvim-tree/nvim-web-devicons', + config = true, + }, + { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + event = { 'BufReadPost', 'BufNewFile' }, + opts = { + exclude = { + filetypes = { 'help', 'alpha', 'dashboard', 'neo-tree', 'Trouble', 'lazy' }, + }, + }, + }, + + { + 'utilyre/barbecue.nvim', + name = 'barbecue', + version = '*', + event = { 'BufReadPost', 'BufAdd', 'BufNewFile' }, + dependencies = { + 'SmiteshP/nvim-navic', + }, + opts = {}, + keys = { + { + 'bq', + function() + require('barbecue.ui').toggle() + end, + desc = 'toggle barbecue', + }, + }, + config = function() + require('barbecue').setup({ + create_autocmd = false, -- prevent barbecue from updating itself automatically + }) + + vim.api.nvim_create_autocmd({ + 'WinScrolled', -- or WinResized on NVIM-v0.9 and higher + 'BufWinEnter', + 'CursorHold', + 'InsertLeave', + }, { + group = vim.api.nvim_create_augroup('barbecue.updater', {}), + callback = function() + require('barbecue.ui').update() + end, + }) + end, + }, + { + 'goolord/alpha-nvim', + event = 'VimEnter', + config = function() + require('configs.alpha') + end, + }, +} diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua new file mode 100644 index 0000000..5642189 --- /dev/null +++ b/lua/plugins/whichkey.lua @@ -0,0 +1,166 @@ +return { + 'folke/which-key.nvim', + event = 'UIEnter', + opts = { + preset = 'helix', + icons = { + breadcrumb = ' ', + separator = ' ', + group = '', + rules = false, + }, + triggers = { + { '', mode = 'nixsotc' }, + { '', mode = { 'n', 'v' } }, + }, + spec = { + mode = { 'n', 'v' }, + { '[', group = ' Previous' }, + { ']', group = ' Next' }, + { 'b', group = ' Debug' }, + { 'c', group = ' Code' }, + { 'C', group = ' Comment' }, + { 'd', group = ' Database' }, + { 'e', group = ' Edit' }, + { 'f', group = ' Find' }, + { 'i', group = ' Insert' }, + { 'j', group = ' Jump' }, + { 'k', group = ' Keys' }, + { 'l', group = ' LSP' }, + { 'm', group = '󰠠 Misc' }, + { 'n', group = ' Notes' }, + { 'q', group = ' Quit' }, + { 's', group = ' Split' }, + { 't', group = ' Terminal' }, + { 'u', group = ' Test' }, + { 'v', group = ' Select' }, + { 'w', group = ' Writing' }, + { 'x', group = '󰁨 Diagnostics/Quickfix' }, + { 'y', group = ' Yank' }, + }, + }, + keys = { + { + '?', + function() + require('which-key').show({ global = false }) + end, + desc = ' Buffer Local Keymaps (which-key)', + }, + -- other keymaps + { 'cR', 'ReloadConfig', desc = 'Reload Configs' }, + { 'cd', 'RootDir', desc = 'Root Directory' }, + { 'cl', ':g/^\\s*$/d', desc = 'Clean Empty Lines' }, + { 'co', 'Alpha', desc = 'Alpha' }, + { 'cr', 'Telescope reloader', desc = 'Reload Module' }, + --edit + { 'ea', 'b#', desc = 'Alternate File' }, + { 'ec', 'e $MYVIMRC', desc = 'Config' }, + { + 'ed', + 'lua require("telescope.builtin").find_files({cwd = vim.fn.stdpath("config")})', + desc = 'Config Dir', + }, + { 'ee', 'NvimTreeToggle', desc = 'Explorer' }, + { 'em', 'e README.md', desc = 'Readme' }, + { 'en', 'enew', desc = 'New File' }, + -- split + { 's+', 'resize +10', desc = 'Increase window height' }, + { 's-', 'vertical resize -20', desc = 'Decrease window width' }, + { 's/', 's', desc = 'Split Below' }, + { 's=', 'vertical resize +20', desc = 'Increase window width' }, + { 'sH', 'vertical resize -10', desc = 'Decrease window width' }, + { 'sJ', 'resize -5', desc = 'Decrease window height' }, + { 'sK', 'resize +5', desc = 'Increase window height' }, + { 'sL', 'vertical resize +10', desc = 'Increase window width' }, + { 's\\', 'v', desc = 'Split Right' }, + { 's_', 'resize -10', desc = 'Decrease window height' }, + { 's`', 'p', desc = 'Previous Window' }, + { 'sa', 'split', desc = 'Horizontal Split' }, + { 'sc', 'tabclose', desc = 'Close Tab' }, + { 'sf', 'tabfirst', desc = 'First Tab' }, + { 'sh', 'h', desc = 'Move Left' }, + { 'sj', 'j', desc = 'Move Down' }, + { 'sk', 'k', desc = 'Move Up' }, + { 'sl', 'l', desc = 'Move Right' }, + { 'sp', 'NavigatorPrevious', desc = 'Previous Pane' }, + { 'sq', 'c', desc = 'Close Split' }, + { 'ss', 'vsplit', desc = 'Vertical Split' }, + -- select + { 'vB', 'vab', desc = 'Around Bracket' }, + { 'vP', 'vap', desc = 'Around Para' }, + { 'vQ', 'vaq', desc = 'Around Quote' }, + { 'vb', 'vib', desc = 'Bracket' }, + { 'vp', 'vip', desc = 'Paragraph' }, + { 'vq', 'viq', desc = 'Quote' }, + -- writing + { 'wc', 'set spell!', desc = 'Spellcheck' }, + { 'wf', "lua require'utils'.sudo_write()", desc = 'Force Write' }, + { 'wj', ']s', desc = 'Next Misspell' }, + { 'wk', '[s', desc = 'Prev Misspell' }, + { 'wq', 'wq', desc = 'Write and Quit' }, + { 'ws', 'Telescope spell_suggest', desc = 'Suggestions' }, + { 'ww', 'w', desc = 'Write and Quit' }, + { 'x', 'x', desc = ' Save and Quit' }, + --quit + { 'qa', 'qall', desc = 'Quit All' }, + { 'qc', 'bw', desc = 'Close Buffer' }, + { 'qd', 'bdelete', desc = 'Delete Buffer' }, + { 'qf', 'qall!', desc = 'Force Quit' }, + { 'qo', ':%bdelete|b#|bdelete#', desc = 'Close Others' }, + { 'qq', 'q', desc = 'Quit' }, + { 'qs', 'c', desc = 'Close Split' }, + { 'qw', 'wq', desc = 'Write and Quit' }, + -- insert + { 'iP', 'put %:p', desc = 'Absolute Path' }, + { 'id', "put =strftime('## %a, %d %b, %Y, %r')", desc = 'Date' }, + { 'ie', 'Telescope symbols', desc = 'Emojis' }, + { 'if', "put =expand('%:t')", desc = 'File Name' }, + { 'in', 'Nerdy', desc = 'Nerd Glyphs' }, + { 'ip', 'put %', desc = 'Relative Path' }, + { 'ir', 'Telescope registers', desc = 'Registers' }, + { 'it', "put =strftime('## %r')", desc = 'Time' }, + + -- Visiual Mode + { 'cS', ':sort!', mode = 'v', desc = 'Sort Desc' }, + { 'ci', ':sort i', mode = 'v', desc = 'Sort Case Insensitive' }, + { 'cs', ':sort', mode = 'v', desc = 'Sort Asc' }, + { 'cu', ':!uniq', mode = 'v', desc = 'Unique' }, + + { 'la', mode = 'v', desc = 'Lspsaga range_code_action' }, + + -- no leader + { '[B', 'bfirst', desc = 'First Buffer' }, + { '[b', 'bprevious', desc = 'Buffer' }, + { '[d', 'Lspsaga diagnostic_jump_prev', desc = 'Diagnostic' }, + { '[e', 'g;', desc = 'Edit' }, + { '[j', '', desc = 'Jump' }, + + { ']', group = ' Next' }, + { ']B', 'blast', desc = 'Buffer' }, + { ']b', 'bnext', desc = 'Buffer' }, + { ']d', 'Lspsaga diagnostic_jump_next', desc = 'Diagnostic' }, + { ']e', 'g,', desc = 'Edit' }, + { ']j', '', desc = 'Jump' }, + + { '', 'resize -10', desc = 'Decrease window height' }, + { '', 'vertical resize -10', desc = 'Decrease window width' }, + { '', 'vertical resize +10', desc = 'Increase window width' }, + { '', 'resize +10', desc = 'Increase window height' }, + { '', 'Telescope find_files', desc = 'Find Files' }, + { '', 'Telescope file_browser', desc = 'Find browser' }, + + { '', 'h', desc = 'Move Left' }, + { '', 'j', desc = 'Move Down' }, + { '', 'k', desc = 'Move Up' }, + { '', 'l', desc = 'Move Right' }, + { '', 'p', desc = 'Previous Pane' }, + + { '', 'bprevious', desc = 'Previous Buffer' }, + { '', 'bnext', desc = 'Next Buffer' }, + + { 'K', 'Lspsaga hover_doc', desc = 'LSP Hover' }, + { 'Q', 'qall!', desc = 'Force Quit!' }, + { 'U', 'redo', desc = 'Redo' }, + }, +}