From cd2fa35a4f266ce59867b7e84da3263fd645a797 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 29 Aug 2024 14:25:43 +0545 Subject: [PATCH] wip --- dotfyle.json | 2 +- lua/configs/dashboard.lua | 73 ---- lua/configs/mason.lua | 44 -- lua/configs/none-ls.lua | 64 --- lua/core/autocmd.lua | 230 ++++++---- lua/core/function.lua | 126 ------ lua/core/keys.lua | 103 ++--- lua/core/options.lua | 119 +++--- lua/lock.json | 23 +- lua/mason-lock.json | 5 +- lua/plugins/coding.lua | 472 +++++++++------------ lua/plugins/colorscheme.lua | 58 +-- lua/{ => plugins}/configs/cmp.lua | 0 lua/plugins/configs/dashboard.lua | 73 ++++ lua/plugins/configs/jump.lua | 57 +++ lua/{ => plugins}/configs/lsp.lua | 100 ++--- lua/{ => plugins}/configs/lualine.lua | 0 lua/plugins/configs/spectre.lua | 125 ++++++ lua/{ => plugins}/configs/telescope.lua | 1 - lua/{ => plugins}/configs/toggleterm.lua | 0 lua/plugins/configs/whichkey.lua | 508 +++++++++++++++++++++++ lua/plugins/configs/zen&twilight.lua | 41 ++ lua/plugins/dap.lua | 12 - lua/plugins/database.lua | 10 - lua/plugins/editor.lua | 433 ++++++++----------- lua/plugins/extra.lua | 122 +++--- lua/plugins/lint.lua | 5 +- lua/plugins/lsp.lua | 12 +- lua/plugins/test.lua | 13 - lua/plugins/ui.lua | 361 ++++++++-------- lua/plugins/whichkey.lua | 170 -------- 31 files changed, 1745 insertions(+), 1617 deletions(-) delete mode 100644 lua/configs/dashboard.lua delete mode 100644 lua/configs/mason.lua delete mode 100644 lua/configs/none-ls.lua delete mode 100644 lua/core/function.lua rename lua/{ => plugins}/configs/cmp.lua (100%) create mode 100644 lua/plugins/configs/dashboard.lua create mode 100644 lua/plugins/configs/jump.lua rename lua/{ => plugins}/configs/lsp.lua (54%) rename lua/{ => plugins}/configs/lualine.lua (100%) create mode 100644 lua/plugins/configs/spectre.lua rename lua/{ => plugins}/configs/telescope.lua (99%) rename lua/{ => plugins}/configs/toggleterm.lua (100%) create mode 100644 lua/plugins/configs/whichkey.lua create mode 100644 lua/plugins/configs/zen&twilight.lua delete mode 100644 lua/plugins/whichkey.lua diff --git a/dotfyle.json b/dotfyle.json index 51326f1..f3b0035 100644 --- a/dotfyle.json +++ b/dotfyle.json @@ -1 +1 @@ -{"distribution": "custom", "masonTools": ["basedpyright", "basedpyright-langserver", "bash-language-server", "black", "clang-format", "clangd", "codespell", "cpplint", "cspell", "emmet-ls", "eslint_d", "isort", "jdtls", "lua-language-server", "markdownlint", "mypy", "phpcs", "prettier", "pylint", "ruff", "selene", "shfmt", "stylua", "tailwindcss-language-server", "trivy", "typescript-language-server"], "plugins": ["2kabhishek/nerdy.nvim", "2kabhishek/tdo.nvim", "2kabhishek/termim.nvim", "CRAG666/code_runner.nvim", "Exafunction/codeium.vim", "HiPhish/rainbow-delimiters.nvim", "L3MON4D3/LuaSnip", "LudoPinelli/comment-box.nvim", "LunarVim/bigfile.nvim", "MunifTanjim/nui.nvim", "NStefan002/screenkey.nvim", "ThePrimeagen/refactoring.nvim", "akinsho/toggleterm.nvim", "altermo/ultimate-autopair.nvim", "antosha417/nvim-lsp-file-operations", "creativenull/dotfyle-metadata.nvim", "debugloop/telescope-undo.nvim", "echasnovski/mini.files", "echasnovski/mini.icons", "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", "hrsh7th/cmp-buffer", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp-signature-help", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-path", "hrsh7th/nvim-cmp", "iamcco/markdown-preview.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", "mfussenegger/nvim-lint", "mg979/vim-visual-multi", "mstuttgart/odoo-snippets", "mvllow/modes.nvim", "nacro90/numb.nvim", "navarasu/onedark.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-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-textobjects", "nvimdev/dashboard-nvim", "nvimdev/lspsaga.nvim", "olimorris/neotest-rspec", "onsails/lspkind.nvim", "rafamadriz/friendly-snippets", "rcarriga/nvim-dap-ui", "rcarriga/nvim-notify", "rshkarin/mason-nvim-lint", "saadparwaiz1/cmp_luasnip", "smjonas/inc-rename.nvim", "stevearc/conform.nvim", "stevearc/dressing.nvim", "szw/vim-maximizer", "tpope/vim-dadbod", "wakatime/vim-wakatime", "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "willothy/flatten.nvim", "windwp/nvim-ts-autotag", "zapling/mason-conform.nvim", "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": "Lspsaga | Code Outline", "noremap": true, "lhs": "lo", "mode": "n", "rhs": "Lspsaga outline"}, {"desc": "Reload Module", "noremap": true, "lhs": "cr", "mode": "n", "rhs": "Telescope reloader"}, {"desc": "Fuzzy Find in File", "noremap": true, "lhs": "fs", "mode": "n", "rhs": "Telescope current_buffer_fuzzy_find"}, {"desc": "Quickfix", "noremap": true, "lhs": "fq", "mode": "n", "rhs": "Telescope quickfix"}, {"desc": "Undo History", "noremap": true, "lhs": "fu", "mode": "n", "rhs": "Telescope undo"}, {"desc": "Notifications", "noremap": true, "lhs": "cn", "mode": "n", "rhs": "Telescope notify"}, {"desc": "File Browser", "noremap": true, "lhs": "ef", "mode": "n", "rhs": "Telescope file_browser"}, {"desc": "Diagnostics", "noremap": true, "lhs": "fd", "mode": "n", "rhs": "Telescope diagnostics"}, {"desc": "Search History", "noremap": true, "lhs": "ks", "mode": "n", "rhs": "Telescope search_history"}, {"desc": "Command History", "noremap": true, "lhs": "kh", "mode": "n", "rhs": "Telescope command_history"}, {"desc": "Commands", "noremap": true, "lhs": "kc", "mode": "n", "rhs": "Telescope commands"}, {"desc": "Keymaps", "noremap": true, "lhs": "kk", "mode": "n", "rhs": "Telescope keymaps"}, {"desc": "Grep String", "noremap": true, "lhs": "fG", "mode": "n", "rhs": "Telescope grep_string"}, {"desc": "Find Highlight Groups", "noremap": true, "lhs": "fH", "mode": "n", "rhs": "Telescope highlights"}, {"desc": "Marks", "noremap": true, "lhs": "fm", "mode": "n", "rhs": "Telescope marks"}, {"desc": "Old Recent Files", "noremap": true, "lhs": "fo", "mode": "n", "rhs": "Telescope oldfiles"}, {"desc": "Find Help", "noremap": true, "lhs": "fh", "mode": "n", "rhs": "Telescope help_tags"}, {"desc": "Buffers", "noremap": true, "lhs": "fb", "mode": "n", "rhs": "Telescope buffers"}, {"desc": "Live Grep", "noremap": true, "lhs": "fg", "mode": "n", "rhs": "Telescope live_grep"}, {"desc": "Find Files (CWD)", "noremap": true, "lhs": "ff", "mode": "n", "rhs": "Telescope find_files"}, {"desc": "Toggle IA (Codeium)", "noremap": true, "lhs": "cI", "mode": "n", "rhs": "CodeiumToggle"}, {"desc": "Relative Path", "noremap": true, "lhs": "yp", "mode": "n", "rhs": "CopyRelativePath"}, {"desc": "Copy Git URL", "noremap": true, "lhs": "yg", "mode": "n", "rhs": "lua require\"gitlinker\".get_buf_range_url()"}, {"desc": "File Name", "noremap": true, "lhs": "yf", "mode": "n", "rhs": "CopyFileName"}, {"desc": "Copy Whole File", "noremap": true, "lhs": "ya", "mode": "n", "rhs": "%y+"}, {"desc": "Absolute Path", "noremap": true, "lhs": "yP", "mode": "n", "rhs": "CopyAbsolutePath"}, {"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": "Trigger linting for current file", "noremap": true, "lhs": "cl", "mode": "n", "rhs": ""}, {"desc": "Toggle auto-format on-save globally.", "noremap": true, "lhs": "cft", "mode": "n", "rhs": ""}, {"desc": "Toggle auto-format on-save for buffer.", "noremap": true, "lhs": "cfb", "mode": "n", "rhs": ""}, {"desc": "Format file or range (in visual mode)", "noremap": true, "lhs": "cff", "mode": "v", "rhs": ""}, {"desc": "Format file or range (in visual mode)", "noremap": true, "lhs": "cff", "mode": "n", "rhs": ""}, {"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": "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": "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": "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": "New File", "noremap": true, "lhs": "en", "mode": "n", "rhs": "enew"}, {"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": "Dashboard", "noremap": true, "lhs": "co", "mode": "n", "rhs": "Dashboard"}, {"desc": "Clean Empty Lines", "noremap": true, "lhs": "cc", "mode": "n", "rhs": ":g/^\\s*$/d"}, {"desc": "Root Directory", "noremap": true, "lhs": "cd", "mode": "n", "rhs": "RootDir"}, {"desc": "Reload Configs", "noremap": true, "lhs": "cR", "mode": "n", "rhs": "ReloadConfig"}, {"desc": " Buffer Local Keymaps (which-key)", "noremap": true, "lhs": "?", "mode": "n", "rhs": ""}, {"desc": "Unique", "noremap": true, "lhs": "cu", "mode": "v", "rhs": ":!uniq"}, {"desc": "Sort Asc", "noremap": true, "lhs": "cs", "mode": "v", "rhs": ":sort"}, {"desc": "Sort Case Insensitive", "noremap": true, "lhs": "ci", "mode": "v", "rhs": ":sort i"}, {"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": "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": "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": "Dismiss All Notifications", "noremap": true, "lhs": "mn", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "mt", "mode": "n", "rhs": "lua require(\"onedark\").toggle()"}, {"desc": "Chat with IA (Codeium)", "noremap": true, "lhs": "ch", "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": "Location List (Trouble)", "noremap": true, "lhs": "xL", "mode": "n", "rhs": ""}, {"desc": "LSP references/definitions/... (Trouble)", "noremap": true, "lhs": "xS", "mode": "n", "rhs": ""}, {"desc": "Replace in Files (Spectre)", "noremap": true, "lhs": "mr", "mode": "n", "rhs": ""}, {"desc": "Maximize/minimize a split", "noremap": true, "lhs": "mm", "mode": "n", "rhs": ""}, {"desc": "Into", "noremap": true, "lhs": "bi", "mode": "n", "rhs": ""}, {"desc": "Continue", "noremap": true, "lhs": "bc", "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": "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": "Run Current Test", "noremap": true, "lhs": "uc", "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 zen mode", "noremap": true, "lhs": "wz", "mode": "n", "rhs": ""}, {"desc": "toggle markdown preview", "noremap": true, "lhs": "cm", "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": "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": "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": "DB Last query", "noremap": true, "lhs": "dl", "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": "t2", "mode": "n", "rhs": ""}, {"desc": "Toggle Terminal", "noremap": true, "lhs": "t1", "mode": "n", "rhs": ""}, {"desc": "Toggle keys", "noremap": true, "lhs": "kt", "mode": "n", "rhs": "Screenkey"}, {"desc": "Close Code Run ", "noremap": true, "lhs": "rx", "mode": "n", "rhs": "RunClose"}, {"desc": "Run Code Project ", "noremap": true, "lhs": "rp", "mode": "n", "rhs": "RunProject"}, {"desc": "Run Code File ", "noremap": true, "lhs": "rf", "mode": "n", "rhs": "RunFile"}, {"desc": "Run Code ", "noremap": true, "lhs": "rc", "mode": "n", "rhs": "RunCode"}, {"desc": ":help v_#-default", "noremap": true, "lhs": "#", "mode": "x", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "%", "mode": "x", "rhs": "(MatchitVisualForward)"}, {"desc": "", "noremap": false, "lhs": "%", "mode": "n", "rhs": "(MatchitNormalForward)"}, {"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": "x", "rhs": "(YankyPutBefore)"}, {"desc": "Put yanked text before cursor", "noremap": true, "lhs": "P", "mode": "n", "rhs": "(YankyPutBefore)"}, {"desc": "Force Quit!", "noremap": true, "lhs": "Q", "mode": "n", "rhs": "qall!"}, {"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": "Undo backward", "noremap": true, "lhs": "[u", "mode": "n", "rhs": "lua MiniBracketed.undo('backward')"}, {"desc": "Undo first", "noremap": true, "lhs": "[U", "mode": "n", "rhs": "lua MiniBracketed.undo('first')"}, {"desc": "Treesitter backward", "noremap": true, "lhs": "[n", "mode": "x", "rhs": "lua MiniBracketed.treesitter('backward')"}, {"desc": "Treesitter backward", "noremap": true, "lhs": "[n", "mode": "n", "rhs": "lua MiniBracketed.treesitter('backward')"}, {"desc": "Treesitter first", "noremap": true, "lhs": "[N", "mode": "x", "rhs": "lua MiniBracketed.treesitter('first')"}, {"desc": "Treesitter first", "noremap": true, "lhs": "[N", "mode": "n", "rhs": "lua MiniBracketed.treesitter('first')"}, {"desc": "Location backward", "noremap": true, "lhs": "[l", "mode": "n", "rhs": "lua MiniBracketed.location('backward')"}, {"desc": "Location first", "noremap": true, "lhs": "[L", "mode": "n", "rhs": "lua MiniBracketed.location('first')"}, {"desc": "Oldfile backward", "noremap": true, "lhs": "[o", "mode": "n", "rhs": "lua MiniBracketed.oldfile('backward')"}, {"desc": "Oldfile first", "noremap": true, "lhs": "[O", "mode": "n", "rhs": "lua MiniBracketed.oldfile('first')"}, {"desc": "Jump first", "noremap": true, "lhs": "[J", "mode": "n", "rhs": "lua MiniBracketed.jump('first')"}, {"desc": "Indent backward", "noremap": true, "lhs": "[i", "mode": "x", "rhs": "lua MiniBracketed.indent('backward')"}, {"desc": "Indent backward", "noremap": true, "lhs": "[i", "mode": "n", "rhs": "lua MiniBracketed.indent('backward')"}, {"desc": "Indent first", "noremap": true, "lhs": "[I", "mode": "x", "rhs": "lua MiniBracketed.indent('first')"}, {"desc": "Indent first", "noremap": true, "lhs": "[I", "mode": "n", "rhs": "lua MiniBracketed.indent('first')"}, {"desc": "Diagnostic backward", "noremap": true, "lhs": "[d", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('backward')"}, {"desc": "Diagnostic first", "noremap": true, "lhs": "[D", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('first')"}, {"desc": "Diagnostic first", "noremap": true, "lhs": "[D", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('first')"}, {"desc": "Conflict backward", "noremap": true, "lhs": "[x", "mode": "x", "rhs": "lua MiniBracketed.conflict('backward')"}, {"desc": "Conflict backward", "noremap": true, "lhs": "[x", "mode": "n", "rhs": "lua MiniBracketed.conflict('backward')"}, {"desc": "Conflict first", "noremap": true, "lhs": "[X", "mode": "x", "rhs": "lua MiniBracketed.conflict('first')"}, {"desc": "Conflict first", "noremap": true, "lhs": "[X", "mode": "n", "rhs": "lua MiniBracketed.conflict('first')"}, {"desc": "Comment backward", "noremap": true, "lhs": "[c", "mode": "x", "rhs": "lua MiniBracketed.comment('backward')"}, {"desc": "Comment backward", "noremap": true, "lhs": "[c", "mode": "n", "rhs": "lua MiniBracketed.comment('backward')"}, {"desc": "Comment first", "noremap": true, "lhs": "[C", "mode": "x", "rhs": "lua MiniBracketed.comment('first')"}, {"desc": "Comment first", "noremap": true, "lhs": "[C", "mode": "n", "rhs": "lua MiniBracketed.comment('first')"}, {"desc": "Buffer first", "noremap": true, "lhs": "[B", "mode": "n", "rhs": "lua MiniBracketed.buffer('first')"}, {"desc": "Buffer backward", "noremap": true, "lhs": "[b", "mode": "n", "rhs": "lua MiniBracketed.buffer('backward')"}, {"desc": "Diagnostic backward", "noremap": true, "lhs": "[d", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('backward')"}, {"desc": "Edit", "noremap": true, "lhs": "[e", "mode": "n", "rhs": "g;"}, {"desc": "Jump backward", "noremap": true, "lhs": "[j", "mode": "n", "rhs": "lua MiniBracketed.jump('backward')"}, {"desc": "", "noremap": false, "lhs": "[%", "mode": "x", "rhs": "(MatchitVisualMultiBackward)"}, {"desc": "", "noremap": false, "lhs": "[%", "mode": "n", "rhs": "(MatchitNormalMultiBackward)"}, {"desc": "Previous Trouble/Quickfix Item", "noremap": true, "lhs": "[q", "mode": "n", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "\\\\c", "mode": "x", "rhs": "(VM-Visual-Cursors)"}, {"desc": "", "noremap": false, "lhs": "\\\\gS", "mode": "n", "rhs": "(VM-Reselect-Last)"}, {"desc": "", "noremap": false, "lhs": "\\\\/", "mode": "n", "rhs": "(VM-Start-Regex-Search)"}, {"desc": "", "noremap": false, "lhs": "\\\\\\", "mode": "n", "rhs": "(VM-Add-Cursor-At-Pos)"}, {"desc": "", "noremap": false, "lhs": "\\\\a", "mode": "x", "rhs": "(VM-Visual-Add)"}, {"desc": "", "noremap": false, "lhs": "\\\\f", "mode": "x", "rhs": "(VM-Visual-Find)"}, {"desc": "", "noremap": false, "lhs": "\\\\/", "mode": "x", "rhs": "(VM-Visual-Regex)"}, {"desc": "", "noremap": false, "lhs": "\\\\A", "mode": "x", "rhs": "(VM-Visual-All)"}, {"desc": "", "noremap": false, "lhs": "\\\\A", "mode": "n", "rhs": "(VM-Select-All)"}, {"desc": "Undo forward", "noremap": true, "lhs": "]u", "mode": "n", "rhs": "lua MiniBracketed.undo('forward')"}, {"desc": "Undo last", "noremap": true, "lhs": "]U", "mode": "n", "rhs": "lua MiniBracketed.undo('last')"}, {"desc": "Treesitter forward", "noremap": true, "lhs": "]n", "mode": "x", "rhs": "lua MiniBracketed.treesitter('forward')"}, {"desc": "Treesitter forward", "noremap": true, "lhs": "]n", "mode": "n", "rhs": "lua MiniBracketed.treesitter('forward')"}, {"desc": "Treesitter last", "noremap": true, "lhs": "]N", "mode": "x", "rhs": "lua MiniBracketed.treesitter('last')"}, {"desc": "Treesitter last", "noremap": true, "lhs": "]N", "mode": "n", "rhs": "lua MiniBracketed.treesitter('last')"}, {"desc": "Location forward", "noremap": true, "lhs": "]l", "mode": "n", "rhs": "lua MiniBracketed.location('forward')"}, {"desc": "Location last", "noremap": true, "lhs": "]L", "mode": "n", "rhs": "lua MiniBracketed.location('last')"}, {"desc": "Oldfile forward", "noremap": true, "lhs": "]o", "mode": "n", "rhs": "lua MiniBracketed.oldfile('forward')"}, {"desc": "Oldfile last", "noremap": true, "lhs": "]O", "mode": "n", "rhs": "lua MiniBracketed.oldfile('last')"}, {"desc": "Jump last", "noremap": true, "lhs": "]J", "mode": "n", "rhs": "lua MiniBracketed.jump('last')"}, {"desc": "Indent forward", "noremap": true, "lhs": "]i", "mode": "x", "rhs": "lua MiniBracketed.indent('forward')"}, {"desc": "Indent forward", "noremap": true, "lhs": "]i", "mode": "n", "rhs": "lua MiniBracketed.indent('forward')"}, {"desc": "Indent last", "noremap": true, "lhs": "]I", "mode": "x", "rhs": "lua MiniBracketed.indent('last')"}, {"desc": "Indent last", "noremap": true, "lhs": "]I", "mode": "n", "rhs": "lua MiniBracketed.indent('last')"}, {"desc": "Diagnostic forward", "noremap": true, "lhs": "]d", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('forward')"}, {"desc": "Diagnostic last", "noremap": true, "lhs": "]D", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('last')"}, {"desc": "Diagnostic last", "noremap": true, "lhs": "]D", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('last')"}, {"desc": "Conflict forward", "noremap": true, "lhs": "]x", "mode": "x", "rhs": "lua MiniBracketed.conflict('forward')"}, {"desc": "Conflict forward", "noremap": true, "lhs": "]x", "mode": "n", "rhs": "lua MiniBracketed.conflict('forward')"}, {"desc": "Conflict last", "noremap": true, "lhs": "]X", "mode": "x", "rhs": "lua MiniBracketed.conflict('last')"}, {"desc": "Conflict last", "noremap": true, "lhs": "]X", "mode": "n", "rhs": "lua MiniBracketed.conflict('last')"}, {"desc": "Comment forward", "noremap": true, "lhs": "]c", "mode": "x", "rhs": "lua MiniBracketed.comment('forward')"}, {"desc": "Comment forward", "noremap": true, "lhs": "]c", "mode": "n", "rhs": "lua MiniBracketed.comment('forward')"}, {"desc": "Comment last", "noremap": true, "lhs": "]C", "mode": "x", "rhs": "lua MiniBracketed.comment('last')"}, {"desc": "Comment last", "noremap": true, "lhs": "]C", "mode": "n", "rhs": "lua MiniBracketed.comment('last')"}, {"desc": "Buffer last", "noremap": true, "lhs": "]B", "mode": "n", "rhs": "lua MiniBracketed.buffer('last')"}, {"desc": "Buffer forward", "noremap": true, "lhs": "]b", "mode": "n", "rhs": "lua MiniBracketed.buffer('forward')"}, {"desc": "Diagnostic forward", "noremap": true, "lhs": "]d", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('forward')"}, {"desc": "Edit", "noremap": true, "lhs": "]e", "mode": "n", "rhs": "g,"}, {"desc": "Jump forward", "noremap": true, "lhs": "]j", "mode": "n", "rhs": "lua MiniBracketed.jump('forward')"}, {"desc": "", "noremap": false, "lhs": "]%", "mode": "x", "rhs": "(MatchitVisualMultiForward)"}, {"desc": "", "noremap": false, "lhs": "]%", "mode": "n", "rhs": "(MatchitNormalMultiForward)"}, {"desc": "Next Trouble/Quickfix Item", "noremap": true, "lhs": "]q", "mode": "n", "rhs": ""}, {"desc": "Around last textobject", "noremap": false, "lhs": "al", "mode": "x", "rhs": ""}, {"desc": "Around next textobject", "noremap": false, "lhs": "an", "mode": "x", "rhs": ""}, {"desc": "Around textobject", "noremap": false, "lhs": "a", "mode": "x", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "a%", "mode": "x", "rhs": "(MatchitVisualTextObject)"}, {"desc": "Change without replacing clipboad", "noremap": true, "lhs": "c", "mode": "n", "rhs": "\"_c"}, {"desc": "Delete without replacing clipboad", "noremap": true, "lhs": "d", "mode": "n", "rhs": "\"_d"}, {"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": "x", "rhs": "(YankyGPutAfter)"}, {"desc": "Put yanked text after selection", "noremap": true, "lhs": "gp", "mode": "n", "rhs": "(YankyGPutAfter)"}, {"desc": "Put yanked text before selection", "noremap": true, "lhs": "gP", "mode": "n", "rhs": "(YankyGPutBefore)"}, {"desc": "Put yanked text before selection", "noremap": true, "lhs": "gP", "mode": "x", "rhs": "(YankyGPutBefore)"}, {"desc": "Highlight next surrounding", "noremap": true, "lhs": "gshn", "mode": "n", "rhs": ""}, {"desc": "Find next left surrounding", "noremap": true, "lhs": "gsFn", "mode": "n", "rhs": ""}, {"desc": "Find next right surrounding", "noremap": true, "lhs": "gsfn", "mode": "n", "rhs": ""}, {"desc": "Replace next surrounding", "noremap": true, "lhs": "gsrn", "mode": "n", "rhs": ""}, {"desc": "Delete next surrounding", "noremap": true, "lhs": "gsdn", "mode": "n", "rhs": ""}, {"desc": "Highlight previous surrounding", "noremap": true, "lhs": "gshl", "mode": "n", "rhs": ""}, {"desc": "Find previous left surrounding", "noremap": true, "lhs": "gsFl", "mode": "n", "rhs": ""}, {"desc": "Find previous right surrounding", "noremap": true, "lhs": "gsfl", "mode": "n", "rhs": ""}, {"desc": "Replace previous surrounding", "noremap": true, "lhs": "gsrl", "mode": "n", "rhs": ""}, {"desc": "Delete previous surrounding", "noremap": true, "lhs": "gsdl", "mode": "n", "rhs": ""}, {"desc": "Add surrounding to selection", "noremap": true, "lhs": "gsa", "mode": "x", "rhs": ":lua MiniSurround.add('visual')"}, {"desc": "Update `MiniSurround.config.n_lines`", "noremap": true, "lhs": "gsn", "mode": "n", "rhs": ""}, {"desc": "Highlight surrounding", "noremap": true, "lhs": "gsh", "mode": "n", "rhs": ""}, {"desc": "Find left surrounding", "noremap": true, "lhs": "gsF", "mode": "n", "rhs": ""}, {"desc": "Find right surrounding", "noremap": true, "lhs": "gsf", "mode": "n", "rhs": ""}, {"desc": "Replace surrounding", "noremap": true, "lhs": "gsr", "mode": "n", "rhs": ""}, {"desc": "Delete surrounding", "noremap": true, "lhs": "gsd", "mode": "n", "rhs": ""}, {"desc": "Add surrounding", "noremap": true, "lhs": "gsa", "mode": "n", "rhs": ""}, {"desc": "Move to right \"around\"", "noremap": false, "lhs": "g]", "mode": "x", "rhs": ""}, {"desc": "Move to right \"around\"", "noremap": false, "lhs": "g]", "mode": "n", "rhs": ""}, {"desc": "Move to left \"around\"", "noremap": false, "lhs": "g[", "mode": "x", "rhs": ""}, {"desc": "Move to left \"around\"", "noremap": false, "lhs": "g[", "mode": "n", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "g%", "mode": "x", "rhs": "(MatchitVisualBackward)"}, {"desc": "", "noremap": false, "lhs": "g%", "mode": "n", "rhs": "(MatchitNormalBackward)"}, {"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": "Comment line", "noremap": true, "lhs": "gcc", "mode": "n", "rhs": ""}, {"desc": "Comment selection", "noremap": true, "lhs": "gc", "mode": "x", "rhs": ""}, {"desc": "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": "Inside last textobject", "noremap": false, "lhs": "il", "mode": "x", "rhs": ""}, {"desc": "Inside next textobject", "noremap": false, "lhs": "in", "mode": "x", "rhs": ""}, {"desc": "Inside textobject", "noremap": false, "lhs": "i", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "j", "mode": "v", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "j", "mode": "n", "rhs": "v:count == 0 ? 'gj' : 'j'"}, {"desc": "", "noremap": true, "lhs": "k", "mode": "v", "rhs": ""}, {"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": "x", "rhs": "(YankyPutAfter)"}, {"desc": "Put yanked text after cursor", "noremap": true, "lhs": "p", "mode": "n", "rhs": "(YankyPutAfter)"}, {"desc": "", "noremap": true, "lhs": "t", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "t", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "u", "mode": "n", "rhs": "ulua MiniBracketed.register_undo_state()"}, {"desc": "Cut without replacing clipboad", "noremap": true, "lhs": "x", "mode": "n", "rhs": "\"_x"}, {"desc": "", "noremap": true, "lhs": "x", "mode": "x", "rhs": "\"_x"}, {"desc": "Yank text", "noremap": true, "lhs": "y", "mode": "n", "rhs": "(YankyYank)"}, {"desc": "Yank text", "noremap": true, "lhs": "y", "mode": "x", "rhs": "(YankyYank)"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "(YankyCycleForward)"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "(YankyCycleBackward)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "x", "rhs": "(VM-Find-Subword-Under)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Select-l)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Select-h)"}, {"desc": "Multi Edit Next", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#ctrln(v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_up(0, v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_down(0, v:count1)"}, {"desc": "Add Cursor Up", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_up(0, v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_down(0, v:count1)"}, {"desc": "Move line up", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('up')"}, {"desc": "Move line down", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('down')"}, {"desc": "Move line right", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('right')"}, {"desc": "Move line left", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('left')"}, {"desc": "Move up", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('up')"}, {"desc": "Move down", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('down')"}, {"desc": "Move right", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('right')"}, {"desc": "Move left", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('left')"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniBracketed.register_undo_state()"}, {"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": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Add-Cursor-Up)"}, {"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": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Add-Cursor-Down)"}, {"desc": "Move Left", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "Move Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "Move Up", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "Previous Pane", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "zz"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "zz"}, {"desc": "Save File", "noremap": true, "lhs": "", "mode": "n", "rhs": "up"}, {"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": "Move Right", "noremap": true, "lhs": "", "mode": "n", "rhs": ""}], "treesitterParsers": ["bash", "c", "cpp", "css", "html", "java", "javascript", "json", "liquid", "lua", "markdown", "markdown_inline", "python", "scss", "toml", "tsx", "typescript", "vim", "vimdoc"], "lspServers": ["basedpyright", "bashls", "clangd", "emmet_ls", "jdtls", "lua_ls", "ruff", "tailwindcss", "tsserver"], "leaderKey": ""} \ No newline at end of file +{"distribution": "custom", "masonTools": ["basedpyright", "basedpyright-langserver", "bash-language-server", "black", "clang-format", "clangd", "codespell", "cspell", "emmet-ls", "eslint_d", "isort", "jdtls", "lua-language-server", "markdownlint", "mypy", "phpcs", "prettier", "pylint", "ruff", "shfmt", "stylua", "tailwindcss-language-server", "trivy", "typescript-language-server"], "plugins": ["2kabhishek/nerdy.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", "ThePrimeagen/refactoring.nvim", "akinsho/toggleterm.nvim", "altermo/ultimate-autopair.nvim", "antosha417/nvim-lsp-file-operations", "creativenull/dotfyle-metadata.nvim", "debugloop/telescope-undo.nvim", "echasnovski/mini.files", "echasnovski/mini.icons", "echasnovski/mini.nvim", "folke/flash.nvim", "folke/lazy.nvim", "folke/noice.nvim", "folke/persistence.nvim", "folke/trouble.nvim", "folke/twilight.nvim", "folke/which-key.nvim", "folke/zen-mode.nvim", "gbprod/yanky.nvim", "hrsh7th/cmp-buffer", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp-signature-help", "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-path", "hrsh7th/nvim-cmp", "iamcco/markdown-preview.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", "mfussenegger/nvim-lint", "mg979/vim-visual-multi", "michaelb/sniprun", "mstuttgart/odoo-snippets", "mvllow/modes.nvim", "nacro90/numb.nvim", "navarasu/onedark.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-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-textobjects", "nvimdev/dashboard-nvim", "nvimdev/lspsaga.nvim", "olimorris/neotest-rspec", "onsails/lspkind.nvim", "rafamadriz/friendly-snippets", "rcarriga/nvim-dap-ui", "rcarriga/nvim-notify", "rshkarin/mason-nvim-lint", "saadparwaiz1/cmp_luasnip", "smjonas/inc-rename.nvim", "stevearc/conform.nvim", "stevearc/dressing.nvim", "tpope/vim-dadbod", "uga-rosa/ccc.nvim", "wakatime/vim-wakatime", "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "willothy/flatten.nvim", "windwp/nvim-ts-autotag", "zapling/mason-conform.nvim", "zapling/mason-lock.nvim"], "pluginManager": "lazy.nvim", "keymaps": [{"desc": "Escape and clear hlsearch", "noremap": true, "lhs": "", "mode": "n", "rhs": "noh"}, {"desc": "Toggle IA (Codeium)", "noremap": true, "lhs": "cI", "mode": "n", "rhs": "CodeiumToggle"}, {"desc": "Toggle auto-format on-save globally.", "noremap": true, "lhs": "cft", "mode": "n", "rhs": ""}, {"desc": "Toggle auto-format on-save for buffer.", "noremap": true, "lhs": "cfb", "mode": "n", "rhs": ""}, {"desc": "Format file or range (in visual mode)", "noremap": true, "lhs": "cff", "mode": "v", "rhs": ""}, {"desc": "Format file or range (in visual mode)", "noremap": true, "lhs": "cff", "mode": "n", "rhs": ""}, {"desc": "Trigger linting for current file", "noremap": true, "lhs": "cL", "mode": "n", "rhs": ""}, {"desc": "Left File Explorer", "noremap": true, "lhs": "", "mode": "n", "rhs": ":Neotree toggle left"}, {"desc": "Copy Git URL", "noremap": true, "lhs": "yg", "mode": "v", "rhs": "lua require\"gitlinker\".get_buf_range_url(\"v\")"}, {"desc": "Extract Variable", "noremap": true, "lhs": "rv", "mode": "v", "rhs": "lua require('refactoring').refactor('Extract Variable')"}, {"desc": "Refactor Commands", "noremap": true, "lhs": "rr", "mode": "v", "rhs": "lua require('telescope').extensions.refactoring.refactors()"}, {"desc": "Inline Variable", "noremap": true, "lhs": "ri", "mode": "v", "rhs": "lua require('refactoring').refactor('Inline Variable')"}, {"desc": "Extract To File", "noremap": true, "lhs": "rf", "mode": "v", "rhs": "lua require('refactoring').refactor('Extract Function To File')"}, {"desc": "Extract Function", "noremap": true, "lhs": "re", "mode": "v", "rhs": "lua require('refactoring').refactor('Extract Function')"}, {"desc": "Current Word", "noremap": true, "lhs": "jw", "mode": "v", "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": "Search", "noremap": true, "lhs": "js", "mode": "v", "rhs": "lua require('flash').jump()"}, {"desc": "Previous Jump", "noremap": true, "lhs": "jp", "mode": "v", "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": "Treesitter", "noremap": true, "lhs": "jk", "mode": "v", "rhs": "lua require('flash').treesitter()"}, {"desc": "Remote", "noremap": true, "lhs": "jj", "mode": "v", "rhs": "lua require('flash').remote()"}, {"desc": "Diagnostics", "noremap": true, "lhs": "jd", "mode": "v", "rhs": "FlashDiagnostics"}, {"desc": "Search Backward", "noremap": true, "lhs": "jN", "mode": "v", "rhs": "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})"}, {"desc": "Catalog", "noremap": true, "lhs": "Cc", "mode": "v", "rhs": "CBcatalog"}, {"desc": "Line", "noremap": true, "lhs": "Cl", "mode": "v", "rhs": "CBline"}, {"desc": "Run Code", "noremap": true, "lhs": "cx", "mode": "v", "rhs": "','>SnipRun"}, {"desc": "Unique", "noremap": true, "lhs": "cu", "mode": "v", "rhs": ":!uniq"}, {"desc": "Sort Asc", "noremap": true, "lhs": "cs", "mode": "v", "rhs": ":sort"}, {"desc": "Sort Case Insensitive", "noremap": true, "lhs": "ci", "mode": "v", "rhs": ":sort i"}, {"desc": "Sort Desc", "noremap": true, "lhs": "cS", "mode": "v", "rhs": ":sort!"}, {"desc": "Copy Git URL", "noremap": true, "lhs": "yg", "mode": "n", "rhs": "lua require\"gitlinker\".get_buf_range_url()"}, {"desc": "File Name", "noremap": true, "lhs": "yf", "mode": "n", "rhs": "CopyFileName"}, {"desc": "Copy Whole File", "noremap": true, "lhs": "ya", "mode": "n", "rhs": "%y+"}, {"desc": "Absolute Path", "noremap": true, "lhs": "yP", "mode": "n", "rhs": "CopyAbsolutePath"}, {"desc": "Relative Path", "noremap": true, "lhs": "yp", "mode": "n", "rhs": "CopyRelativePath"}, {"desc": "Quickfix List (Trouble)", "noremap": true, "lhs": "xQ", "mode": "n", "rhs": "Trouble qflist toggle"}, {"desc": "Location List (Trouble)", "noremap": true, "lhs": "xL", "mode": "n", "rhs": "Trouble loclist toggle"}, {"desc": "LSP references/definitions/... (Trouble)", "noremap": true, "lhs": "xS", "mode": "n", "rhs": "Trouble lsp toggle"}, {"desc": "Symbols (Trouble)", "noremap": true, "lhs": "xs", "mode": "n", "rhs": "Trouble symbols toggle"}, {"desc": "Buffer Diagnostics (Trouble)", "noremap": true, "lhs": "xX", "mode": "n", "rhs": "Trouble diagnostics toggle filter.buf=0"}, {"desc": "Diagnostics (Trouble)", "noremap": true, "lhs": "xx", "mode": "n", "rhs": "Trouble diagnostics toggle"}, {"desc": " Save and Quit", "noremap": true, "lhs": "x", "mode": "n", "rhs": "x"}, {"desc": "ZenMode", "noremap": true, "lhs": "wz", "mode": "n", "rhs": "ZenMode"}, {"desc": "Write and Quit", "noremap": true, "lhs": "ww", "mode": "n", "rhs": "w"}, {"desc": "Twilight", "noremap": true, "lhs": "wt", "mode": "n", "rhs": "Twilight"}, {"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": "Toggle Output Panel", "noremap": true, "lhs": "uO", "mode": "n", "rhs": "lua require(\"neotest\").output_panel.toggle"}, {"desc": "Stop", "noremap": true, "lhs": "us", "mode": "n", "rhs": "lua require(\"neotest\").run.stop()"}, {"desc": "Run Nearest Test", "noremap": true, "lhs": "ur", "mode": "n", "rhs": "lua require(\"neotest\").run.run()"}, {"desc": "Toggle Summary", "noremap": true, "lhs": "uS", "mode": "n", "rhs": "lua require(\"neotest\").summary.toggle"}, {"desc": "Show Output", "noremap": true, "lhs": "uo", "mode": "n", "rhs": "lua require(\"neotest\").output.open({ enter = true, auto_close = true })"}, {"desc": "Run Test File", "noremap": true, "lhs": "uf", "mode": "n", "rhs": "lua require(\"neotest\").run.run(vim.fn.expand(\"%\"))"}, {"desc": "Run Current Test", "noremap": true, "lhs": "uc", "mode": "n", "rhs": "lua require(\"neotest\").run.run()"}, {"desc": "Vertical Terminal", "noremap": true, "lhs": "tv", "mode": "n", "rhs": "Vterm"}, {"desc": "Horizontal Terminal", "noremap": true, "lhs": "th", "mode": "n", "rhs": "Sterm"}, {"desc": "Toggle Terminal", "noremap": true, "lhs": "t2", "mode": "n", "rhs": "2ToggleTerm"}, {"desc": "Toggle Terminal", "noremap": true, "lhs": "t1", "mode": "n", "rhs": "1ToggleTerm"}, {"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": "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": "Replace Word", "noremap": true, "lhs": "rw", "mode": "n", "rhs": "lua require('spectre').open_visual({select_word=true})"}, {"desc": "Extract Variable", "noremap": true, "lhs": "rv", "mode": "n", "rhs": "lua require('refactoring').refactor('Extract Variable')"}, {"desc": "Replace Word", "noremap": true, "lhs": "rs", "mode": "n", "rhs": ":%s/\\\\>//gI"}, {"desc": "Smart Rename", "noremap": true, "lhs": "rr", "mode": "n", "rhs": ""}, {"desc": "Swap Previous", "noremap": true, "lhs": "rp", "mode": "n", "rhs": ""}, {"desc": "Swap Next", "noremap": true, "lhs": "rn", "mode": "n", "rhs": ""}, {"desc": "List Definition", "noremap": true, "lhs": "rl", "mode": "n", "rhs": ""}, {"desc": "Previous Usage", "noremap": true, "lhs": "rk", "mode": "n", "rhs": ""}, {"desc": "Next Usage", "noremap": true, "lhs": "rj", "mode": "n", "rhs": ""}, {"desc": "Inline Variable", "noremap": true, "lhs": "ri", "mode": "n", "rhs": "lua require('refactoring').refactor('Inline Variable')"}, {"desc": "List Definition Head", "noremap": true, "lhs": "rh", "mode": "n", "rhs": ""}, {"desc": "Extract To File", "noremap": true, "lhs": "rf", "mode": "n", "rhs": "lua require('refactoring').refactor('Extract Block To File')"}, {"desc": "Extract Block", "noremap": true, "lhs": "re", "mode": "n", "rhs": "lua require('refactoring').refactor('Extract Block')"}, {"desc": "Go To Definition", "noremap": true, "lhs": "rd", "mode": "n", "rhs": ""}, {"desc": "Replace Buffer", "noremap": true, "lhs": "rb", "mode": "n", "rhs": "lua require('spectre').open_file_search()"}, {"desc": "Replace", "noremap": true, "lhs": "rS", "mode": "n", "rhs": "lua require('spectre').open()"}, {"desc": "Refactor Commands", "noremap": true, "lhs": "rR", "mode": "n", "rhs": "lua require('telescope').extensions.refactoring.refactors()"}, {"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": "qb", "mode": "n", "rhs": "bw"}, {"desc": "Quit All", "noremap": true, "lhs": "qa", "mode": "n", "rhs": "qall"}, {"desc": "All Options", "noremap": true, "lhs": "oo", "mode": "n", "rhs": "Telescope vim_options"}, {"desc": "Relative Numbers", "noremap": true, "lhs": "on", "mode": "n", "rhs": "set relativenumber!"}, {"desc": "Highlight Colors", "noremap": true, "lhs": "oh", "mode": "n", "rhs": "Telescope highlights"}, {"desc": "Colorscheme", "noremap": true, "lhs": "oc", "mode": "n", "rhs": "Telescope colorscheme"}, {"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": "Peek Type Definition", "noremap": true, "lhs": "lt", "mode": "n", "rhs": "Lspsaga peek_type_definition"}, {"desc": "Document Symbols", "noremap": true, "lhs": "ls", "mode": "n", "rhs": "Telescope lsp_document_symbols theme=get_ivy"}, {"desc": "Rename", "noremap": true, "lhs": "lr", "mode": "n", "rhs": "Lspsaga rename"}, {"desc": "Stop LSP", "noremap": true, "lhs": "lq", "mode": "n", "rhs": "LspStop"}, {"desc": "Incoming Calls", "noremap": true, "lhs": "lp", "mode": "n", "rhs": "Telescope lsp_incoming_calls"}, {"desc": "Outline", "noremap": true, "lhs": "lo", "mode": "n", "rhs": "Lspsaga outline"}, {"desc": "File Diagnostics", "noremap": true, "lhs": "ll", "mode": "n", "rhs": "Telescope diagnostics layout_strategy=vertical"}, {"desc": "Prev Diagnostic", "noremap": true, "lhs": "lk", "mode": "n", "rhs": "Lspsaga diagnostic_jump_prev"}, {"desc": "Next Diagnostic", "noremap": true, "lhs": "lj", "mode": "n", "rhs": "Lspsaga diagnostic_jump_next"}, {"desc": "LSP Info", "noremap": true, "lhs": "li", "mode": "n", "rhs": "LspInfo"}, {"desc": "Hover", "noremap": true, "lhs": "lh", "mode": "n", "rhs": "Lspsaga hover_doc"}, {"desc": "Goto Definition", "noremap": true, "lhs": "lg", "mode": "n", "rhs": "Lspsaga goto_definition"}, {"desc": "Finder", "noremap": true, "lhs": "lf", "mode": "n", "rhs": "Lspsaga finder"}, {"desc": "Peek Definition", "noremap": true, "lhs": "ld", "mode": "n", "rhs": "Lspsaga peek_definition"}, {"desc": "Code Action", "noremap": true, "lhs": "la", "mode": "n", "rhs": "Lspsaga code_action"}, {"desc": "Goto Type Definition", "noremap": true, "lhs": "lT", "mode": "n", "rhs": "Lspsaga goto_type_definition"}, {"desc": "Workspace Symbols", "noremap": true, "lhs": "lS", "mode": "n", "rhs": "Telescope lsp_dynamic_workspace_symbols"}, {"desc": "Replace", "noremap": true, "lhs": "lR", "mode": "n", "rhs": "Lspsaga project_replace"}, {"desc": "Restart LSP", "noremap": true, "lhs": "lQ", "mode": "n", "rhs": "LspRestart"}, {"desc": "Outgoing Calls", "noremap": true, "lhs": "lP", "mode": "n", "rhs": "Telescope lsp_outgoing_calls"}, {"desc": "Workspace Diagnostics", "noremap": true, "lhs": "lL", "mode": "n", "rhs": "Lspsaga show_workspace_diagnostics"}, {"desc": "References", "noremap": true, "lhs": "lF", "mode": "n", "rhs": "Telescope lsp_references layout_strategy=vertical"}, {"desc": "Toggle keys", "noremap": true, "lhs": "kt", "mode": "n", "rhs": "Screenkey"}, {"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": "n", "rhs": "lua require('flash').treesitter_search()"}, {"desc": "Search", "noremap": true, "lhs": "js", "mode": "n", "rhs": "lua require('flash').jump()"}, {"desc": "Previous Jump", "noremap": true, "lhs": "jp", "mode": "n", "rhs": "lua require('flash').jump({continue = true})"}, {"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": "n", "rhs": "lua require('flash').treesitter()"}, {"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": "n", "rhs": "FlashDiagnostics"}, {"desc": "Word", "noremap": true, "lhs": "jc", "mode": "n", "rhs": "*"}, {"desc": "Search Backward", "noremap": true, "lhs": "jN", "mode": "n", "rhs": "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})"}, {"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": "Man Pages", "noremap": true, "lhs": "hm", "mode": "n", "rhs": "Telescope man_pages"}, {"desc": "Hover Doc", "noremap": true, "lhs": "hk", "mode": "n", "rhs": "Lspsaga hover_doc"}, {"desc": "Inspect Position", "noremap": true, "lhs": "hi", "mode": "n", "rhs": "vim.show_pos"}, {"desc": "Help Pages", "noremap": true, "lhs": "hh", "mode": "n", "rhs": "Telescope help_tags"}, {"desc": "Fuzzy Find in File", "noremap": true, "lhs": "fs", "mode": "n", "rhs": "Telescope current_buffer_fuzzy_find"}, {"desc": "Quickfix", "noremap": true, "lhs": "fq", "mode": "n", "rhs": "Telescope quickfix"}, {"desc": "Undo History", "noremap": true, "lhs": "fu", "mode": "n", "rhs": "Telescope undo"}, {"desc": "Diagnostics", "noremap": true, "lhs": "fd", "mode": "n", "rhs": "Telescope diagnostics"}, {"desc": "Search History", "noremap": true, "lhs": "ks", "mode": "n", "rhs": "Telescope search_history"}, {"desc": "Command History", "noremap": true, "lhs": "kh", "mode": "n", "rhs": "Telescope command_history"}, {"desc": "Commands", "noremap": true, "lhs": "kc", "mode": "n", "rhs": "Telescope commands"}, {"desc": "Keymaps", "noremap": true, "lhs": "kk", "mode": "n", "rhs": "Telescope keymaps"}, {"desc": "Grep String", "noremap": true, "lhs": "fG", "mode": "n", "rhs": "Telescope grep_string"}, {"desc": "Find Highlight Groups", "noremap": true, "lhs": "fH", "mode": "n", "rhs": "Telescope highlights"}, {"desc": "Marks", "noremap": true, "lhs": "fm", "mode": "n", "rhs": "Telescope marks"}, {"desc": "Old Recent Files", "noremap": true, "lhs": "fo", "mode": "n", "rhs": "Telescope oldfiles"}, {"desc": "Find Help", "noremap": true, "lhs": "fh", "mode": "n", "rhs": "Telescope help_tags"}, {"desc": "Buffers", "noremap": true, "lhs": "fb", "mode": "n", "rhs": "Telescope buffers"}, {"desc": "Live Grep", "noremap": true, "lhs": "fg", "mode": "n", "rhs": "Telescope live_grep"}, {"desc": "Find Files (CWD)", "noremap": true, "lhs": "ff", "mode": "n", "rhs": "Telescope find_files"}, {"desc": "New File", "noremap": true, "lhs": "en", "mode": "n", "rhs": "new"}, {"desc": "Readme", "noremap": true, "lhs": "em", "mode": "n", "rhs": "e README.md"}, {"desc": "File Browser", "noremap": true, "lhs": "ef", "mode": "n", "rhs": "Telescope file_browser"}, {"desc": "Float File Explorer", "noremap": true, "lhs": "ee", "mode": "n", "rhs": ":Neotree toggle float"}, {"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": "DB Last query", "noremap": true, "lhs": "dl", "mode": "n", "rhs": "DBUILastQueryInfo"}, {"desc": "DB Rename buffer", "noremap": true, "lhs": "dr", "mode": "n", "rhs": "DBUIRenameBuffer"}, {"desc": "DB Find buffer", "noremap": true, "lhs": "db", "mode": "n", "rhs": "DBUIFindBuffer"}, {"desc": "Toggle DB UI", "noremap": true, "lhs": "du", "mode": "n", "rhs": "DBUIToggle"}, {"desc": "Delete Comment Style", "noremap": true, "lhs": "Cd", "mode": "v", "rhs": "CBd"}, {"desc": "Delete Comment Style", "noremap": true, "lhs": "Cd", "mode": "n", "rhs": "CBd"}, {"desc": "Catalog", "noremap": true, "lhs": "Cc", "mode": "n", "rhs": "CBcatalog"}, {"desc": "Marked", "noremap": true, "lhs": "Cm", "mode": "v", "rhs": "CBllbox14"}, {"desc": "Marked", "noremap": true, "lhs": "Cm", "mode": "n", "rhs": "CBllbox14"}, {"desc": "Line", "noremap": true, "lhs": "Cl", "mode": "n", "rhs": "CBline"}, {"desc": "Tiled line", "noremap": true, "lhs": "Ct", "mode": "v", "rhs": "CBllline"}, {"desc": "Tiled line", "noremap": true, "lhs": "Ct", "mode": "n", "rhs": "CBllline"}, {"desc": "Comment Box", "noremap": true, "lhs": "Cb", "mode": "v", "rhs": "CBccbox"}, {"desc": "Comment Box", "noremap": true, "lhs": "Cb", "mode": "n", "rhs": "CBccbox"}, {"desc": "Reload Module", "noremap": true, "lhs": "cr", "mode": "n", "rhs": "Telescope reloader"}, {"desc": "Pick Color", "noremap": true, "lhs": "cp", "mode": "n", "rhs": "CccPick"}, {"desc": "Dashboard", "noremap": true, "lhs": "co", "mode": "n", "rhs": "Dashboard"}, {"desc": "Notifications", "noremap": true, "lhs": "cn", "mode": "n", "rhs": "Telescope notify"}, {"desc": "Markdown Preview", "noremap": true, "lhs": "cm", "mode": "n", "rhs": "MarkdownPreviewToggle"}, {"desc": "Clean Empty Lines", "noremap": true, "lhs": "cl", "mode": "n", "rhs": ":g/^\\s*$/d"}, {"desc": "Chat with IA (Codeium)", "noremap": true, "lhs": "ch", "mode": "n", "rhs": ""}, {"desc": "Root Directory", "noremap": true, "lhs": "cd", "mode": "n", "rhs": "RootDir"}, {"desc": "Highlight Colors", "noremap": true, "lhs": "cc", "mode": "n", "rhs": "CccHighlighterToggle"}, {"desc": "Reload Configs", "noremap": true, "lhs": "cR", "mode": "n", "rhs": "ReloadConfig"}, {"desc": "Convert Color", "noremap": true, "lhs": "cP", "mode": "n", "rhs": "CccConvert"}, {"desc": "Fix Tabs", "noremap": true, "lhs": "cF", "mode": "n", "rhs": "retab"}, {"desc": "Exit", "noremap": true, "lhs": "bx", "mode": "n", "rhs": "DapTerminate"}, {"desc": "Debugger", "noremap": true, "lhs": "bt", "mode": "n", "rhs": "DapUIToggle"}, {"desc": "Repl", "noremap": true, "lhs": "br", "mode": "n", "rhs": "DapToggleRepl"}, {"desc": "Over", "noremap": true, "lhs": "bo", "mode": "n", "rhs": "DapStepOver"}, {"desc": "Last", "noremap": true, "lhs": "bl", "mode": "n", "rhs": "lua require'dap'.run_last()"}, {"desc": "Into", "noremap": true, "lhs": "bi", "mode": "n", "rhs": "DapStepInto"}, {"desc": "Continue", "noremap": true, "lhs": "bc", "mode": "n", "rhs": "DapContinue"}, {"desc": "Breakpoint", "noremap": true, "lhs": "bb", "mode": "n", "rhs": "DapToggleBreakpoint"}, {"desc": "Restart Frame", "noremap": true, "lhs": "bR", "mode": "n", "rhs": "DapRestartFrame"}, {"desc": "Out", "noremap": true, "lhs": "bO", "mode": "n", "rhs": "DapStepOut"}, {"desc": "Dismiss All Notifications", "noremap": true, "lhs": "mn", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "mt", "mode": "n", "rhs": "lua require(\"onedark\").toggle()"}, {"desc": ":help v_#-default", "noremap": true, "lhs": "#", "mode": "x", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "%", "mode": "x", "rhs": "(MatchitVisualForward)"}, {"desc": "", "noremap": false, "lhs": "%", "mode": "n", "rhs": "(MatchitNormalForward)"}, {"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": "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": "LSP Hover", "noremap": true, "lhs": "H", "mode": "n", "rhs": "Lspsaga hover_doc"}, {"desc": "", "noremap": true, "lhs": "J", "mode": "x", "rhs": ":move '>+1gv-gv"}, {"desc": "", "noremap": true, "lhs": "J", "mode": "n", "rhs": "mzJ`z"}, {"desc": "", "noremap": true, "lhs": "K", "mode": "x", "rhs": ":move '-2gv-gv"}, {"desc": "Next Buffer", "noremap": true, "lhs": "L", "mode": "n", "rhs": "bnext"}, {"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": "x", "rhs": "(YankyPutBefore)"}, {"desc": "Put yanked text before cursor", "noremap": true, "lhs": "P", "mode": "n", "rhs": "(YankyPutBefore)"}, {"desc": "Force Quit!", "noremap": true, "lhs": "Q", "mode": "n", "rhs": "qall!"}, {"desc": ":help v_Q-default", "noremap": true, "lhs": "Q", "mode": "x", "rhs": "mode() ==# 'V' ? ':normal! @=reg_recorded()' : 'Q'"}, {"desc": "Flash Treesitter", "noremap": true, "lhs": "S", "mode": "x", "rhs": ""}, {"desc": "Flash Treesitter", "noremap": true, "lhs": "S", "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": "Git Hunk", "noremap": true, "lhs": "[g", "mode": "n", "rhs": "Gitsigns prev_hunk"}, {"desc": "Edit", "noremap": true, "lhs": "[e", "mode": "n", "rhs": "g;"}, {"desc": "Undo backward", "noremap": true, "lhs": "[u", "mode": "n", "rhs": "lua MiniBracketed.undo('backward')"}, {"desc": "Undo first", "noremap": true, "lhs": "[U", "mode": "n", "rhs": "lua MiniBracketed.undo('first')"}, {"desc": "Treesitter backward", "noremap": true, "lhs": "[n", "mode": "x", "rhs": "lua MiniBracketed.treesitter('backward')"}, {"desc": "Treesitter backward", "noremap": true, "lhs": "[n", "mode": "n", "rhs": "lua MiniBracketed.treesitter('backward')"}, {"desc": "Treesitter first", "noremap": true, "lhs": "[N", "mode": "x", "rhs": "lua MiniBracketed.treesitter('first')"}, {"desc": "Treesitter first", "noremap": true, "lhs": "[N", "mode": "n", "rhs": "lua MiniBracketed.treesitter('first')"}, {"desc": "Location backward", "noremap": true, "lhs": "[l", "mode": "n", "rhs": "lua MiniBracketed.location('backward')"}, {"desc": "Location first", "noremap": true, "lhs": "[L", "mode": "n", "rhs": "lua MiniBracketed.location('first')"}, {"desc": "Oldfile backward", "noremap": true, "lhs": "[o", "mode": "n", "rhs": "lua MiniBracketed.oldfile('backward')"}, {"desc": "Oldfile first", "noremap": true, "lhs": "[O", "mode": "n", "rhs": "lua MiniBracketed.oldfile('first')"}, {"desc": "Jump", "noremap": true, "lhs": "[j", "mode": "n", "rhs": ""}, {"desc": "Jump first", "noremap": true, "lhs": "[J", "mode": "n", "rhs": "lua MiniBracketed.jump('first')"}, {"desc": "Indent backward", "noremap": true, "lhs": "[i", "mode": "x", "rhs": "lua MiniBracketed.indent('backward')"}, {"desc": "Indent backward", "noremap": true, "lhs": "[i", "mode": "n", "rhs": "lua MiniBracketed.indent('backward')"}, {"desc": "Indent first", "noremap": true, "lhs": "[I", "mode": "x", "rhs": "lua MiniBracketed.indent('first')"}, {"desc": "Indent first", "noremap": true, "lhs": "[I", "mode": "n", "rhs": "lua MiniBracketed.indent('first')"}, {"desc": "Diagnostic backward", "noremap": true, "lhs": "[d", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('backward')"}, {"desc": "Diagnostic first", "noremap": true, "lhs": "[D", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('first')"}, {"desc": "Diagnostic first", "noremap": true, "lhs": "[D", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('first')"}, {"desc": "Conflict backward", "noremap": true, "lhs": "[x", "mode": "x", "rhs": "lua MiniBracketed.conflict('backward')"}, {"desc": "Conflict backward", "noremap": true, "lhs": "[x", "mode": "n", "rhs": "lua MiniBracketed.conflict('backward')"}, {"desc": "Conflict first", "noremap": true, "lhs": "[X", "mode": "x", "rhs": "lua MiniBracketed.conflict('first')"}, {"desc": "Conflict first", "noremap": true, "lhs": "[X", "mode": "n", "rhs": "lua MiniBracketed.conflict('first')"}, {"desc": "Comment backward", "noremap": true, "lhs": "[c", "mode": "x", "rhs": "lua MiniBracketed.comment('backward')"}, {"desc": "Comment backward", "noremap": true, "lhs": "[c", "mode": "n", "rhs": "lua MiniBracketed.comment('backward')"}, {"desc": "Comment first", "noremap": true, "lhs": "[C", "mode": "x", "rhs": "lua MiniBracketed.comment('first')"}, {"desc": "Comment first", "noremap": true, "lhs": "[C", "mode": "n", "rhs": "lua MiniBracketed.comment('first')"}, {"desc": "Buffer", "noremap": true, "lhs": "[b", "mode": "n", "rhs": "bprevious"}, {"desc": "First Buffer", "noremap": true, "lhs": "[B", "mode": "n", "rhs": "bfirst"}, {"desc": "", "noremap": false, "lhs": "[%", "mode": "x", "rhs": "(MatchitVisualMultiBackward)"}, {"desc": "", "noremap": false, "lhs": "[%", "mode": "n", "rhs": "(MatchitNormalMultiBackward)"}, {"desc": "Diagnostic", "noremap": true, "lhs": "[d", "mode": "n", "rhs": "Lspsaga diagnostic_jump_prev"}, {"desc": "", "noremap": false, "lhs": "\\\\c", "mode": "x", "rhs": "(VM-Visual-Cursors)"}, {"desc": "", "noremap": false, "lhs": "\\\\gS", "mode": "n", "rhs": "(VM-Reselect-Last)"}, {"desc": "", "noremap": false, "lhs": "\\\\/", "mode": "n", "rhs": "(VM-Start-Regex-Search)"}, {"desc": "", "noremap": false, "lhs": "\\\\\\", "mode": "n", "rhs": "(VM-Add-Cursor-At-Pos)"}, {"desc": "", "noremap": false, "lhs": "\\\\a", "mode": "x", "rhs": "(VM-Visual-Add)"}, {"desc": "", "noremap": false, "lhs": "\\\\f", "mode": "x", "rhs": "(VM-Visual-Find)"}, {"desc": "", "noremap": false, "lhs": "\\\\/", "mode": "x", "rhs": "(VM-Visual-Regex)"}, {"desc": "", "noremap": false, "lhs": "\\\\A", "mode": "x", "rhs": "(VM-Visual-All)"}, {"desc": "", "noremap": false, "lhs": "\\\\A", "mode": "n", "rhs": "(VM-Select-All)"}, {"desc": "Git Hunk", "noremap": true, "lhs": "]g", "mode": "n", "rhs": "Gitsigns next_hunk"}, {"desc": "Edit", "noremap": true, "lhs": "]e", "mode": "n", "rhs": "g,"}, {"desc": "Undo forward", "noremap": true, "lhs": "]u", "mode": "n", "rhs": "lua MiniBracketed.undo('forward')"}, {"desc": "Undo last", "noremap": true, "lhs": "]U", "mode": "n", "rhs": "lua MiniBracketed.undo('last')"}, {"desc": "Treesitter forward", "noremap": true, "lhs": "]n", "mode": "x", "rhs": "lua MiniBracketed.treesitter('forward')"}, {"desc": "Treesitter forward", "noremap": true, "lhs": "]n", "mode": "n", "rhs": "lua MiniBracketed.treesitter('forward')"}, {"desc": "Treesitter last", "noremap": true, "lhs": "]N", "mode": "x", "rhs": "lua MiniBracketed.treesitter('last')"}, {"desc": "Treesitter last", "noremap": true, "lhs": "]N", "mode": "n", "rhs": "lua MiniBracketed.treesitter('last')"}, {"desc": "Location forward", "noremap": true, "lhs": "]l", "mode": "n", "rhs": "lua MiniBracketed.location('forward')"}, {"desc": "Location last", "noremap": true, "lhs": "]L", "mode": "n", "rhs": "lua MiniBracketed.location('last')"}, {"desc": "Oldfile forward", "noremap": true, "lhs": "]o", "mode": "n", "rhs": "lua MiniBracketed.oldfile('forward')"}, {"desc": "Oldfile last", "noremap": true, "lhs": "]O", "mode": "n", "rhs": "lua MiniBracketed.oldfile('last')"}, {"desc": "Jump", "noremap": true, "lhs": "]j", "mode": "n", "rhs": ""}, {"desc": "Jump last", "noremap": true, "lhs": "]J", "mode": "n", "rhs": "lua MiniBracketed.jump('last')"}, {"desc": "Indent forward", "noremap": true, "lhs": "]i", "mode": "x", "rhs": "lua MiniBracketed.indent('forward')"}, {"desc": "Indent forward", "noremap": true, "lhs": "]i", "mode": "n", "rhs": "lua MiniBracketed.indent('forward')"}, {"desc": "Indent last", "noremap": true, "lhs": "]I", "mode": "x", "rhs": "lua MiniBracketed.indent('last')"}, {"desc": "Indent last", "noremap": true, "lhs": "]I", "mode": "n", "rhs": "lua MiniBracketed.indent('last')"}, {"desc": "Diagnostic forward", "noremap": true, "lhs": "]d", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('forward')"}, {"desc": "Diagnostic last", "noremap": true, "lhs": "]D", "mode": "x", "rhs": "lua MiniBracketed.diagnostic('last')"}, {"desc": "Diagnostic last", "noremap": true, "lhs": "]D", "mode": "n", "rhs": "lua MiniBracketed.diagnostic('last')"}, {"desc": "Conflict forward", "noremap": true, "lhs": "]x", "mode": "x", "rhs": "lua MiniBracketed.conflict('forward')"}, {"desc": "Conflict forward", "noremap": true, "lhs": "]x", "mode": "n", "rhs": "lua MiniBracketed.conflict('forward')"}, {"desc": "Conflict last", "noremap": true, "lhs": "]X", "mode": "x", "rhs": "lua MiniBracketed.conflict('last')"}, {"desc": "Conflict last", "noremap": true, "lhs": "]X", "mode": "n", "rhs": "lua MiniBracketed.conflict('last')"}, {"desc": "Comment forward", "noremap": true, "lhs": "]c", "mode": "x", "rhs": "lua MiniBracketed.comment('forward')"}, {"desc": "Comment forward", "noremap": true, "lhs": "]c", "mode": "n", "rhs": "lua MiniBracketed.comment('forward')"}, {"desc": "Comment last", "noremap": true, "lhs": "]C", "mode": "x", "rhs": "lua MiniBracketed.comment('last')"}, {"desc": "Comment last", "noremap": true, "lhs": "]C", "mode": "n", "rhs": "lua MiniBracketed.comment('last')"}, {"desc": "Buffer", "noremap": true, "lhs": "]b", "mode": "n", "rhs": "bnext"}, {"desc": "Buffer", "noremap": true, "lhs": "]B", "mode": "n", "rhs": "blast"}, {"desc": "", "noremap": false, "lhs": "]%", "mode": "x", "rhs": "(MatchitVisualMultiForward)"}, {"desc": "", "noremap": false, "lhs": "]%", "mode": "n", "rhs": "(MatchitNormalMultiForward)"}, {"desc": "Diagnostic", "noremap": true, "lhs": "]d", "mode": "n", "rhs": "Lspsaga diagnostic_jump_next"}, {"desc": "Around last textobject", "noremap": false, "lhs": "al", "mode": "x", "rhs": ""}, {"desc": "Around next textobject", "noremap": false, "lhs": "an", "mode": "x", "rhs": ""}, {"desc": "Around textobject", "noremap": false, "lhs": "a", "mode": "x", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "a%", "mode": "x", "rhs": "(MatchitVisualTextObject)"}, {"desc": "Change without replacing clipboad", "noremap": true, "lhs": "c", "mode": "n", "rhs": "\"_c"}, {"desc": "Delete without replacing clipboad", "noremap": true, "lhs": "d", "mode": "n", "rhs": "\"_d"}, {"desc": "Put yanked text before selection", "noremap": true, "lhs": "gP", "mode": "x", "rhs": "(YankyGPutBefore)"}, {"desc": "Put yanked text before selection", "noremap": true, "lhs": "gP", "mode": "n", "rhs": "(YankyGPutBefore)"}, {"desc": "Put yanked text after selection", "noremap": true, "lhs": "gp", "mode": "x", "rhs": "(YankyGPutAfter)"}, {"desc": "Put yanked text after selection", "noremap": true, "lhs": "gp", "mode": "n", "rhs": "(YankyGPutAfter)"}, {"desc": "Highlight next surrounding", "noremap": true, "lhs": "gshn", "mode": "n", "rhs": ""}, {"desc": "Find next left surrounding", "noremap": true, "lhs": "gsFn", "mode": "n", "rhs": ""}, {"desc": "Find next right surrounding", "noremap": true, "lhs": "gsfn", "mode": "n", "rhs": ""}, {"desc": "Replace next surrounding", "noremap": true, "lhs": "gsrn", "mode": "n", "rhs": ""}, {"desc": "Delete next surrounding", "noremap": true, "lhs": "gsdn", "mode": "n", "rhs": ""}, {"desc": "Highlight previous surrounding", "noremap": true, "lhs": "gshl", "mode": "n", "rhs": ""}, {"desc": "Find previous left surrounding", "noremap": true, "lhs": "gsFl", "mode": "n", "rhs": ""}, {"desc": "Find previous right surrounding", "noremap": true, "lhs": "gsfl", "mode": "n", "rhs": ""}, {"desc": "Replace previous surrounding", "noremap": true, "lhs": "gsrl", "mode": "n", "rhs": ""}, {"desc": "Delete previous surrounding", "noremap": true, "lhs": "gsdl", "mode": "n", "rhs": ""}, {"desc": "Add surrounding to selection", "noremap": true, "lhs": "gsa", "mode": "x", "rhs": ":lua MiniSurround.add('visual')"}, {"desc": "Update `MiniSurround.config.n_lines`", "noremap": true, "lhs": "gsn", "mode": "n", "rhs": ""}, {"desc": "Highlight surrounding", "noremap": true, "lhs": "gsh", "mode": "n", "rhs": ""}, {"desc": "Find left surrounding", "noremap": true, "lhs": "gsF", "mode": "n", "rhs": ""}, {"desc": "Find right surrounding", "noremap": true, "lhs": "gsf", "mode": "n", "rhs": ""}, {"desc": "Replace surrounding", "noremap": true, "lhs": "gsr", "mode": "n", "rhs": ""}, {"desc": "Delete surrounding", "noremap": true, "lhs": "gsd", "mode": "n", "rhs": ""}, {"desc": "Add surrounding", "noremap": true, "lhs": "gsa", "mode": "n", "rhs": ""}, {"desc": "Move to right \"around\"", "noremap": false, "lhs": "g]", "mode": "x", "rhs": ""}, {"desc": "Move to right \"around\"", "noremap": false, "lhs": "g]", "mode": "n", "rhs": ""}, {"desc": "Move to left \"around\"", "noremap": false, "lhs": "g[", "mode": "x", "rhs": ""}, {"desc": "Move to left \"around\"", "noremap": false, "lhs": "g[", "mode": "n", "rhs": ""}, {"desc": "", "noremap": false, "lhs": "g%", "mode": "x", "rhs": "(MatchitVisualBackward)"}, {"desc": "", "noremap": false, "lhs": "g%", "mode": "n", "rhs": "(MatchitNormalBackward)"}, {"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": "Comment line", "noremap": true, "lhs": "gcc", "mode": "n", "rhs": ""}, {"desc": "Comment selection", "noremap": true, "lhs": "gc", "mode": "x", "rhs": ""}, {"desc": "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": "Inside last textobject", "noremap": false, "lhs": "il", "mode": "x", "rhs": ""}, {"desc": "Inside next textobject", "noremap": false, "lhs": "in", "mode": "x", "rhs": ""}, {"desc": "Inside textobject", "noremap": false, "lhs": "i", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "j", "mode": "x", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "j", "mode": "n", "rhs": "v:count == 0 ? 'gj' : 'j'"}, {"desc": "", "noremap": true, "lhs": "k", "mode": "x", "rhs": ""}, {"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": "x", "rhs": "(YankyPutAfter)"}, {"desc": "Put yanked text after cursor", "noremap": true, "lhs": "p", "mode": "n", "rhs": "(YankyPutAfter)"}, {"desc": "Flash", "noremap": true, "lhs": "s", "mode": "x", "rhs": ""}, {"desc": "Flash", "noremap": true, "lhs": "s", "mode": "n", "rhs": ""}, {"desc": "", "noremap": true, "lhs": "u", "mode": "n", "rhs": "ulua MiniBracketed.register_undo_state()"}, {"desc": "Cut without replacing clipboad", "noremap": true, "lhs": "x", "mode": "n", "rhs": "\"_x"}, {"desc": "", "noremap": true, "lhs": "x", "mode": "x", "rhs": "\"_x"}, {"desc": "Yank text", "noremap": true, "lhs": "y", "mode": "x", "rhs": "(YankyYank)"}, {"desc": "Yank text", "noremap": true, "lhs": "y", "mode": "n", "rhs": "(YankyYank)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "x", "rhs": "(VM-Find-Subword-Under)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Select-l)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Select-h)"}, {"desc": "Multi Edit Next", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#ctrln(v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_up(0, v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_down(0, v:count1)"}, {"desc": "Add Cursor Up", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_up(0, v:count1)"}, {"desc": "Add Cursor Down", "noremap": true, "lhs": "", "mode": "n", "rhs": ":call vm#commands#add_cursor_down(0, v:count1)"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "(YankyCycleBackward)"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Find-Under)"}, {"desc": "Previous Pane", "noremap": true, "lhs": "", "mode": "n", "rhs": "p"}, {"desc": "Move Up", "noremap": true, "lhs": "", "mode": "n", "rhs": "k"}, {"desc": "Move Down", "noremap": true, "lhs": "", "mode": "n", "rhs": "j"}, {"desc": "Move Left", "noremap": true, "lhs": "", "mode": "n", "rhs": "h"}, {"desc": "Lazygit", "noremap": true, "lhs": "", "mode": "n", "rhs": "Fterm lazygit"}, {"desc": "Find Files", "noremap": true, "lhs": "", "mode": "n", "rhs": "Telescope find_files"}, {"desc": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Add-Cursor-Up)"}, {"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": "", "noremap": false, "lhs": "", "mode": "n", "rhs": "(VM-Add-Cursor-Down)"}, {"desc": "Move line up", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('up')"}, {"desc": "Move line down", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('down')"}, {"desc": "Move line right", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('right')"}, {"desc": "Move line left", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniMove.move_line('left')"}, {"desc": "Move up", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('up')"}, {"desc": "Move down", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('down')"}, {"desc": "Move right", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('right')"}, {"desc": "Move left", "noremap": true, "lhs": "", "mode": "x", "rhs": "lua MiniMove.move_selection('left')"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "lua MiniBracketed.register_undo_state()"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "zz"}, {"desc": "", "noremap": true, "lhs": "", "mode": "n", "rhs": "zz"}, {"desc": "Save File", "noremap": true, "lhs": "", "mode": "n", "rhs": "up"}, {"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": "Move Right", "noremap": true, "lhs": "", "mode": "n", "rhs": "l"}], "treesitterParsers": ["bash", "c", "cpp", "css", "html", "java", "javascript", "json", "liquid", "lua", "markdown", "markdown_inline", "python", "scss", "toml", "tsx", "typescript", "vim", "vimdoc"], "lspServers": ["basedpyright", "bashls", "clangd", "emmet_ls", "jdtls", "lua_ls", "ruff", "tailwindcss", "tsserver"], "leaderKey": ""} \ No newline at end of file diff --git a/lua/configs/dashboard.lua b/lua/configs/dashboard.lua deleted file mode 100644 index 6866abc..0000000 --- a/lua/configs/dashboard.lua +++ /dev/null @@ -1,73 +0,0 @@ -local dashboard = require("dashboard") -local icons = require("lib.icons") - -dashboard.setup({ - theme = "hyper", - disable_move = false, - shortcut_type = "letter", - change_to_vcs_root = true, - hide = { - statusline = true, - tabline = false, - winbar = false, - }, - config = { - week_header = { - enable = true, - append = { "", icons.ui.Circle .. " Learn, Make, Explore! " .. icons.ui.Circle }, - }, - packages = { enable = true }, - project = { enable = true, limit = 8 }, - mru = { limit = 8 }, - shortcut = { - { - desc = icons.ui.Package .. "Mason", - group = "@property", - action = "Mason", - key = "m", - }, - { - desc = icons.ui.Sleep .. "Lazy", - group = "@property", - action = "Lazy", - key = "l", - }, - { - desc = icons.documents.OpenFolder .. "Files", - group = "Label", - action = "Telescope find_files", - key = "f", - }, - { - desc = icons.ui.Search .. "Search", - group = "Label", - action = "Telescope live_grep", - key = "g", - }, - { - desc = icons.ui.Note .. "Todo", - group = "Label", - action = "Tdo", - key = "d", - }, - { - desc = icons.ui.Power, - group = "Action", - action = "quit", - key = "q", - }, - }, - footer = { "", icons.ui.Heart .. " Happiness is a state of mind. " .. icons.ui.Heart }, - }, -}) - --- Show dashboard when lazy closes -if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "DashboardLoaded", - callback = function() - require("lazy").show() - end, - }) -end diff --git a/lua/configs/mason.lua b/lua/configs/mason.lua deleted file mode 100644 index 1c188f4..0000000 --- a/lua/configs/mason.lua +++ /dev/null @@ -1,44 +0,0 @@ -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({ - automatic_installation = true, - ui = { - border = 'rounded', - icons = { - package_installed = '✓', - package_pending = '➜', - package_uninstalled = '✗', - }, - }, -}) - -mason_lspconfig.setup({ - automatic_installation = true, - -- list of servers for mason to install - ensure_installed = { - 'tsserver', - 'lua_ls', - 'basedpyright', - 'jdtls', - 'bashls', - 'clangd', - }, -}) - -mason_tool_installer.setup({ - run_on_start = true, - ensure_installed = { - 'prettier', -- prettier formatter - 'stylua', -- lua formatter - 'black', -- python formatter - 'isort', -- python formatter - 'clang-format', -- c/c++ formatter - 'ruff', -- python linter - 'mypy', -- type checking - 'eslint_d', --js linter - 'shfmt', -- shell formatter - }, -}) diff --git a/lua/configs/none-ls.lua b/lua/configs/none-ls.lua deleted file mode 100644 index ccbb5ad..0000000 --- a/lua/configs/none-ls.lua +++ /dev/null @@ -1,64 +0,0 @@ -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 - 'clang-format', -- c/c++ formatter - 'stylua', -- lua formatter - 'black', -- python formatter - 'pylint', -- python linter - 'google-java-format', -- java formatter - -- "eslint_d", -- js linter - }, -}) - --- for conciseness -local formatting = null_ls.builtins.formatting -- to setup formatters -local diagnostics = null_ls.builtins.diagnostics -- to setup linters -local hover = null_ls.builtins.hover - --- 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, - formatting.google_java_format, - diagnostics.pylint, - hover.printenv, - -- 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/core/autocmd.lua b/lua/core/autocmd.lua index 8b5eb69..a605616 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -1,105 +1,169 @@ local function augroup(name) - return vim.api.nvim_create_augroup("nvim" .. name, { clear = true }) + return vim.api.nvim_create_augroup('nvim' .. name, { clear = true }) 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, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ 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", +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ Check if we need to reload the file when it changed │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, { + group = augroup('checktime'), + command = 'checktime', }) --- Highlight on yank -vim.api.nvim_create_autocmd("TextYankPost", { - group = augroup("highlight_yank"), - callback = function() - vim.highlight.on_yank() - end, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ Highlight on yank │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd('TextYankPost', { + group = augroup('highlight_yank'), + callback = function() + vim.highlight.on_yank() + end, }) --- resize splits if window got resized -vim.api.nvim_create_autocmd({ "VimResized" }, { - group = augroup("resize_splits"), - callback = function() - vim.cmd("tabdo wincmd =") - end, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ resize splits if window got resized │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd({ 'VimResized' }, { + group = augroup('resize_splits'), + callback = function() + vim.cmd('tabdo wincmd =') + end, }) --- 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, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ 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, }) --- close some filetypes with -vim.api.nvim_create_autocmd("FileType", { - group = augroup("close_with_q"), - pattern = { - "DressingSelect", - "Jaq", - "PlenaryTestPopup", - "fugitive", - "help", - "lir", - "lspinfo", - "man", - "notify", - "qf", - "spectre_panel", - "startuptime", - "tsplayground", - }, - callback = function(event) - vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) - end, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ close some filetypes with │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd('FileType', { + group = augroup('close_with_q'), + pattern = { + 'DressingSelect', + 'Jaq', + 'PlenaryTestPopup', + 'fugitive', + 'help', + 'lir', + 'lspinfo', + 'man', + 'notify', + 'qf', + 'spectre_panel', + 'startuptime', + 'tsplayground', + }, + callback = function(event) + vim.bo[event.buf].buflisted = false + vim.keymap.set('n', 'q', 'close', { buffer = event.buf, silent = true }) + 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, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ 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, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ 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("lib.util").get_file_type_cmd("arb"), +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ Set arb filetype │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd({ 'BufEnter' }, { + group = augroup('set_file_type'), + pattern = { '*.arb' }, + command = require('lib.util').get_file_type_cmd('arb'), }) --- Disable format options -vim.api.nvim_create_autocmd("FileType", { - group = augroup("disable_formatoptions"), - pattern = "*", - callback = function() - vim.opt_local.formatoptions:remove({ "c", "r", "o" }) - end, +-- ╭───────────────────────────────────────────────────────────────────╮ +-- │ Disable format options │ +-- ╰───────────────────────────────────────────────────────────────────╯ + +vim.api.nvim_create_autocmd('FileType', { + group = augroup('disable_formatoptions'), + pattern = '*', + callback = function() + vim.opt_local.formatoptions:remove({ 'c', 'r', 'o' }) + end, +}) + +-- ╭─────────────────────────────────────────────────────────╮ +-- │ VIM-VISUAL-MULTI │ +-- ╰─────────────────────────────────────────────────────────╯ +local visual_multi_group = vim.api.nvim_create_augroup('VisualMulti', { clear = true }) +vim.api.nvim_create_autocmd('User', { + pattern = 'visual_multi_start', + callback = function() + -- vim.cmd('NoiceDisable') + vim.lsp.inlay_hint.enable(false) + end, + group = visual_multi_group, +}) +vim.api.nvim_create_autocmd('User', { + pattern = 'visual_multi_exit', + callback = function() + -- vim.cmd('NoiceEnable') + vim.lsp.inlay_hint.enable(true) + end, + group = visual_multi_group, +}) + +-- ╭─────────────────────────────────────────────────────────╮ +-- │ MESSAGE IF MACRO IS STOPPED │ +-- ╰─────────────────────────────────────────────────────────╯ +local macro_group = vim.api.nvim_create_augroup('MacroRecording', { clear = true }) +vim.api.nvim_create_autocmd('RecordingLeave', { + group = macro_group, + callback = function() + -- Display a message when macro recording stops + print('Macro recording stopped') + end, }) diff --git a/lua/core/function.lua b/lua/core/function.lua deleted file mode 100644 index 8a1a739..0000000 --- a/lua/core/function.lua +++ /dev/null @@ -1,126 +0,0 @@ -local vim = vim - -local X = {} - ----@param on_attach fun(client, buffer) -function X.on_attach(on_attach) - vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local buffer = args.buf - local client = vim.lsp.get_client_by_id(args.data.client_id) - on_attach(client, buffer) - end, - }) -end - -function X.starts_with(str, start) - return str:sub(1, #start) == start -end - -function X.is_table(to_check) - return type(to_check) == "table" -end - -function X.has_key(t, key) - for t_key, _ in pairs(t) do - if t_key == key then - return true - end - end - return false -end - -function X.has_value(t, val) - for _, value in ipairs(t) do - if value == val then - return true - end - end - return false -end - -function X.tprint(table) - print(vim.inspect(table)) -end - -function X.tprint_keys(table) - for k in pairs(table) do - print(k) - end -end - -X.reload = function() - local presentReload, reload = pcall(require, "plenary.reload") - if presentReload then - local counter = 0 - - for moduleName in pairs(package.loaded) do - if X.starts_with(moduleName, "lt.") then - reload.reload_module(moduleName) - counter = counter + 1 - end - end - -- clear nvim-mapper keys - vim.g.mapper_records = nil - vim.notify("Reloaded " .. counter .. " modules!") - end -end - -function X.is_macunix() - return vim.fn.has("macunix") -end - -function X.link_highlight(from, to, override) - local hl_exists, _ = pcall(vim.api.nvim_get_hl_by_name, from, false) - if override or not hl_exists then - -- vim.cmd(("highlight link %s %s"):format(from, to)) - vim.api.nvim_set_hl(0, from, { link = to }) - end -end - -X.highlight = function(group, opts) - vim.api.nvim_set_hl(0, group, opts) -end - -X.highlight_bg = function(group, col) - vim.api.nvim_set_hl(0, group, { bg = col }) -end - --- Define fg color --- @param group Group --- @param color Color -X.highlight_fg = function(group, col) - vim.api.nvim_set_hl(0, group, { fg = col }) -end - --- Define bg and fg color --- @param group Group --- @param fgcol Fg Color --- @param bgcol Bg Color -X.highlight_fg_bg = function(group, fgcol, bgcol) - vim.api.nvim_set_hl(0, group, { bg = bgcol, fg = fgcol }) -end - -X.from_highlight = function(hl) - local result = {} - local list = vim.api.nvim_get_hl_by_name(hl, true) - for k, v in pairs(list) do - local name = k == "background" and "bg" or "fg" - result[name] = string.format("#%06x", v) - end - return result -end - -X.get_color_from_terminal = function(num, default) - local key = "terminal_color_" .. num - return vim.g[key] and vim.g[key] or default -end - -X.cmd = function(name, command, desc) - vim.api.nvim_create_user_command(name, command, desc) -end - -X.autocmd = function(evt, opts) - vim.api.nvim_create_autocmd(evt, opts) -end -return X \ No newline at end of file diff --git a/lua/core/keys.lua b/lua/core/keys.lua index fb4dfe5..9a4631d 100644 --- a/lua/core/keys.lua +++ b/lua/core/keys.lua @@ -1,72 +1,79 @@ local function map(mode, lhs, rhs, opts) - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(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) +-- Space as leader +map('n', '', '', opts) +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' --- Visual overwrite paste -map({ "v", "x" }, "p", '"_dP', opts) +-- Modes +-- normal_mode = "n", insert_mode = "i", visual_mode = "v", +-- visual_block_mode = "x", term_mode = "t", command_mode = "c", --- 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" }) +-- Comment +map({ 'n', 'v' }, '/', 'gcc', { remap = true }) -- Select all -map("n", "", "ggG") +map('n', '', 'ggG') -map("n", "", "up", { desc = "Save File" }) +-- 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' }) -- 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) +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 }) +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) +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" }) +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" }) +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") +map('v', '<', '', '>gv') -- Add undo breakpoints -map("i", ",", ",u") -map("i", ".", ".u") -map("i", ";", ";u") +map('i', ',', ',u') +map('i', '.', '.u') +map('i', ';', ';u') -map({ "i" }, "", "", { desc = "Move cursor to right" }) -map({ "i" }, "", "", { desc = "Move cursor to right" }) - -map("n", "d", '"_d', { desc = "Delete without replacing clipboad" }) -map("n", "x", '"_x', { desc = "Cut without replacing clipboad" }) -map("n", "c", '"_c', { desc = "Change without replacing clipboad" }) -map("v", "p", '"_dP', { desc = "Paste without replacing clipboard" }) +map('n', 'd', '"_d', { desc = 'Delete without replacing clipboad' }) +map('n', 'x', '"_x', { desc = 'Cut without replacing clipboad' }) +map('n', 'c', '"_c', { desc = 'Change without replacing clipboad' }) +map('v', 'p', '"_dP', { desc = 'Paste without replacing clipboard' }) diff --git a/lua/core/options.lua b/lua/core/options.lua index d793439..458afae 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,67 +1,64 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = " " - local options = { - ai = true, - autoindent = true, - autowrite = true, - backspace = "indent,eol,start", - backup = false, -- creates a backup file - breakindent = true, - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 1, -- more space in the neovim command line for displaying messages - completeopt = "menu,menuone,noselect", -- mostly just for cmp - conceallevel = 0, -- so that `` is visible in markdown files - confirm = true, -- Confirm to save changes before exiting modified buffer - cursorline = true, -- highlight the current line - expandtab = true, -- convert tabs to spaces - fileencoding = "utf-8", -- the encoding written to a file - formatoptions = "jlnqt", -- set formatoptions, check help fo-table - grepformat = "%f:%l:%c:%m", - grepprg = "rg --vimgrep", - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - inccommand = "split", -- preview incremental substitute - laststatus = 3, - list = false, - -- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight - mouse = "a", -- allow the mouse to be used in neovim - number = true, -- set numbered lines - numberwidth = 4, -- set number column width to 3 {default 4} - pumblend = 10, -- Popup blen - pumheight = 10, -- pop up menu height - relativenumber = true, -- set relative numbered lines - scrolloff = 10, -- is one of my fav - sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal", - shiftround = true, -- Round indent - shiftwidth = 4, -- the number of spaces inserted for each indentation - showcmd = false, - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 0, -- always show tabs - si = true, - sidescrolloff = 8, - signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - smarttab = true, - splitbelow = true, -- force all horizontal splits to go below current window - splitright = true, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - tabstop = 4, -- insert 2 spaces for a tab - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 300, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undo - undolevels = 10000, - updatetime = 50, -- faster completion (4000ms default) - wildmenu = true, -- wildmenu - wildmode = "longest:full,full", -- Command-line completion mode - winminwidth = 5, -- Minimum window width - wrap = false, -- display lines as one long line - writebackup = false, -- do not edit backups + ai = true, + autoindent = true, + autowrite = true, + backspace = 'indent,eol,start', + backup = false, -- creates a backup file + breakindent = true, + clipboard = 'unnamedplus', -- allows neovim to access the system clipboard + cmdheight = 1, -- more space in the neovim command line for displaying messages + completeopt = 'menu,menuone,noselect', -- mostly just for cmp + conceallevel = 0, -- so that `` is visible in markdown files + confirm = true, -- Confirm to save changes before exiting modified buffer + cursorline = true, -- highlight the current line + expandtab = true, -- convert tabs to spaces + fileencoding = 'utf-8', -- the encoding written to a file + formatoptions = 'jlnqt', -- set formatoptions, check help fo-table + grepformat = '%f:%l:%c:%m', + grepprg = 'rg --vimgrep', + hlsearch = true, -- highlight all matches on previous search pattern + ignorecase = true, -- ignore case in search patterns + inccommand = 'split', -- preview incremental substitute + laststatus = 3, + list = false, + -- listchars = { trail = "", tab = "", nbsp = "_", extends = ">", precedes = "<" }, -- highlight + mouse = 'a', -- allow the mouse to be used in neovim + number = true, -- set numbered lines + numberwidth = 4, -- set number column width to 3 {default 4} + pumblend = 10, -- Popup blen + pumheight = 10, -- pop up menu height + relativenumber = true, -- set relative numbered lines + scrolloff = 10, -- is one of my fav + sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal', + shiftround = true, -- Round indent + shiftwidth = 4, -- the number of spaces inserted for each indentation + showcmd = false, + showmode = false, -- we don't need to see things like -- INSERT -- anymore + showtabline = 0, -- always show tabs + si = true, + sidescrolloff = 8, + signcolumn = 'yes', -- always show the sign column, otherwise it would shift the text each time + smartcase = true, -- smart case + smartindent = true, -- make indenting smarter again + smarttab = true, + splitbelow = true, -- force all horizontal splits to go below current window + splitright = true, -- force all vertical splits to go to the right of current window + swapfile = false, -- creates a swapfile + tabstop = 4, -- insert 2 spaces for a tab + termguicolors = true, -- set term gui colors (most terminals support this) + timeoutlen = 300, -- time to wait for a mapped sequence to complete (in milliseconds) + undofile = true, -- enable persistent undo + undolevels = 10000, + updatetime = 50, -- faster completion (4000ms default) + wildmenu = true, -- wildmenu + wildmode = 'longest:full,full', -- Command-line completion mode + winminwidth = 5, -- Minimum window width + wrap = false, -- display lines as one long line + writebackup = false, -- do not edit backups } for k, v in pairs(options) do - vim.opt[k] = v + vim.opt[k] = v end -- netrw file explorer settings @@ -72,7 +69,7 @@ vim.g.netrw_liststyle = 1 -- Fix markdown indentation settings vim.g.markdown_recommended_style = 0 -vim.opt.path:append({ "**" }) +vim.opt.path:append({ '**' }) vim.opt.shortmess:append({ W = true, I = true, c = true }) -- hides `~` at the end of the buffer diff --git a/lua/lock.json b/lua/lock.json index f4b0080..28c9f68 100644 --- a/lua/lock.json +++ b/lua/lock.json @@ -3,6 +3,7 @@ "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "better-escape.nvim": { "branch": "master", "commit": "d337e02b140d909345441392de47a42d283747c1" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "ccc.nvim": { "branch": "main", "commit": "4fb5abaef2f2e0540fe22d4d74a9841205fff9e4" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, @@ -10,8 +11,7 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, - "codeium.vim": { "branch": "main", "commit": "8bed5fb5708c94cd69f418d1381d6fbf07cb0313" }, + "codeium.vim": { "branch": "main", "commit": "1513aef682a9b3363c0bf60292e6ddc781c716ce" }, "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, "conform.nvim": { "branch": "master", "commit": "62eba813b7501b39612146cbf29cd07f1d4ac29c" }, "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, @@ -33,14 +33,13 @@ "mason-lock.nvim": { "branch": "main", "commit": "86614f76c3442fba1c5c8d79aa1efcb3ad69de1c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, "mason-nvim-lint": { "branch": "main", "commit": "b579a00ee39dcd590b1023028dc8fb3d203a67b0" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.files": { "branch": "main", "commit": "7ed15315247775b4c5fcfaf4c8fe45d3a0dde9ad" }, + "mini.files": { "branch": "main", "commit": "2e262838a773c0bc3ccbc9c4bcf4a1a012497ea2" }, "mini.icons": { "branch": "main", "commit": "12e7b5d47bfc1b4c5ba4278fb49ec9100138df14" }, - "mini.nvim": { "branch": "main", "commit": "2c55015a518e11ea9d49bb96078f5ede51f5d2af" }, + "mini.nvim": { "branch": "main", "commit": "b5ee41d2b8ab54f8b6b383b488e822c5cc431871" }, "modes.nvim": { "branch": "main", "commit": "3188692abf02a8838ec75e59d68c2ce3e4323f5c" }, "neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" }, - "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, + "neotest": { "branch": "master", "commit": "6d6ad113f56edc7c3f2a77a0836ea8c1b955ebea" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-python": { "branch": "master", "commit": "72603dfdbaad5695160268cb10531a14cc37236e" }, "neotest-rspec": { "branch": "main", "commit": "53fc108a06ae43d7f873d42ee5189c2301e33623" }, @@ -50,17 +49,17 @@ "numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-dap": { "branch": "master", "commit": "281a2e4cd1e7a17cea7ecb1745d84a8ab1249925" }, - "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, "nvim-lint": { "branch": "master", "commit": "debabca63c0905b59ce596a55a8e33eafdf66342" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" }, - "nvim-lspconfig": { "branch": "master", "commit": "911167921d49cd5c1c9b2436031d0da3945e787f" }, + "nvim-lspconfig": { "branch": "master", "commit": "2a6f00ff66e276ab3289be8bb9f844f7ab385848" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" }, - "nvim-treesitter": { "branch": "master", "commit": "397982d197768ebdefc0e2db396d95c4d371ca86" }, + "nvim-treesitter": { "branch": "master", "commit": "7a64148896289a91cb2a92e9da3f76d5512a3fb8" }, "nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "41e3abf6bfd9a9a681eb1f788bdeba91c9004b2b" }, - "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, "odoo-snippets": { "branch": "main", "commit": "5e6b7191e3ea60bba00df6cdbc031291b194768d" }, "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, @@ -69,7 +68,7 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "9f3d10e66a79e8975926f8cb930856e4930d9da4" }, "refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" }, "screenkey.nvim": { "branch": "main", "commit": "b1516d5d610c89555062397d29fa7f32fc8ec431" }, - "tdo.nvim": { "branch": "main", "commit": "f8d4ee275309c8a696236fcee92d78ecd98971bd" }, + "sniprun": { "branch": "master", "commit": "a29d7b1c313b00980015ad79fa0ab512a0729940" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "a46780830b576049c675680650f773bedfa8677a" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, @@ -79,11 +78,11 @@ "termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" }, "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "53ed7c65e466963c916251f9ce6df7dd3685dc36" }, "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, "vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" }, "vim-dadbod-ui": { "branch": "master", "commit": "2f344874918a3ab6bbe68fb866b3f003a639a5d2" }, - "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, "vim-visual-multi": { "branch": "master", "commit": "38b0e8d94a5499ccc17d6159763d32c79f53417b" }, "vim-wakatime": { "branch": "master", "commit": "53bba6bb8342de9cbdafc82142a9b5e82008d858" }, "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, diff --git a/lua/mason-lock.json b/lua/mason-lock.json index dbdcb99..41bf136 100644 --- a/lua/mason-lock.json +++ b/lua/mason-lock.json @@ -5,7 +5,6 @@ "clang-format": "18.1.8", "clangd": "18.1.3", "codespell": "2.3.0", - "cpplint": "1.6.1", "cspell": "8.14.2", "emmet-ls": "0.4.2", "eslint_d": "14.0.3", @@ -18,11 +17,9 @@ "prettier": "3.3.3", "pylint": "3.2.6", "ruff": "0.6.2", - "selene": "0.27.1", "shfmt": "v3.9.0", "stylua": "v0.20.0", "tailwindcss-language-server": "0.0.23", "trivy": "v0.54.1", "typescript-language-server": "4.3.3" -} - +} \ No newline at end of file diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 60f42e3..0ada0a8 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -1,289 +1,205 @@ +--Coding related + 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, - }, - }, - { - "mg979/vim-visual-multi", - event = "BufReadPre", - keys = { - { - "", - ":call vm#commands#add_cursor_down(0, v:count1)", - desc = "Add Cursor Down", - mode = { "n" }, - noremap = true, - silent = true, - }, - { - "", - ":call vm#commands#add_cursor_up(0, v:count1)", - desc = "Add Cursor Up", - mode = { "n" }, - noremap = true, - silent = true, - }, - { - "", - ":call vm#commands#add_cursor_down(0, v:count1)", - desc = "Add Cursor Down", - mode = { "n" }, - noremap = true, - silent = true, - }, - { - "", - ":call vm#commands#add_cursor_up(0, v:count1)", - desc = "Add Cursor Down", - mode = { "n" }, - noremap = true, - silent = true, - }, - { - "", - ":call vm#commands#ctrln(v:count1)", - desc = "Multi Edit Next", - mode = { "n" }, - noremap = true, - silent = true, - }, - }, - config = function() - vim.g.VM_default_mappings = 0 - vim.g.VM_silent_exit = 1 - vim.g.VM_set_statusline = 0 - vim.g.VM_maps = { - ["Find Under"] = "", - } + { + '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, + }, + }, + { + 'mg979/vim-visual-multi', + event = 'BufReadPre', + config = function() + vim.g.VM_default_mappings = 0 + vim.g.VM_silent_exit = 1 + vim.g.VM_set_statusline = 0 + vim.g.VM_maps = { + ['Find Under'] = '', + } - vim.g.VM_maps["I BS"] = "" - vim.g.VM_maps["I CtrlC"] = "" - vim.g.VM_maps["I CtrlN"] = "" - end, - }, - { - "CRAG666/code_runner.nvim", - config = true, - vim.keymap.set("n", "rc", "RunCode", { desc = "Run Code " }), - vim.keymap.set("n", "rf", "RunFile", { desc = "Run Code File " }), - vim.keymap.set("n", "rp", "RunProject", { desc = "Run Code Project " }), - vim.keymap.set("n", "rx", "RunClose", { desc = "Close Code Run " }), - opts = { - filetype = { - python = "python3 -u", - c = "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", - cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", - sh = "bash", - go = "go run", - lua = "lua", - julia = "julia", - typescript = "ts-node", - javascript = "node", - rust = "cd $dir && cargo run", - php = "php", - java = "cd $dir && javac $fileName && java $fileNameWithoutExt", - kotlin = "cd $dir && kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar", - }, - }, - }, - { - "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", "CmdlineEnter" }, - dependencies = { - "hrsh7th/cmp-buffer", -- source for text in buffer - "hrsh7th/cmp-path", -- source for file system paths - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", - "saadparwaiz1/cmp_luasnip", --for autocomplete - "hrsh7th/cmp-nvim-lsp-signature-help", - "onsails/lspkind.nvim", -- vs-code like pictograms - "L3MON4D3/LuaSnip", -- snippets - "rafamadriz/friendly-snippets", -- useful snippets - }, - 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.VM_maps['I BS'] = '' + vim.g.VM_maps['I CtrlC'] = '' + vim.g.VM_maps['I CtrlN'] = '' + end, + }, + { + 'michaelb/sniprun', + build = 'bash ./install.sh', + cmd = 'SnipRun', + config = function() + local sniprun = require('sniprun') + sniprun.setup({ + display = { 'VirtualTextOk', 'VirtualTextErr' }, + show_no_output = { 'Classic', 'TempFloatingWindow' }, + display_options = { + terminal_width = 45, + notification_timeout = 5, + }, - vim.g.codeium_filetypes = { - TelescopePrompt = false, - DressingInput = false, - ["neo-tree-popup"] = false, - ["dap-repl"] = false, - } + inline_messages = 0, + borders = 'single', + }) + 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', 'CmdlineEnter' }, + dependencies = { + 'hrsh7th/cmp-buffer', -- source for text in buffer + 'hrsh7th/cmp-path', -- source for file system paths + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-nvim-lua', + 'saadparwaiz1/cmp_luasnip', --for autocomplete + 'hrsh7th/cmp-nvim-lsp-signature-help', + 'onsails/lspkind.nvim', -- vs-code like pictograms + 'L3MON4D3/LuaSnip', -- snippets + 'rafamadriz/friendly-snippets', -- useful snippets + }, + config = function() + require('plugins.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) - local opts = { expr = true, silent = true } - vim.g.codeium_disable_bindings = 1 + vim.g.codeium_filetypes = { + TelescopePrompt = false, + DressingInput = false, + ['neo-tree-popup'] = false, + ['dap-repl'] = false, + } - vim.keymap.set("i", "", function() - return vim.fn["codeium#Accept"]() - end, opts) + local opts = { expr = true, silent = true } + vim.g.codeium_disable_bindings = 1 - 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#Accept']() + end, opts) - vim.keymap.set("i", "", function() - return vim.fn["codeium#CycleCompletions"](1) - 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('i', '', function() + return vim.fn['codeium#CycleCompletions'](-1) + 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, - }, + 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 = '*', + 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', + opts = { + highlight = { + timer = 150, + }, + }, + }, + { + 'LudoPinelli/comment-box.nvim', + event = 'BufReadPre', + opts = { + box_width = 70, + }, + }, + { + 'm-demare/hlargs.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + }, + { + 'numToStr/Navigator.nvim', + config = function() + require('Navigator').setup() + end, + }, } diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index f13fbe5..ac5e9aa 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,35 +1,35 @@ return { - { - "navarasu/onedark.nvim", - lazy = false, - priority = 1000, - config = function() - local onedark = require("onedark") - local util = require("lib.util") + { + 'navarasu/onedark.nvim', + lazy = false, + priority = 1000, + config = function() + local onedark = require('onedark') + local util = require('lib.util') - onedark.setup({ - style = "deep", - transparent = true, - term_colors = false, - ending_tildes = false, - cmp_itemkind_reverse = false, + onedark.setup({ + style = 'deep', + transparent = true, + term_colors = false, + ending_tildes = false, + cmp_itemkind_reverse = false, - toggle_style_key = "mt", - toggle_style_list = { "dark", "darker", "cool", "warm", "warmer", "deep", "light" }, + toggle_style_key = 'mt', + toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' }, - -- Options are italic, bold, underline, none and combos 'italic,bold' - code_style = { - comments = "italic", - keywords = "none", - functions = "none", - strings = "none", - variables = "none", - }, + -- Options are italic, bold, underline, none and combos 'italic,bold' + code_style = { + comments = 'italic', + keywords = 'none', + functions = 'none', + strings = 'none', + variables = 'none', + }, - lualine = { transparent = true }, - diagnostics = { darker = true, undercurl = true, background = false }, - }) - onedark.load() - end, - }, + lualine = { transparent = true }, + diagnostics = { darker = true, undercurl = true, background = false }, + }) + onedark.load() + end, + }, } diff --git a/lua/configs/cmp.lua b/lua/plugins/configs/cmp.lua similarity index 100% rename from lua/configs/cmp.lua rename to lua/plugins/configs/cmp.lua diff --git a/lua/plugins/configs/dashboard.lua b/lua/plugins/configs/dashboard.lua new file mode 100644 index 0000000..80fca53 --- /dev/null +++ b/lua/plugins/configs/dashboard.lua @@ -0,0 +1,73 @@ +local dashboard = require('dashboard') +local icons = require('lib.icons') + +dashboard.setup({ + theme = 'hyper', + disable_move = false, + shortcut_type = 'letter', + change_to_vcs_root = true, + hide = { + statusline = true, + tabline = false, + winbar = false, + }, + config = { + week_header = { + enable = true, + append = { '', icons.ui.Circle .. ' Learn, Make, Explore! ' .. icons.ui.Circle }, + }, + packages = { enable = true }, + project = { enable = true, limit = 8 }, + mru = { limit = 8 }, + shortcut = { + { + desc = icons.ui.Package .. 'Mason', + group = '@property', + action = 'Mason', + key = 'm', + }, + { + desc = icons.ui.Sleep .. 'Lazy', + group = '@property', + action = 'Lazy', + key = 'l', + }, + { + desc = icons.documents.OpenFolder .. 'Files', + group = 'Label', + action = 'Telescope find_files', + key = 'f', + }, + { + desc = icons.ui.Search .. 'Search', + group = 'Label', + action = 'Telescope live_grep', + key = 'g', + }, + { + desc = icons.ui.Note .. 'Todo', + group = 'Label', + action = 'Tdo', + key = 'd', + }, + { + desc = icons.ui.Power, + group = 'Action', + action = 'quit', + key = 'q', + }, + }, + footer = { '', icons.ui.Heart .. ' Happiness is a state of mind. ' .. icons.ui.Heart }, + }, +}) + +-- Show dashboard when lazy closes +if vim.o.filetype == 'lazy' then + vim.cmd.close() + vim.api.nvim_create_autocmd('User', { + pattern = 'DashboardLoaded', + callback = function() + require('lazy').show() + end, + }) +end diff --git a/lua/plugins/configs/jump.lua b/lua/plugins/configs/jump.lua new file mode 100644 index 0000000..f7cffa4 --- /dev/null +++ b/lua/plugins/configs/jump.lua @@ -0,0 +1,57 @@ +local flash = require('flash') +local icons = require('lib.icons') + +flash.setup({ + -- exact, fuzzy, regex, custom function + mode = 'fuzzy', + -- behave like `incsearch` + incremental = true, + + jump = { + -- save location in the jumplist + jumplist = true, + -- automatically jump when there is only one match + autojump = true, + }, + label = { + rainbow = { + enabled = true, + -- number between 1 and 9 + shade = 4, + }, + }, + prompt = { + enabled = true, + prefix = { { icons.ui.Separator .. icons.ui.Rocket .. icons.ui.ChevronRight .. ' ', 'FlashPromptIcon' } }, + win_config = { relative = 'editor', width = 1, height = 1, row = 1, col = 0, zindex = 1000 }, + }, + modes = { + search = { + enabled = true, + }, + char = { + enabled = false, + jump_labels = false, + }, + }, +}) + +vim.api.nvim_create_user_command('FlashDiagnostics', function() + require('flash').jump({ + matcher = function(win) + return vim.tbl_map(function(diag) + return { + pos = { diag.lnum + 1, diag.col }, + end_pos = { diag.end_lnum + 1, diag.end_col - 1 }, + } + end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win))) + end, + action = function(match, state) + vim.api.nvim_win_call(match.win, function() + vim.api.nvim_win_set_cursor(match.win, match.pos) + vim.diagnostic.open_float() + end) + state:restore() + end, + }) +end, {}) diff --git a/lua/configs/lsp.lua b/lua/plugins/configs/lsp.lua similarity index 54% rename from lua/configs/lsp.lua rename to lua/plugins/configs/lsp.lua index f0380b7..d55509e 100644 --- a/lua/configs/lsp.lua +++ b/lua/plugins/configs/lsp.lua @@ -20,56 +20,56 @@ local mason_lspconfig = require('mason-lspconfig') 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 = 'Inlay hint' - keymap.set( - 'n', - 'lh', - 'lua vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())', - opts - ) - - 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' }, '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', '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, -}) +-- 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 = 'Inlay hint' +-- keymap.set( +-- 'n', +-- 'lh', +-- 'lua vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())', +-- opts +-- ) +-- +-- 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' }, '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', '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() diff --git a/lua/configs/lualine.lua b/lua/plugins/configs/lualine.lua similarity index 100% rename from lua/configs/lualine.lua rename to lua/plugins/configs/lualine.lua diff --git a/lua/plugins/configs/spectre.lua b/lua/plugins/configs/spectre.lua new file mode 100644 index 0000000..6808f38 --- /dev/null +++ b/lua/plugins/configs/spectre.lua @@ -0,0 +1,125 @@ +local spectre = require('spectre') + +spectre.setup({ + color_devicons = true, + highlight = { + ui = 'String', + search = 'DiffChange', + replace = 'DiffDelete', + }, + mapping = { + ['toggle_line'] = { + map = 't', + cmd = "lua require('spectre').toggle_line()", + desc = 'toggle current item', + }, + ['enter_file'] = { + map = '', + cmd = "lua require('spectre.actions').select_entry()", + desc = 'goto current file', + }, + ['send_to_qf'] = { + map = 'Q', + cmd = "lua require('spectre.actions').send_to_qf()", + desc = 'send all item to quickfix', + }, + ['replace_cmd'] = { + map = 'c', + cmd = "lua require('spectre.actions').replace_cmd()", + desc = 'input replace vim command', + }, + ['show_option_menu'] = { + map = 'o', + cmd = "lua require('spectre').show_options()", + desc = 'show option', + }, + ['run_replace'] = { + map = 'R', + cmd = "lua require('spectre.actions').run_replace()", + desc = 'replace all', + }, + ['change_view_mode'] = { + map = 'm', + cmd = "lua require('spectre').change_view()", + desc = 'change result view mode', + }, + ['toggle_ignore_case'] = { + map = 'I', + cmd = "lua require('spectre').change_options('ignore-case')", + desc = 'toggle ignore case', + }, + ['toggle_ignore_hidden'] = { + map = 'H', + cmd = "lua require('spectre').change_options('hidden')", + desc = 'toggle search hidden', + }, + }, + find_engine = { + ['rg'] = { + cmd = 'rg', + args = { + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + }, + options = { + ['ignore-case'] = { + value = '--ignore-case', + icon = '[I]', + desc = 'ignore case', + }, + ['hidden'] = { + value = '--hidden', + desc = 'hidden file', + icon = '[H]', + }, + }, + }, + ['ag'] = { + cmd = 'ag', + args = { + '--vimgrep', + '-s', + }, + options = { + ['ignore-case'] = { + value = '-i', + icon = '[I]', + desc = 'ignore case', + }, + ['hidden'] = { + value = '--hidden', + desc = 'hidden file', + icon = '[H]', + }, + }, + }, + }, + replace_engine = { + ['sed'] = { + cmd = 'sed', + args = nil, + }, + options = { + ['ignore-case'] = { + value = '--ignore-case', + icon = '[I]', + desc = 'ignore case', + }, + }, + }, + default = { + find = { + cmd = 'rg', + options = { 'ignore-case' }, + }, + replace = { + cmd = 'sed', + }, + }, + replace_vim_cmd = 'cdo', + is_open_target_win = true, + is_insert_mode = true, +}) diff --git a/lua/configs/telescope.lua b/lua/plugins/configs/telescope.lua similarity index 99% rename from lua/configs/telescope.lua rename to lua/plugins/configs/telescope.lua index b794171..d3bdd81 100644 --- a/lua/configs/telescope.lua +++ b/lua/plugins/configs/telescope.lua @@ -14,7 +14,6 @@ telescope.setup({ 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, diff --git a/lua/configs/toggleterm.lua b/lua/plugins/configs/toggleterm.lua similarity index 100% rename from lua/configs/toggleterm.lua rename to lua/plugins/configs/toggleterm.lua diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua new file mode 100644 index 0000000..79d2d1c --- /dev/null +++ b/lua/plugins/configs/whichkey.lua @@ -0,0 +1,508 @@ +local which_key = require('which-key') +local icons = require('lib.icons') + +local setup = { + preset = 'helix', + plugins = { + marks = true, + registers = true, + spelling = { + enabled = true, + suggestions = 30, + }, + presets = { + operators = true, + motions = true, + text_objects = true, + windows = true, + nav = true, + z = true, + g = true, + }, + }, + icons = { + breadcrumb = icons.ui.ArrowOpen, + separator = icons.ui.Arrow, + group = '', + keys = { + Space = icons.ui.Rocket, + }, + rules = false, -- enable auto icon rules + }, + show_help = false, + show_keys = true, + triggers = { + { '', mode = 'nixsotc' }, + { '', mode = { 'n', 'v' } }, + }, +} + +local n_mappings = { + mode = 'n', + + { 'b', group = ' Debug' }, + { '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' }, + + { 'c', group = ' Code' }, + { 'cF', 'retab', desc = 'Fix Tabs' }, + { 'cP', 'CccConvert', desc = 'Convert Color' }, + { 'cR', 'ReloadConfig', desc = 'Reload Configs' }, + { 'cc', 'CccHighlighterToggle', desc = 'Highlight Colors' }, + { 'cd', 'RootDir', desc = 'Root Directory' }, + { 'cf', group = 'Formate File' }, + { 'ch', 'Hardtime toggle', desc = 'Hardtime' }, + { 'cl', ':g/^\\s*$/d', desc = 'Clean Empty Lines' }, + { 'cm', 'MarkdownPreviewToggle', desc = 'Markdown Preview' }, + { 'cn', 'Telescope notify', desc = 'Notifications' }, + { 'co', 'Dashboard', desc = 'Dashboard' }, + { 'cp', 'CccPick', desc = 'Pick Color' }, + { 'cr', 'Telescope reloader', desc = 'Reload Module' }, + + { 'C', group = ' Comment' }, + { 'Cb', 'CBccbox', desc = 'Comment Box' }, + { 'Ct', 'CBllline', desc = 'Tiled line' }, + { 'Cl', 'CBline', desc = 'Line' }, + { 'Cm', 'CBllbox14', desc = 'Marked' }, + { 'Cc', 'CBcatalog', desc = 'Catalog' }, + { 'Cd', 'CBd', desc = 'Delete Comment Style' }, + + { 'd', group = ' Database' }, + { 'du', 'DBUIToggle', desc = 'Toggle DB UI' }, + { 'db', 'DBUIFindBuffer', desc = 'DB Find buffer' }, + { 'dr', 'DBUIRenameBuffer', desc = 'DB Rename buffer' }, + { 'dl', 'DBUILastQueryInfo', desc = 'DB Last query' }, + + { 'e', group = ' 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', ':Neotree toggle float', silent = true, desc = 'Float File Explorer' }, + { 'eE', ':Neotree toggle left', silent = true, desc = 'Left File Explorer' }, + { 'ef', 'Telescope file_browser', desc = 'File Browser' }, + { 'em', 'e README.md', desc = 'Readme' }, + { 'en', 'new', desc = 'New File' }, + + { 'f', group = ' Find' }, + { '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' }, + { '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' }, + + { 'h', group = ' Help' }, + { 'hh', 'Telescope help_tags', desc = 'Help Pages' }, + { 'hi', 'vim.show_pos', desc = 'Inspect Position' }, + { 'hk', 'Lspsaga hover_doc', desc = 'Hover Doc' }, + { 'hm', 'Telescope man_pages', desc = 'Man Pages' }, + + { 'i', group = ' 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' }, + + { 'j', group = ' Jump' }, + { + 'jN', + "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})", + desc = 'Search Backward', + }, + { 'jc', '*', desc = 'Word' }, + { 'jd', 'FlashDiagnostics', desc = 'Diagnostics' }, + { 'jf', 'Telescope jumplist', desc = 'Jumplist' }, + { 'jh', '', desc = 'Backward' }, + { 'jj', "lua require('flash').remote()", desc = 'Remote' }, + { 'jk', "lua require('flash').treesitter()", desc = 'Treesitter' }, + { 'jl', '', desc = 'Forward' }, + { + 'jn', + "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})", + desc = 'Search Forward', + }, + { 'jp', "lua require('flash').jump({continue = true})", desc = 'Previous Jump' }, + { 'js', "lua require('flash').jump()", desc = 'Search' }, + { 'jt', "lua require('flash').treesitter_search()", desc = 'Remote Treesitter' }, + { + 'jw', + 'lua require("flash").jump({ pattern = vim.fn.expand("")})', + desc = 'Current Word', + }, + + { 'k', group = ' Keys' }, + { 'kc', 'Telescope commands', desc = 'Commands' }, + { 'kh', 'Telescope command_history', desc = 'Command History' }, + { 'kk', 'Telescope keymaps', desc = 'Keymaps' }, + { 'ks', 'Telescope search_history', desc = 'Search History' }, + { 'kt', 'Screenkey', desc = 'Toggle keys' }, + + { 'l', group = ' LSP' }, + { 'lF', 'Telescope lsp_references layout_strategy=vertical', desc = 'References' }, + { 'lL', 'Lspsaga show_workspace_diagnostics', desc = 'Workspace Diagnostics' }, + { 'lP', 'Telescope lsp_outgoing_calls', desc = 'Outgoing Calls' }, + { 'lQ', 'LspRestart', desc = 'Restart LSP' }, + { 'lR', 'Lspsaga project_replace', desc = 'Replace' }, + { 'lS', 'Telescope lsp_dynamic_workspace_symbols', desc = 'Workspace Symbols' }, + { 'lT', 'Lspsaga goto_type_definition', desc = 'Goto Type Definition' }, + { 'la', 'Lspsaga code_action', desc = 'Code Action' }, + { 'ld', 'Lspsaga peek_definition', desc = 'Peek Definition' }, + { 'lf', 'Lspsaga finder', desc = 'Finder' }, + { 'lg', 'Lspsaga goto_definition', desc = 'Goto Definition' }, + { 'lh', 'Lspsaga hover_doc', desc = 'Hover' }, + { 'li', 'LspInfo', desc = 'LSP Info' }, + { 'lj', 'Lspsaga diagnostic_jump_next', desc = 'Next Diagnostic' }, + { 'lk', 'Lspsaga diagnostic_jump_prev', desc = 'Prev Diagnostic' }, + { 'll', 'Telescope diagnostics layout_strategy=vertical', desc = 'File Diagnostics' }, + { 'lo', 'Lspsaga outline', desc = 'Outline' }, + { 'lp', 'Telescope lsp_incoming_calls', desc = 'Incoming Calls' }, + { 'lq', 'LspStop', desc = 'Stop LSP' }, + { 'lr', 'Lspsaga rename', desc = 'Rename' }, + { 'ls', 'Telescope lsp_document_symbols theme=get_ivy', desc = 'Document Symbols' }, + { 'lt', 'Lspsaga peek_type_definition', desc = 'Peek Type Definition' }, + + { 'm', group = ' Misc' }, + { + '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", + }, + + { 'o', group = ' Options' }, + { 'oc', 'Telescope colorscheme', desc = 'Colorscheme' }, + { 'oh', 'Telescope highlights', desc = 'Highlight Colors' }, + { 'on', 'set relativenumber!', desc = 'Relative Numbers' }, + { 'oo', 'Telescope vim_options', desc = 'All Options' }, + + { 'q', group = ' 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' }, + + { 'r', group = ' Refactor' }, + { + 'rR', + "lua require('telescope').extensions.refactoring.refactors()", + desc = 'Refactor Commands', + }, + { 'rS', "lua require('spectre').open()", desc = 'Replace' }, + { 'rb', "lua require('spectre').open_file_search()", desc = 'Replace Buffer' }, + { 'rd', '', desc = 'Go To Definition' }, + { 're', "lua require('refactoring').refactor('Extract Block')", desc = 'Extract Block' }, + { + 'rf', + "lua require('refactoring').refactor('Extract Block To File')", + desc = 'Extract To File', + }, + { 'rh', '', desc = 'List Definition Head' }, + { 'ri', "lua require('refactoring').refactor('Inline Variable')", desc = 'Inline Variable' }, + { 'rj', '', desc = 'Next Usage' }, + { 'rk', '', desc = 'Previous Usage' }, + { 'rl', '', desc = 'List Definition' }, + { 'rn', '', desc = 'Swap Next' }, + { 'rp', '', desc = 'Swap Previous' }, + { 'rr', '', desc = 'Smart Rename' }, + { 'rs', ':%s/\\<\\>//gI', desc = 'Replace Word' }, + { 'rv', "lua require('refactoring').refactor('Extract Variable')", desc = 'Extract Variable' }, + { 'rw', "lua require('spectre').open_visual({select_word=true})", desc = 'Replace Word' }, + + { 's', group = ' 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' }, + + { 't', group = ' Terminal' }, + { 't1', '1ToggleTerm', desc = 'Toggle Terminal' }, + { 't2', '2ToggleTerm', desc = 'Toggle Terminal' }, + { 'th', 'Sterm', desc = 'Horizontal Terminal' }, + { 'tv', 'Vterm', desc = 'Vertical Terminal' }, + + { 'u', group = ' Test' }, + { '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' }, + + { 'v', group = ' 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' }, + + { 'w', group = ' Writing' }, + { 'wc', 'set spell!', desc = 'Spellcheck' }, + { 'wF', ':SudaWrite', desc = 'Suda Write' }, + { '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' }, + { 'wt', 'Twilight', desc = 'Twilight' }, + { 'ww', 'w', desc = 'Write and Quit' }, + { 'wz', 'ZenMode', desc = 'ZenMode' }, + { 'x', 'x', desc = ' Save and Quit' }, + + { 'x', group = '󰁨 Diagnostics/Quickfix' }, + { '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)' }, + + { 'y', group = ' Yank' }, + { + 'yp', + function() + require('telescope').extensions.yank_history.yank_history({}) + end, + desc = 'Open Yank History', + }, + + { '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' }, +} + +local v_mappings = { + mode = 'v', + + { 'c', group = ' Code' }, + { 'cS', ':sort!', desc = 'Sort Desc' }, + { 'ci', ':sort i', desc = 'Sort Case Insensitive' }, + { 'cs', ':sort', desc = 'Sort Asc' }, + { 'cu', ':!uniq', desc = 'Unique' }, + { 'cx', "'<,'>SnipRun", desc = 'Run Code' }, + + { 'C', group = ' Comment' }, + { 'Cb', 'CBccbox', desc = 'Comment Box' }, + { 'Ct', 'CBllline', desc = 'Tiled line' }, + { 'Cl', 'CBline', desc = 'Line' }, + { 'Cm', 'CBllbox14', desc = 'Marked' }, + { 'Cc', 'CBcatalog', desc = 'Catalog' }, + { 'Cd', 'CBd', desc = 'Delete Comment Style' }, + + { 'j', group = ' Jump' }, + { + 'jN', + "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})", + desc = 'Search Backward', + }, + { 'jd', 'FlashDiagnostics', desc = 'Diagnostics' }, + { 'jj', "lua require('flash').remote()", desc = 'Remote' }, + { 'jk', "lua require('flash').treesitter()", desc = 'Treesitter' }, + { + 'jn', + "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})", + desc = 'Search Forward', + }, + { 'jp', "lua require('flash').jump({continue = true})", desc = 'Previous Jump' }, + { 'js', "lua require('flash').jump()", desc = 'Search' }, + { 'jt', "lua require('flash').treesitter_search()", desc = 'Remote Treesitter' }, + { + 'jw', + 'lua require("flash").jump({ pattern = vim.fn.expand("")})', + desc = 'Current Word', + }, + + { 'l', group = ' LSP' }, + { 'la', desc = 'Lspsaga range_code_action' }, + + { 'r', group = ' Refactor' }, + { + 're', + "lua require('refactoring').refactor('Extract Function')", + desc = 'Extract Function', + }, + { + 'rf', + "lua require('refactoring').refactor('Extract Function To File')", + desc = 'Extract To File', + }, + { 'ri', "lua require('refactoring').refactor('Inline Variable')", desc = 'Inline Variable' }, + { + 'rr', + "lua require('telescope').extensions.refactoring.refactors()", + desc = 'Refactor Commands', + }, + { + 'rv', + "lua require('refactoring').refactor('Extract Variable')", + desc = 'Extract Variable', + }, + + { 'y', group = ' Yank' }, + { 'yg', 'lua require"gitlinker".get_buf_range_url("v")', desc = 'Copy Git URL' }, +} + +local no_leader_mappings = { + mode = 'n', + { '', 'resize -10', desc = 'Decrease window height' }, + { '', 'vertical resize -10', desc = 'Decrease window width' }, + { '', 'vertical resize +10', desc = 'Increase window width' }, + { '', 'resize +10which_key.add(no_leader_mappings)', desc = 'Increase window height' }, + { '', 'Telescope find_files', desc = 'Find Files' }, + { '', 'Fterm lazygit', desc = 'Lazygit' }, + + { '', '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' }, + { '', 'bprevious', desc = 'Previous Buffer' }, + { '', 'bnext', desc = 'Next Buffer' }, + + { 'K', 'Lspsaga hover_doc', desc = 'LSP Hover' }, + { 'Q', 'qall!', desc = 'Force Quit!' }, + { 'U', 'redo', desc = 'Redo' }, + + { '[', group = ' Previous' }, + { '[B', 'bfirst', desc = 'First Buffer' }, + { '[b', 'bprevious', desc = 'Buffer' }, + { '[d', 'Lspsaga diagnostic_jump_prev', desc = 'Diagnostic' }, + { '[e', 'g;', desc = 'Edit' }, + { '[g', 'Gitsigns prev_hunk', desc = 'Git Hunk' }, + { '[j', '', desc = 'Jump' }, + + { ']', group = ' Next' }, + { ']B', 'blast', desc = 'Buffer' }, + { ']b', 'bnext', desc = 'Buffer' }, + { ']d', 'Lspsaga diagnostic_jump_next', desc = 'Diagnostic' }, + { ']e', 'g,', desc = 'Edit' }, + { ']g', 'Gitsigns next_hunk', desc = 'Git Hunk' }, + { ']j', '', desc = 'Jump' }, + + { '', '(YankyCycleForward)' }, + { '', '(YankyCycleBackward)' }, + { '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' }, + + { + '', + ':call vm#commands#add_cursor_down(0, v:count1)', + desc = 'Add Cursor Down', + mode = { 'n' }, + noremap = true, + silent = true, + }, + { + '', + ':call vm#commands#add_cursor_up(0, v:count1)', + desc = 'Add Cursor Up', + mode = { 'n' }, + noremap = true, + silent = true, + }, + { + '', + ':call vm#commands#add_cursor_down(0, v:count1)', + desc = 'Add Cursor Down', + mode = { 'n' }, + noremap = true, + silent = true, + }, + { + '', + ':call vm#commands#add_cursor_up(0, v:count1)', + desc = 'Add Cursor Down', + mode = { 'n' }, + noremap = true, + silent = true, + }, + { + '', + ':call vm#commands#ctrln(v:count1)', + desc = 'Multi Edit Next', + mode = { 'n' }, + noremap = true, + silent = true, + }, +} + +which_key.setup(setup) +which_key.add(n_mappings) +which_key.add(v_mappings) +which_key.add(no_leader_mappings) diff --git a/lua/plugins/configs/zen&twilight.lua b/lua/plugins/configs/zen&twilight.lua new file mode 100644 index 0000000..e5f707c --- /dev/null +++ b/lua/plugins/configs/zen&twilight.lua @@ -0,0 +1,41 @@ +local twilight = require('twilight') + +twilight.setup({ + dimming = { alpha = 0.45, color = { 'Normal', '#ffffff' }, inactive = false }, + context = 9, + treesitter = true, + expand = { 'function', 'method', 'table', 'if_statement', 'element' }, + exclude = {}, +}) + +local zen = require('zen-mode') + +zen.setup({ + window = { + backdrop = 0.95, + width = 180, + height = 1, + options = { + signcolumn = 'no', + number = false, + relativenumber = false, + cursorline = false, + cursorcolumn = false, + foldcolumn = '0', + list = false, + }, + }, + plugins = { + options = { enabled = true, ruler = true, showcmd = true }, + twilight = { enabled = true }, + gitsigns = { enabled = true }, + tmux = { enabled = true }, + kitty = { enabled = false, font = '+4' }, + }, + on_open = function(win) + vim.o.laststatus = 0 + end, + on_close = function() + vim.o.laststatus = 2 + end, +}) diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 19d0c79..c300e29 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -5,18 +5,6 @@ return { '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') diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua index 6eda8a5..f3f11cf 100644 --- a/lua/plugins/database.lua +++ b/lua/plugins/database.lua @@ -5,16 +5,6 @@ return { 'kristijanhusak/vim-dadbod-ui', 'kristijanhusak/vim-dadbod-completion', }, - keys = { - { 'du', ':DBUIToggle', desc = 'Toggle DB UI' }, - { 'db', ':DBUIFindBuffer', desc = 'DB Find buffer' }, - { - 'dr', - ':DBUIRenameBuffer', - desc = 'DB Rename buffer', - }, - { 'dl', ':DBUILastQueryInfo', desc = 'DB Last query' }, - }, config = function() local function db_completion() require('plugins.completion.cmp').setup.buffer({ diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 07dc232..8d18477 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -1,278 +1,169 @@ return { - { - "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', + 'nvim-neo-tree/neo-tree.nvim', + 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, + }, + }, }, - { '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/flash.nvim', + keys = { + { + 's', + mode = { 'n', 'x', 'o' }, + function() + require('flash').jump() + end, + desc = 'Flash', + }, + { + 'S', + mode = { 'n', 'x', 'o' }, + function() + require('flash').treesitter() + end, + desc = 'Flash Treesitter', + }, + }, + config = function() + require('plugins.configs.jump') + end, }, + { + 'folke/trouble.nvim', + lazy = true, + cmd = { 'Trouble', 'TroubleToggle', 'TroubleRefresh' }, + opts = { + modes = { + lsp = { + win = { position = 'right' }, + }, + }, + }, + }, + { + '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' }, + }, + config = function() + require('plugins.configs.telescope') + end, + }, + { + 'smjonas/inc-rename.nvim', + cmd = 'IncRename', + config = true, + }, + { - }, - }, - { - "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 } - ) - local icons = require("lib.icons") - require("lspsaga").setup({ - ui = { - theme = "round", - border = "rounded", - devicon = true, - title = true, - winblend = 1, - expand = icons.ui.ArrowOpen, - collapse = icons.ui.ArrowClosed, - preview = icons.ui.List, - code_action = icons.diagnostics.Hint, - diagnostic = icons.ui.Bug, - incoming = icons.ui.Incoming, - outgoing = icons.ui.Outgoing, - hover = icons.ui.Comment, - }, - 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" }, - }, - }, + 'akinsho/toggleterm.nvim', + cmd = { 'ToggleTerm' }, + version = 'v2.*', + config = function() + require('plugins.configs.toggleterm') + end, + }, + { + '2kabhishek/termim.nvim', + cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' }, + }, + { + 'nvimdev/lspsaga.nvim', + lazy = true, + event = 'LspAttach', + config = function() + local icons = require('lib.icons') + require('lspsaga').setup({ + ui = { + theme = 'round', + border = 'rounded', + devicon = true, + title = true, + winblend = 1, + expand = icons.ui.ArrowOpen, + collapse = icons.ui.ArrowClosed, + preview = icons.ui.List, + code_action = icons.diagnostics.Hint, + diagnostic = icons.ui.Bug, + incoming = icons.ui.Incoming, + outgoing = icons.ui.Outgoing, + hover = icons.ui.Comment, + }, + 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, + }, } diff --git a/lua/plugins/extra.lua b/lua/plugins/extra.lua index 2e2d7a2..fa028b5 100644 --- a/lua/plugins/extra.lua +++ b/lua/plugins/extra.lua @@ -2,20 +2,36 @@ return { { 'ThePrimeagen/refactoring.nvim', config = function() - require('refactoring').setup() - -- vim.keymap.set("x", "re", ":Refactor extract ") - -- vim.keymap.set("x", "rf", ":Refactor extract_to_file ") - -- vim.keymap.set("x", "rv", ":Refactor extract_var ") - -- vim.keymap.set({ "n", "x" }, "ri", ":Refactor inline_var") - -- vim.keymap.set("n", "rI", ":Refactor inline_func") - -- vim.keymap.set("n", "rb", ":Refactor extract_block") - -- vim.keymap.set("n", "rbf", ":Refactor extract_block_to_file") - -- load refactoring Telescope extension - require('telescope').load_extension('refactoring') + require('refactoring').setup({ + prompt_func_return_type = { + go = false, + java = false, + cpp = false, + c = false, + h = false, + hpp = false, + cxx = false, + }, + prompt_func_param_type = { + go = false, + java = false, - vim.keymap.set({ 'n', 'x' }, 'rr', function() - require('telescope').extensions.refactoring.refactors() - end, { desc = 'Refactor' }) + cpp = false, + c = false, + h = false, + hpp = false, + cxx = false, + }, + printf_statements = {}, + print_var_statements = {}, + }) + end, + }, + { + 'folke/which-key.nvim', + event = 'VeryLazy', + config = function() + require('plugins.configs.whichkey') end, }, { @@ -27,6 +43,22 @@ return { }) end, }, + { + 'uga-rosa/ccc.nvim', + cmd = { 'CccHighlighterToggle', 'CccConvert', 'CccPick' }, + config = function() + vim.opt.termguicolors = true + + local ccc = require('ccc') + + ccc.setup({ + highlighter = { + auto_enable = true, + lsp = true, + }, + }) + end, + }, { '2kabhishek/nerdy.nvim', dependencies = { 'stevearc/dressing.nvim' }, @@ -36,29 +68,6 @@ 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', @@ -68,43 +77,23 @@ return { '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' }, - }, + config = function() + require('plugins.configs.spectre') + end, }, { 'folke/zen-mode.nvim', - cmd = { 'ZenMode' }, - opts = {}, - keys = { - { 'wz', 'ZenMode', desc = 'Toggle zen mode' }, + dependencies = { + 'folke/twilight.nvim', }, + config = function() + require('plugins.configs.zen&twilight') + end, + cmd = { 'ZenMode', 'Twilight' }, }, { 'creativenull/dotfyle-metadata.nvim', @@ -171,8 +160,5 @@ return { 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/lint.lua b/lua/plugins/lint.lua index be6b475..dcf8e83 100644 --- a/lua/plugins/lint.lua +++ b/lua/plugins/lint.lua @@ -1,6 +1,5 @@ -- Define nvim-lint linters here local linting_servers = { - 'cpplint', 'eslint_d', 'cspell', 'ruff', @@ -26,8 +25,6 @@ return { lint.linters_by_ft = { -- lua = { 'selene' }, - cpp = { 'cpplint' }, - c = { 'cpplint' }, javascript = { 'eslint_d' }, typescript = { 'eslint_d' }, javascriptreact = { 'eslint_d' }, @@ -46,7 +43,7 @@ return { end, }) - vim.keymap.set('n', 'cl', function() + vim.keymap.set('n', 'cL', function() lint.try_lint() end, { desc = 'Trigger linting for current file' }) end, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 2fd3a31..40dc7c7 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -8,7 +8,7 @@ return { 'williamboman/mason-lspconfig.nvim', }, config = function() - require('configs.lsp') + require('plugins.configs.lsp') end, }, { @@ -30,14 +30,4 @@ return { }) 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/test.lua b/lua/plugins/test.lua index 536de3d..310bfd3 100644 --- a/lua/plugins/test.lua +++ b/lua/plugins/test.lua @@ -24,17 +24,4 @@ return { }, }) 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/ui.lua b/lua/plugins/ui.lua index 765b233..74b6ca5 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,187 +1,180 @@ 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 = { "BufReadPre", "BufNewFile" }, - config = function() - local dressing = require("dressing") + { + '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, + format = 'lsp_progress', + format_done = 'lsp_progress_done', + throttle = 1000 / 30, + view = 'mini', + }, + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, + }, + hover = { + enabled = true, + silent = false, + view = nil, + opts = {}, + }, + signature = { + enabled = false, + auto_open = { + enabled = true, + trigger = true, + luasnip = true, + throttle = 50, + }, + view = nil, + opts = {}, + }, + message = { + enabled = true, + view = 'notify', + opts = {}, + }, + documentation = { + view = 'hover', + opts = { + lang = 'markdown', + replace = true, + render = 'plain', + format = { '{message}' }, + win_options = { concealcursor = 'n', conceallevel = 3 }, + }, + }, + }, + presets = { + bottom_search = true, + command_palette = false, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = true, + }, + }, + }, + { + 'stevearc/dressing.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + config = function() + local dressing = require('dressing') - dressing.setup({ - win_options = { - winblend = 10, - winhighlight = "Normal:DressingInputNormalFloat,NormalFloat:DressingInputNormalFloat,FloatBorder:DressingInputFloatBorder", - }, - input = { - enabled = true, - default_prompt = "Input:", - prompt_align = "left", - insert_only = true, - start_in_insert = true, - border = "rounded", - relative = "cursor", - prefer_width = 40, - width = nil, - max_width = { 140, 0.9 }, - min_width = { 20, 0.2 }, - get_config = nil, - }, - select = { - enabled = true, - backend = { "telescope", "fzf_lua", "fzf", "nui", "builtin" }, - trim_prompt = true, - }, - }) - 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" }, - }, - }, - }, - { - "nvimdev/dashboard-nvim", - cmd = "Dashboard", - config = function() - require("configs.dashboard") - end, - event = function() - if vim.fn.argc() == 0 then - return "VimEnter" - end - end, - }, + dressing.setup({ + win_options = { + winblend = 10, + winhighlight = 'Normal:DressingInputNormalFloat,NormalFloat:DressingInputNormalFloat,FloatBorder:DressingInputFloatBorder', + }, + input = { + enabled = true, + default_prompt = 'Input:', + prompt_align = 'left', + insert_only = true, + start_in_insert = true, + border = 'rounded', + relative = 'cursor', + prefer_width = 40, + width = nil, + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + get_config = nil, + }, + select = { + enabled = true, + backend = { 'telescope', 'fzf_lua', 'fzf', 'nui', 'builtin' }, + trim_prompt = true, + }, + }) + end, + }, + { + 'nvim-lualine/lualine.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + config = function() + require('plugins.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' }, + }, + }, + }, + { + 'nvimdev/dashboard-nvim', + cmd = 'Dashboard', + config = function() + require('plugins.configs.dashboard') + end, + event = function() + if vim.fn.argc() == 0 then + return 'VimEnter' + end + end, + }, } diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua deleted file mode 100644 index 219ed3e..0000000 --- a/lua/plugins/whichkey.lua +++ /dev/null @@ -1,170 +0,0 @@ -local icons = require("lib.icons") -return { - "folke/which-key.nvim", - event = "UIEnter", - opts = { - preset = "helix", - icons = { - breadcrumb = icons.ui.ArrowOpen, - separator = icons.ui.Arrow, - group = "", - keys = { - Space = icons.ui.Rocket, - }, - rules = false, -- enable auto icon rules - }, - 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" }, - { "r", group = " Run" }, - { "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" }, - { "cc", ":g/^\\s*$/d", desc = "Clean Empty Lines" }, - { "co", "Dashboard", desc = "Dashboard" }, - { "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", - }, - { "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" }, - }, -}