├── .gitignore ├── .scrots ├── colorizer_hover.png ├── completion.png ├── gitsigns.png ├── lsp_errors.png ├── lsp_warnings.png └── symbols_c.png ├── LICENSE ├── README.md ├── init.lua ├── lua ├── config │ ├── autocmds.lua │ ├── init.lua │ ├── keymaps.lua │ └── options.lua ├── plugins │ ├── browse.lua │ ├── clangd_extensions.lua │ ├── clipboard-image.lua │ ├── cybu.lua │ ├── harpoon.lua │ ├── init.lua │ ├── lsp │ │ ├── overrides.lua │ │ └── setup.lua │ ├── productivity.lua │ ├── project.lua │ ├── ranger.lua │ ├── sshfs.lua │ ├── venn.lua │ └── zen-mode.lua └── shadovim │ ├── config │ ├── autocmds.lua │ ├── init.lua │ ├── options.lua │ └── utils.lua │ ├── plugins │ ├── aerial.lua │ ├── alpha.lua │ ├── barbecue.lua │ ├── blankline.lua │ ├── bookmarks.lua │ ├── cmp.lua │ ├── colorizer.lua │ ├── comment.lua │ ├── conform.lua │ ├── dapui.lua │ ├── devicons.lua │ ├── dressing.lua │ ├── gitsigns.lua │ ├── init.lua │ ├── jabs.lua │ ├── lazygit.lua │ ├── lsp │ │ ├── attach.lua │ │ └── init.lua │ ├── lualine.lua │ ├── luasnips.lua │ ├── mini.lua │ ├── neoclip.lua │ ├── neotree.lua │ ├── noice.lua │ ├── resession.lua │ ├── rustaceanvim.lua │ ├── telescope.lua │ ├── theme.lua │ ├── toggleterm.lua │ ├── treesitter.lua │ ├── ufo.lua │ └── whichkey.lua │ └── themes │ ├── integrations.lua │ └── lualine │ └── shadoline.lua └── stylua.toml /.gitignore: -------------------------------------------------------------------------------- 1 | plugin 2 | ftplugin 3 | spell 4 | lazy-lock.json 5 | 6 | .comments 7 | .vim-bookmarks 8 | .ignore/ 9 | -------------------------------------------------------------------------------- /.scrots/colorizer_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/colorizer_hover.png -------------------------------------------------------------------------------- /.scrots/completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/completion.png -------------------------------------------------------------------------------- /.scrots/gitsigns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/gitsigns.png -------------------------------------------------------------------------------- /.scrots/lsp_errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/lsp_errors.png -------------------------------------------------------------------------------- /.scrots/lsp_warnings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/lsp_warnings.png -------------------------------------------------------------------------------- /.scrots/symbols_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shadorain/shadovim/a1021681cb5bcdb32a540d2a80dd5eebc58e7523/.scrots/symbols_c.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Shadorain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | shadovim 2 | ========== 3 | 4 | A neovim setup for the shadow warriors. Speed through the light with the 5 | power of shadovim built on the new Lua based neovim! With the highly 6 | overpowered native LSP, built in auto-completion, snippets, menus and so 7 | much more, you will unleash the power of a hundred million shadows! 8 | 9 | > P.S: even I am shocked by how absolutely fast the LSP, completion, 10 | > and startup is. Threw me for a wonderful surprise! 11 | 12 | Installation 13 | ============== 14 | 15 | Installing shadovim is relatively simple. Make sure you have Nvim v0.5.0 16 | or higher (install and build from nightly source). 17 | 18 | Simply clone the repository, change directory to it, give the setup script 19 | execute permissions, and run it and it will setup shadovim no problem! 20 | It is well documented and has error checking as well to make sure you know 21 | what happened if it errors. 22 | 23 | ```bash 24 | ❱ git clone https://github.com/Shadorain/shadovim ~/.config/nvim 25 | ❱ cd ~/.config/nvim/ 26 | ❱ chmod +x ./setup 27 | ❱ ./setup 28 | ``` 29 | 30 | General Content 31 | ================= 32 | 33 | Shadovim has a very simple file tree, the main content is handled in the 34 | `lua/` directory: 35 | 36 | ```bash 37 | . 38 | ├── init.lua # All initializing and sourcing 39 | └── lua 40 |    ├── binds.lua # Any keybinds 41 |    ├── config.lua # General and plugin configuration settings 42 |    ├── lsp_config.lua # Configures general lsp and extra lsp based plugins 43 |    └── plugins.lua # Packer setup and plugin defining 44 | ``` 45 | 46 | All snippets can be added in the `snips/` directory. Any syntax files in 47 | the `syntax/` directory. 48 | 49 | Show off 50 | ============= 51 | 52 | Here are some cool screenshots of it in action! 53 | 54 | ### Lsp Errors 55 | 56 | Colors the text inside the popup window with red for error and pink for warning, 57 | with proper symbols on the side. Hints get shown in the windows as well if any 58 | exist! 59 | 60 | ![lsp_errors](.scrots/lsp_errors.png) 61 | ![lsp_warnings](.scrots/lsp_warnings.png) 62 | 63 | ### Completion 64 | 65 | Full autocompletion menu with icons and descriptors for the source where the 66 | completion is coming from, and special documentation blocks that are fully 67 | configurable to explain the completion entry! 68 | 69 | ![completion](.scrots/completion.png) 70 | 71 | ### Git Signs 72 | 73 | Track your changes with git indicators on the side. [ Green:Add, Blue:Change, 74 | Red:Delete]. 75 | 76 | ![gitsigns](.scrots/gitsigns.png) 77 | 78 | ### Hover Documents & Colorizer 79 | 80 | Colorizer that highlights the colors in the text with the color written. 81 | Hover menu for documentation and whatever else! 82 | 83 | ![hover_colorizer](.scrots/colorizer_hover.png) 84 | 85 | ### Symbol Outline 86 | 87 | An in depth symbol analysis of the file, with previews, keybinds and many 88 | more options. 89 | 90 | > This is a C file. Works in all filetypes with lsp support too! 91 | 92 | ![symbol_outline_c](.scrots/symbols_c.png) 93 | 94 | You now have a fully setup Shadovim configuration! With shadotheme and 95 | a bunch of other cool perks under your sleeves! To see all the power it has 96 | there is no better way that to read the source, it is all in there! 97 | 98 | I hope you enjoy! God bless 😊 99 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- NOTE: Author : Shadorain 2 | -- NOTE: Github : @Shadorain 3 | 4 | ------------------------------- WELCOME TO SHADOVIM ---------------------------- 5 | -- WARNING: THIS IS A PERSONAL CONFIGURATION NOT A DISTRO, YOU CAN USE DEFAULT CONFIGURATION OR CUSTOMIZE IT 6 | 7 | require("shadovim.config") 8 | 9 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 10 | if not vim.loop.fs_stat(lazypath) then 11 | vim.cmd("redraw") 12 | vim.api.nvim_echo({ { "Welcome to Shadovim 󱠡 ", "Bold" } }, true, {}) 13 | local repo = "https://github.com/folke/lazy.nvim.git" 14 | local output = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", repo, lazypath }) 15 | assert(vim.v.shell_error == 0, "External call failed with error code: " .. vim.v.shell_error .. "\n" .. output) 16 | vim.opt.rtp:prepend(lazypath) 17 | require("shadovim.plugins") 18 | vim.cmd("ShadovimCheckMason") 19 | vim.cmd("redraw") 20 | vim.api.nvim_echo({ { "Wait for everything install. Reopen Neovim then ENJOY!", "Bold" } }, true, {}) 21 | end 22 | vim.opt.rtp:prepend(lazypath) 23 | require("shadovim.plugins") 24 | -------------------------------------------------------------------------------- /lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | 2 | -- FileType 3 | vim.api.nvim_create_autocmd("FileType", { pattern={"norg", "lua"}, command = "set sw=2 ts=2 sts=2" }) 4 | vim.api.nvim_create_autocmd("FileType", { pattern="cpp", command = "set sw=4 ts=4 sts=4" }) 5 | vim.api.nvim_create_autocmd("FileType", { pattern="markdown", command = "setlocal spell spelllang=en_us" }) 6 | vim.api.nvim_create_autocmd("FileType", { pattern="*", command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o" }) 7 | 8 | -- Ctags 9 | -- vim.api.nvim_create_autocmd("BufRead", { pattern="*.rs", command = "setlocal tags=./rusty-tags.vi;/,$RUST_SRC_PATH/rusty-tags.vi" }) 10 | -- vim.api.nvim_create_autocmd("BufWritePost", { pattern="*.rs", command = "silent! exec \"!rusty-tags vi --quiet --start-dir=\" . expand('%:p:h') . \"&\" | redraw!" }) 11 | -------------------------------------------------------------------------------- /lua/config/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.keymaps = require("config.keymaps") 4 | M.options = require("config.options") 5 | M.autocmds = require("config.autocmds") 6 | 7 | return M 8 | -------------------------------------------------------------------------------- /lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- Leader 4 | M.whichkeys = function() 5 | -- local m_mappings = { 6 | -- ["m"] = { 7 | -- name = " BOOKMARKS", 8 | -- -- Bookmarks 9 | -- A = { "silent BookmarkAnnotate", "Annotate" }, 10 | -- B = { "silent BookmarkToggle", "Toggle" }, 11 | -- C = { "silent BookmarkClear", "Clear" }, 12 | -- X = { "silent BookmarkClearAll", "Clear All" }, 13 | -- j = { "silent BookmarkNext", "Next" }, 14 | -- k = { "silent BookmarkPrev", "Prev" }, 15 | -- S = { "silent BookmarkShowAll", "Show" }, 16 | -- 17 | -- -- Harpoon 18 | -- m = { 'lua require("harpoon"):list():append()', "Harpoon" }, 19 | -- ["."] = { 'lua require("harpoon"):list():prev()', "Harpoon Next" }, 20 | -- [","] = { 'lua require("harpoon"):list():next()', "Harpoon Prev" }, 21 | -- [";"] = { 'lua require("harpoon.ui"):toggle_quick_menu(require("harpoon"):list())', "Harpoon UI" }, 22 | -- }, 23 | -- } 24 | local m_mappings = { 25 | { "m", group = " BOOKMARKS" }, 26 | -- Bookmarks 27 | { "mA", "silent BookmarkAnnotate", desc = "Annotate" }, 28 | { "mB", "silent BookmarkToggle", desc = "Toggle" }, 29 | { "mC", "silent BookmarkClear", desc = "Clear" }, 30 | { "mS", "silent BookmarkShowAll", desc = "Show" }, 31 | { "mX", "silent BookmarkClearAll", desc = "Clear All" }, 32 | { "mj", "silent BookmarkNext", desc = "Next" }, 33 | { "mk", "silent BookmarkPrev", desc = "Prev" }, 34 | -- Harpoon 35 | { "m,", 'lua require("harpoon"):list():next()', desc = "Harpoon Prev" }, 36 | { "m.", 'lua require("harpoon"):list():prev()', desc = "Harpoon Next" }, 37 | { "m;", 'lua require("harpoon.ui"):toggle_quick_menu(require("harpoon"):list())', desc = "Harpoon UI" }, 38 | { "mm", 'lua require("harpoon"):list():append()', desc = "Harpoon" }, 39 | } 40 | -- local v_mappings = { 41 | -- d = { 42 | -- name = "Debug", 43 | -- K = { 'lua require("dap.ui.variables").visual_hover()', "Range Hover" }, 44 | -- }, 45 | -- D = { 46 | -- name = "Dioxus", 47 | -- x = { "!dx translate", "Range DX Translate" }, 48 | -- }, 49 | -- } 50 | local v_mappings = { 51 | { 52 | mode = { "v" }, 53 | { "D", group = "Dioxus", }, 54 | { "Dx", "!dx translate", desc = "Range DX Translate", }, 55 | { "d", group = "Debug", }, 56 | { "dK", 'lua require("dap.ui.variables").visual_hover()', desc = "Range Hover" }, 57 | }, 58 | } 59 | local t_mappings = { 60 | { "b", group = " TERMINAL" }, 61 | -- { "bk", "ToggleTerm direction=float", desc = "Terminal Float" }, 62 | { "bm", "ToggleTerm direction=float", desc = "Terminal Float" }, 63 | { "bv", "ToggleTerm size=50 direction=vertical", desc = "Terminal Side" }, 64 | { "b,", "ToggleTerm size=10 direction=horizontal", desc = "Terminal Bottom" }, 65 | { "b1", "1ToggleTerm", desc = "Terminal 1" }, 66 | { "b2", "2ToggleTerm", desc = "Terminal 2" }, 67 | { "b3", "3ToggleTerm", desc = "Terminal 3" }, 68 | { "b4", "4ToggleTerm", desc = "Terminal 4" }, 69 | } 70 | 71 | local g_mappings = { 72 | { "c", group = "// COMMENTS" }, 73 | { "cB", group = "□ COMMENT BOX" }, 74 | { "cbb", "CBccbox", desc = "Box Title" }, 75 | { "cbd", "CBd", desc = "Remove a box" }, 76 | { "cbl", "CBline", desc = "Simple Line" }, 77 | { "cbm", "CBllbox14", desc = "Marked" }, 78 | { "cbt", "CBllline", desc = "Titled Line" }, 79 | } 80 | 81 | local n_mappings = { 82 | { "", group = "Shadovim" }, 83 | { "u", "ShadovimUpdate", desc = "Update Shadovim" }, 84 | { "m", "ShadovimCheckMason", desc = "Check Mason" }, 85 | { "r", "source ~/.config/nvim/init.lua", desc = "Reload Config" }, 86 | { "s", "Fidget suppress", desc = "Suppress Notifications" }, 87 | { "c", "Fidget clear", desc = "Clear Notifications" }, 88 | { "l", "Fidget lsp_suppress", desc = "Suppress LSP Notifications" }, 89 | 90 | -- { "D", group = "Dioxus" }, 91 | -- { "Dx", "%!dx translate", desc = "DX Translate File" }, 92 | 93 | { "P", group = " POMO" }, 94 | { "Pv", "TimerShow", desc = "Show" }, 95 | { "Ps", "TimerStart", desc = "Start" }, 96 | { "PR", "TimerResume", desc = "Resume" }, 97 | { "Pp", "TimerPause", desc = "Pause" }, 98 | { "PS", "TimerStop", desc = "Stop" }, 99 | { "Pr", "TimerRepeat", desc = "Repeat" }, 100 | { "P1", "TimerStart 1m", desc = "1m" }, 101 | { "P5", "TimerStart 5m", desc = "5m" }, 102 | { "PH", "TimerStart 30m", desc = "30m" }, 103 | { "Ph", "TimerStart 1h", desc = "1h" }, 104 | 105 | { "b", group = " BUFFERS" }, 106 | { "b,", "ToggleTerm size=10 direction=horizontal", desc = "Terminal Bottom" }, 107 | { "b1", "1ToggleTerm", desc = "Terminal 1" }, 108 | { "b2", "2ToggleTerm", desc = "Terminal 2" }, 109 | { "b3", "3ToggleTerm", desc = "Terminal 3" }, 110 | { "b4", "4ToggleTerm", desc = "Terminal 4" }, 111 | { "bb", "bn", desc = "Next" }, 112 | { "bf", "set shiftwidth=4 | set tabstop=4 | set softtabstop=4", desc = "Fix Spacing" }, 113 | { "bk", "lua MiniBufremove.delete()", desc = "Delete" }, 114 | { "bl", "ls", desc = "List" }, 115 | { "bm", "ToggleTerm direction=float", desc = "Terminal Float" }, 116 | { "bn", "bp", desc = "Prev" }, 117 | { "bu", "lua MiniBufremove.unshow", desc = "Unload" }, 118 | { "bv", "ToggleTerm size=50 direction=vertical", desc = "Terminal Side" }, 119 | 120 | { "d", group = " DEBUG" }, 121 | { "dK", 'lua require("dap.ui.widgets").hover()', desc = "Hover" }, 122 | { "db", 'lua require("dap").toggle_breakpoint()', desc = "Breakpoint" }, 123 | { "dc", 'lua require("dap").continue()', desc = "Continue" }, 124 | { "df", 'lua require("dapui").float_element()', desc = "Float" }, 125 | { "dj", 'lua require("dap").down()', desc = "Down STrace" }, 126 | { "dk", 'lua require("dap").up()', desc = "Up STrace" }, 127 | { "dl", 'lua require("dap").run_last()', desc = "Run Last" }, 128 | { "dp", 'lua require("dap.ui.widgets").preview()', desc = "Preview" }, 129 | { "dq", 'lua require("dap").terminate()', desc = "Terminate" }, 130 | { "ds", group = " STEP" }, 131 | { "du", 'lua require("dapui").toggle()', desc = "UI" }, 132 | { "dsi", 'lua require("dap").step_into()', desc = "Into" }, 133 | { "dso", 'lua require("dap").step_over()', desc = "Over" }, 134 | { "dsx", 'lua require("dap").step_out()', desc = "Out" }, 135 | 136 | { "f", group = " FILES" }, 137 | { "fe", "Neotree toggle", desc = "Neo-Tree" }, 138 | { "fj", "lua require('jot').toggle()", desc = "Jot" }, 139 | { "ff", "Telescope find_files", desc = "Find" }, 140 | { "fr", "Telescope oldfiles", desc = "Recent" }, 141 | 142 | { "g", group = "󰊢 GIT" }, 143 | { "gB", "Gitsigns blame_line{full=true}", desc = "Blame Line Full" }, 144 | { "gR", "Gitsigns reset_buffer", desc = "Reset Buffer" }, 145 | { "gS", "Gitsigns undo_stage_hunk", desc = "Undo Stage Hunk" }, 146 | { "gb", "Gitsigns blame_line", desc = "Blame Line" }, 147 | { "gd", "Gitsigns diffthis HEAD", desc = "Diff" }, 148 | { "gj", "Gitsigns next_hunk", desc = "Next Hunk" }, 149 | { "gk", "Gitsigns prev_hunk", desc = "Prev Hunk" }, 150 | { "gr", "Gitsigns reset_hunk", desc = "Reset Hunk" }, 151 | { "gs", "Gitsigns stage_hunk", desc = "Stage Hunk" }, 152 | { "gm", "Telescope git_commits", desc = "Checkout Commit" }, 153 | { "go", "Telescope git_status", desc = "Open Changed File" }, 154 | { "gc", "Telescope git_branches", desc = "Checkout Branch" }, 155 | { "gg", "LazyGit", desc = "Lazygit" }, 156 | { "gG", "LazyGitConfig", desc = "Lazygit Config" }, 157 | 158 | { "l", group = " LSP" }, 159 | { "lA", "AerialToggle", desc = "Aerial" }, 160 | { "lN", "AerialNavToggle", desc = "Aerial Nav" }, 161 | { "ln", "Navbuddy", desc = "Navbuddy" }, 162 | { "lI", "LspInfo", desc = "Info" }, 163 | { "ls", "Telescope lsp_document_symbols", desc = "Document Symbols" }, 164 | { "lS", "Telescope lsp_dynamic_workspace_symbols", desc = "Workspace Symbols" }, 165 | { "lu", "TSUpdate", desc = "Treesitter Update" }, 166 | { "li", "TSInstallInfo", desc = "Treesitter Info" }, 167 | { "lj", "lua vim.diagnostic.goto_next({buffer=0})", desc = "Next Diagnostic" }, 168 | { "lk", "lua vim.diagnostic.goto_prev({buffer=0})", desc = "Prev Diagnostic" }, 169 | { "lr", "lua vim.lsp.buf.rename()", desc = "Rename" }, 170 | { "la", "lua vim.lsp.buf.code_action()", desc = "Code Action" }, 171 | 172 | { "m", group = " MISC" }, 173 | { "mm", "lua MiniMap.toggle()", desc = "Minimap" }, 174 | { "mR", "lua MiniMap.refresh()", desc = "Refresh Minimap" }, 175 | { "mt", "lua MiniTrailspace.trim()", desc = "Trim Trailspace" }, 176 | 177 | { "n", group = " NEOGEN" }, 178 | { "nc", "Neogen class", desc = "Class" }, 179 | { "nt", "Neogen type", desc = "Type" }, 180 | { "nf", "Neogen func", desc = "Function" }, 181 | { "nl", "Neogen file", desc = "File" }, 182 | { "nn", "Neogen", desc = "Any" }, 183 | 184 | { "o", group = " OPTIONS" }, 185 | { "on", "lua require('shadovim.config.utils').toggle_option('number')", desc = "Number" }, 186 | { "oo", "Ranger", desc = "Ranger" }, 187 | { "or", "lua require('shadovim.config.utils').toggle_option('relativenumber')", desc = "Relative Number" }, 188 | { "os", "lua require('shadovim.config.utils').toggle_option('spell')", desc = "Spell" }, 189 | { "ow", "lua require('shadovim.config.utils').toggle_option('wrap')", desc = "Wrap" }, 190 | 191 | { "p", group = "󰏖 LAZY" }, 192 | { "pi", "Lazy install", desc = "Install" }, 193 | { "ps", "Lazy sync", desc = "Sync" }, 194 | { "pu", "Lazy update", desc = "Update" }, 195 | { "pC", "Lazy clean", desc = "Clean" }, 196 | { "pS", "Lazy show", desc = "Status" }, 197 | { "pc", "Lazy log", desc = "Log" }, 198 | 199 | { "s", group = " SESSION" }, 200 | { "ss", function() require("resession").save() end, desc = "Save" }, 201 | { "sl", function() require("resession").load() end, desc = "Load" }, 202 | { "sd", function() require("resession").delete() end, desc = "Delete" }, 203 | 204 | { "t", group = " TELESCOPE" }, 205 | { "tH", "Telescope highlights", desc = "Highlights" }, 206 | { "tM", "Telescope man_pages", desc = "Man Pages" }, 207 | { "tR", "Telescope registers", desc = "Registers" }, 208 | { "tc", "Telescope commands", desc = "Commands" }, 209 | { "tf", "Telescope find_files", desc = "Find Files" }, 210 | { "th", "Telescope help_tags", desc = "Help Tags" }, 211 | { "tj", "Telescope jumplist", desc = "Jumplist" }, 212 | { "tk", "Telescope keymaps", desc = "Keymaps" }, 213 | { "tm", "Telescope macroscope", desc = "Macros" }, 214 | { "tn", "Telescope noice", desc = "Noice Messages" }, 215 | { "to", "Telescope harpoon marks", desc = "Harpoon" }, 216 | { "tp", "Telescope projects", desc = "Projects" }, 217 | { "tr", "Telescope oldfiles", desc = "Recent Files" }, 218 | { "tt", "TodoTelescope", desc = "Todo" }, 219 | { "tu", "Telescope undo", desc = "Undo" }, 220 | { "tw", "Telescope live_grep", desc = "Find Text" }, 221 | { "ty", "Telescope neoclip", desc = "Clipboard" }, 222 | 223 | { "w", group = " WINDOWS" }, 224 | { "wh", "s", desc = "Horizontal Split" }, 225 | { "wv", "v", desc = "Vertical Split" }, 226 | { "we", "=", desc = "Make Splits Equal" }, 227 | { "wq", "close", desc = "Close Split" }, 228 | } 229 | 230 | local wk = require("which-key") 231 | wk.add(m_mappings, { silent = true, noremap = true, nowait = true, mode = "n" }) 232 | wk.add(n_mappings, { silent = true, noremap = true, nowait = true, mode = "n" }) 233 | wk.add(g_mappings, { silent = true, noremap = true, nowait = true, mode = "n" }) 234 | wk.add(v_mappings, { silent = true, noremap = true, nowait = true, mode = "v" }) 235 | wk.add(t_mappings, { silent = true, noremap = true, nowait = true, mode = "t" }) 236 | end 237 | 238 | -------------------------------------------------------------------------------- 239 | 240 | local opts = { noremap = true, silent = true } 241 | local map = vim.keymap.set 242 | 243 | -- Selection 244 | map("n", "", "ggVG", opts, { desc = "Select All" }) 245 | 246 | -- Save/Quit 247 | map("n", "", ":silent w", opts, { desc = "Save" }) 248 | map("i", "", ":silent w", opts, { desc = "Save (Insert)" }) 249 | map("n", "q", ":qa!", opts, { desc = "Quit" }) 250 | 251 | -- Moving Text 252 | map({ "n", "i" }, "", ":m-2", opts, { desc = "Move Line Up" }) 253 | map({ "n", "i" }, "", ":m+", opts, { desc = "Move Line Down" }) 254 | map("x", "", ":m '<-2gv-gv", opts, { desc = "Move Selection Up" }) 255 | map("x", "", ":m '>+1gv-gv", opts, { desc = "Move Selection Down" }) 256 | map("v", "", "ywpgv", opts, { desc = "Copy text from current split to next" }) 257 | map("v", "", "dwpgv", opts, { desc = "Move text from current split to next" }) 258 | 259 | -- Resizing 260 | map("n", "", ":resize +2", opts, { desc = "Resize Window Up" }) 261 | map("n", "", ":resize -2", opts, { desc = "Resize Window Down" }) 262 | map("n", "", ":vertical resize +2", opts, { desc = "Resize Window Left" }) 263 | map("n", "", ":vertical resize -2", opts, { desc = "Resize Window Right" }) 264 | 265 | -- General Movement 266 | -- map("n", "j", 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', { expr = true }, { desc = "Move Cursor Down (Allow Wrapped)" }) 267 | -- map("n", "k", 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', { expr = true }, { desc = "Move Cursor Up (Allow Wrapped)" }) 268 | map("n", "", "h", opts, { desc = "Move Cursor Left Buffer" }) 269 | map("n", "", "j", opts, { desc = "Move Cursor Down Buffer" }) 270 | map("n", "", "k", opts, { desc = "Move Cursor Up Buffer" }) 271 | map("n", "", "l", opts, { desc = "Move Cursor Right Buffer" }) 272 | map("i", "", "", opts, { desc = "Move Cursor Down in Insert Mode" }) 273 | map("i", "", "", opts, { desc = "Move Cursor Up in Insert Mode" }) 274 | map("i", "", "", opts, { desc = "Move Cursor Left in Insert Mode" }) 275 | map("i", "", "", opts, { desc = "Move Cursor Right in Insert Mode" }) 276 | 277 | map("n", "s", ":HopChar1", opts) 278 | map("n", "S", ":HopPattern", opts) 279 | 280 | map({ "n", "o" }, "f", 281 | ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })", 282 | opts) 283 | map({ "n", "o" }, "F", 284 | ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })", 285 | opts) 286 | map({ "n", "o" }, "t", 287 | ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })", 288 | opts) 289 | map({ "n", "o" }, "T", 290 | ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })", 291 | opts) 292 | 293 | -- Split Management 294 | map("t", "", "h", opts, { desc = "Move out of terminal to split left" }) 295 | map("t", "", "j", opts, { desc = "Move out of terminal to split up" }) 296 | map("t", "", "k", opts, { desc = "Move out of terminal to split down" }) 297 | map("t", "", "l", opts, { desc = "Move out of terminal to split right" }) 298 | map("n", "h", "h", opts, { desc = "Move to split left" }) 299 | map("n", "l", "l", opts, { desc = "Move to split up" }) 300 | map("n", "j", "j", opts, { desc = "Move to split down" }) 301 | map("n", "k", "k", opts, { desc = "Move to split right" }) 302 | map("n", "Ww", "c", opts, { desc = "Close split" }) 303 | map("n", "Wb", "=", opts, { desc = "Balance splits" }) 304 | 305 | -- Buffers 306 | map("n", "", ":CybuLastusedNext", opts, { desc = "Cybu goto last next buffer" }) 307 | map("n", "", ":CybuLastusedPrev", opts, { desc = "Cybu goto last prev buffer" }) 308 | map("n", "", ":CybuLastusedNext", opts, { desc = "Cybu goto last next buffer" }) 309 | map("n", "", ":CybuLastusedPrev", opts, { desc = "Cybu goto last prev buffer" }) 310 | map("n", "", "", opts) 311 | map("n", "", "Bufala split", opts, { desc = "Stack split" }) 312 | map("n", "J", ":JABSOpen", opts, { desc = "Open JABS" }) 313 | 314 | -- Tabs 315 | --- Switch Tab 316 | for i, sym in ipairs({ "!", "@", "#", "$", "%", "^", "&", "*", "(" }) do 317 | map("n", "" .. sym, "Tabbot send " .. i .. "", opts, { desc = "Send to Tab " .. i }) 318 | end 319 | for i = 1, 9 do 320 | map("n", "" .. i, "Tabbot go " .. i .. "", opts, { desc = "Goto Tab " .. i }) 321 | end 322 | 323 | -- Searching 324 | map("n", "", "nohlsearch", opts, { desc = "Clear Highlight" }) 325 | map("n", "n", "nzzzv", opts, { desc = "Center screen on search" }) 326 | map("n", "N", "Nzzzv", opts, { desc = "Center screen on search back" }) 327 | map("n", "R", ":%s///gcI", opts, { desc = "Search and Replace" }) 328 | 329 | -- Telescope 330 | map("n", "", "Telescope find_files", opts, { desc = "Telescope find files" }) 331 | map("i", "", "Telescope live_grep", opts, { desc = "Telescope live grep" }) 332 | map("n", "", "vTelescope find_files", opts, { desc = "Telescope find files in new split" }) 333 | 334 | -- Debugging 335 | map("n", "", 'lua require("dap").step_into()', opts, { desc = "Debugger step into" }) 336 | map("n", "", 'lua require("dap").step_over()', opts, { desc = "Debugger step over" }) 337 | map("n", "", 'lua require("dap").step_out()', opts, { desc = "Debugger step out" }) 338 | 339 | -- Miscellaneous 340 | map("n", "", ":set invnumber invrelativenumber", opts, { desc = "Toggle Line Numbers" }) 341 | map("n", "A", ":Alpha", opts, { desc = "Open Alpha" }) 342 | map("n", "V", ":ToggleVenn", opts, { desc = "Toggle Venn Mode" }) 343 | map("n", "", "ToggleTerm direction=float", opts, { desc = "Toggle Terminal" }) 344 | map("t", "", "ToggleTerm direction=float", opts, { desc = "Toggle Terminal" }) 345 | 346 | map("n", "", 347 | "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false, no_ignore=true, follow=true, hidden=true})", 348 | opts) 349 | vim.cmd([[imap