From b40ab988f15d30945c34ff7522baa021cd46f8ab Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 10 Apr 2024 23:10:24 +0200 Subject: [PATCH] set up new nvim --- .config/lf/lfrc | 27 +- .config/lf/rifle.conf | 4 - .config/nvim/.neoconf.json | 15 + .config/nvim/init.lua | 11 +- .config/nvim/lazyvim.json | 9 + .config/nvim/lua/config/autocmds.lua | 69 +- .config/nvim/lua/config/diagnostic.lua | 40 - .config/nvim/lua/config/filetypes.lua | 27 - .config/nvim/lua/config/icons.lua | 88 -- .config/nvim/lua/config/keymaps.lua | 1223 +---------------- .config/nvim/lua/config/lazy.lua | 47 + .config/nvim/lua/config/lsp.lua | 37 - .config/nvim/lua/config/options.lua | 55 +- .config/nvim/lua/custom/init.lua | 14 + .config/nvim/lua/custom/language.lua | 185 +++ .config/nvim/lua/custom/ui.lua | 121 ++ .config/nvim/lua/funcs.lua | 335 ----- .config/nvim/lua/lazy-init.lua | 13 - .config/nvim/lua/plugins/cmp/cmp.lua | 72 - .config/nvim/lua/plugins/cmp/dap.lua | 15 - .config/nvim/lua/plugins/cmp/init.lua | 5 - .config/nvim/lua/plugins/cmp/luasnip.lua | 22 - .config/nvim/lua/plugins/dap/dap-ui.lua | 23 - .config/nvim/lua/plugins/dap/init.lua | 19 - .config/nvim/lua/plugins/dap/mason-dap.lua | 11 - .config/nvim/lua/plugins/language.lua | 214 +++ .config/nvim/lua/plugins/lazy.lua | 56 - .config/nvim/lua/plugins/lsp/aerial.lua | 22 - .config/nvim/lua/plugins/lsp/init.lua | 9 - .../nvim/lua/plugins/lsp/mason-lspconfig.lua | 43 - .../nvim/lua/plugins/lsp/mason-null-ls.lua | 7 - .config/nvim/lua/plugins/lsp/null-ls.lua | 11 - .config/nvim/lua/plugins/misc/alpha.lua | 169 --- .config/nvim/lua/plugins/misc/autopairs.lua | 17 - .config/nvim/lua/plugins/misc/bufferline.lua | 58 - .config/nvim/lua/plugins/misc/colorizer.lua | 9 - .config/nvim/lua/plugins/misc/comment.lua | 12 - .config/nvim/lua/plugins/misc/gitsigns.lua | 18 - .../lua/plugins/misc/indent-blankline.lua | 37 - .config/nvim/lua/plugins/misc/init.lua | 32 - .config/nvim/lua/plugins/misc/lspkind.lua | 15 - .config/nvim/lua/plugins/misc/lualine.lua | 219 --- .config/nvim/lua/plugins/misc/mason.lua | 29 - .config/nvim/lua/plugins/misc/rustacean.lua | 24 - .config/nvim/lua/plugins/misc/surround.lua | 21 - .config/nvim/lua/plugins/misc/tabnine.lua | 23 - .config/nvim/lua/plugins/misc/taolf.lua | 13 - .../lua/plugins/misc/telescope-fzf-native.lua | 5 - .config/nvim/lua/plugins/misc/telescope.lua | 35 - .../nvim/lua/plugins/misc/todo-comments.lua | 22 - .config/nvim/lua/plugins/misc/toggleterm.lua | 42 - .config/nvim/lua/plugins/misc/tokyonight.lua | 18 - .config/nvim/lua/plugins/misc/treesitter.lua | 64 - .config/nvim/lua/plugins/misc/ufo.lua | 34 - .config/nvim/lua/plugins/misc/vimtex.lua | 11 - .config/nvim/lua/plugins/misc/which-key.lua | 37 - .config/nvim/lua/plugins/ui.lua | 38 + .config/nvim/spell/de.utf-8.add | 13 - .config/nvim/spell/en.utf-8.add | 12 - .config/nvim/stylua.toml | 3 + .config/nvim/todo | 5 - 61 files changed, 671 insertions(+), 3213 deletions(-) create mode 100644 .config/nvim/.neoconf.json create mode 100644 .config/nvim/lazyvim.json delete mode 100644 .config/nvim/lua/config/diagnostic.lua delete mode 100644 .config/nvim/lua/config/filetypes.lua delete mode 100644 .config/nvim/lua/config/icons.lua create mode 100644 .config/nvim/lua/config/lazy.lua delete mode 100644 .config/nvim/lua/config/lsp.lua create mode 100644 .config/nvim/lua/custom/init.lua create mode 100644 .config/nvim/lua/custom/language.lua create mode 100644 .config/nvim/lua/custom/ui.lua delete mode 100644 .config/nvim/lua/funcs.lua delete mode 100644 .config/nvim/lua/lazy-init.lua delete mode 100644 .config/nvim/lua/plugins/cmp/cmp.lua delete mode 100644 .config/nvim/lua/plugins/cmp/dap.lua delete mode 100644 .config/nvim/lua/plugins/cmp/init.lua delete mode 100644 .config/nvim/lua/plugins/cmp/luasnip.lua delete mode 100644 .config/nvim/lua/plugins/dap/dap-ui.lua delete mode 100644 .config/nvim/lua/plugins/dap/init.lua delete mode 100644 .config/nvim/lua/plugins/dap/mason-dap.lua create mode 100644 .config/nvim/lua/plugins/language.lua delete mode 100644 .config/nvim/lua/plugins/lazy.lua delete mode 100644 .config/nvim/lua/plugins/lsp/aerial.lua delete mode 100644 .config/nvim/lua/plugins/lsp/init.lua delete mode 100644 .config/nvim/lua/plugins/lsp/mason-lspconfig.lua delete mode 100644 .config/nvim/lua/plugins/lsp/mason-null-ls.lua delete mode 100644 .config/nvim/lua/plugins/lsp/null-ls.lua delete mode 100644 .config/nvim/lua/plugins/misc/alpha.lua delete mode 100644 .config/nvim/lua/plugins/misc/autopairs.lua delete mode 100644 .config/nvim/lua/plugins/misc/bufferline.lua delete mode 100644 .config/nvim/lua/plugins/misc/colorizer.lua delete mode 100644 .config/nvim/lua/plugins/misc/comment.lua delete mode 100644 .config/nvim/lua/plugins/misc/gitsigns.lua delete mode 100644 .config/nvim/lua/plugins/misc/indent-blankline.lua delete mode 100644 .config/nvim/lua/plugins/misc/init.lua delete mode 100644 .config/nvim/lua/plugins/misc/lspkind.lua delete mode 100644 .config/nvim/lua/plugins/misc/lualine.lua delete mode 100644 .config/nvim/lua/plugins/misc/mason.lua delete mode 100644 .config/nvim/lua/plugins/misc/rustacean.lua delete mode 100644 .config/nvim/lua/plugins/misc/surround.lua delete mode 100644 .config/nvim/lua/plugins/misc/tabnine.lua delete mode 100644 .config/nvim/lua/plugins/misc/taolf.lua delete mode 100644 .config/nvim/lua/plugins/misc/telescope-fzf-native.lua delete mode 100644 .config/nvim/lua/plugins/misc/telescope.lua delete mode 100644 .config/nvim/lua/plugins/misc/todo-comments.lua delete mode 100644 .config/nvim/lua/plugins/misc/toggleterm.lua delete mode 100644 .config/nvim/lua/plugins/misc/tokyonight.lua delete mode 100644 .config/nvim/lua/plugins/misc/treesitter.lua delete mode 100644 .config/nvim/lua/plugins/misc/ufo.lua delete mode 100644 .config/nvim/lua/plugins/misc/vimtex.lua delete mode 100644 .config/nvim/lua/plugins/misc/which-key.lua create mode 100644 .config/nvim/lua/plugins/ui.lua delete mode 100644 .config/nvim/spell/de.utf-8.add delete mode 100644 .config/nvim/spell/en.utf-8.add create mode 100644 .config/nvim/stylua.toml delete mode 100644 .config/nvim/todo diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 8d5372200..29f742d05 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,13 +1,11 @@ # Functions -# HACK: This is needed to trigger the opening function of the taolf nvim plugin cmd open ${{ set +u files=${@:-$fx} [ "$lf_user_multiedit" = "true" ] && { - if [ -z "$TAOLF" ]; then - $EDITOR $fx - return - fi + $EDITOR $fx + lf -remote "send $id unselect" + return } $OPENER "$f" }} @@ -20,15 +18,7 @@ cmd pushedit %{{ echo } echo $files | xargs -r touch - if [ -n "$TAOLF" ]; then - set -- $files - lf -remote "send $id unselect - send $id toggle $files - send $id select $1 - send $id open" - else - lf -remote "send $id \$$OPENER $files" - fi + lf -remote "send $id \$$OPENER $files" }} cmd open-with ${{ @@ -165,14 +155,7 @@ cmd find_word ${{ row="$(echo "$res" | cut -d':' -f2)" column="$(echo "$res" | cut -d':' -f3)" if [ -n "$res" ]; then - if [ -n "$VIM" ]; then - lf -remote "send $id unselect - send $id cd "$(dirname $file)" - send $id set hidden - send $id select "$file" - send $id open - send $id unselect" - elif { [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; } && [ -n "$EMBEDDED" ]; then + if { [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; } && [ -n "$EMBEDDED" ]; then lf -remote "send $id \$$EDITOR +'call cursor($row, $column)' -- $([ -n "$EMBEDDED" ] && echo "--") '$file'" else lf -remote "send $id \$$EDITOR '$file'" diff --git a/.config/lf/rifle.conf b/.config/lf/rifle.conf index 8dd86eacc..f13e78842 100644 --- a/.config/lf/rifle.conf +++ b/.config/lf/rifle.conf @@ -3,7 +3,6 @@ #------------------------------------------- # Environment checks #------------------------------------------- -# env NVIM, env lf_shell = $HOME/.local/libexec/vimlf-open "$@" #------------------------------------------- # Websites @@ -17,9 +16,6 @@ ext x?html?, has w3m, terminal = w3m "$@" #------------------------------------------- # Misc #------------------------------------------- -# HACK: This '-- --' fixes nvim's argument parsing when given empty files. -# Unfortunately I have no idea what's causing this bug. -label editor, mime ^text|x-empty$, env EMBEDDED = ${VISUAL:-$EDITOR} -- -- "$@" label editor, mime ^text|x-empty$ = ${VISUAL:-$EDITOR} -- "$@" label pager, mime ^text|x-empty$ = $PAGER -- "$@" label editor, ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = ${VISUAL:-$EDITOR} -- "$@" diff --git a/.config/nvim/.neoconf.json b/.config/nvim/.neoconf.json new file mode 100644 index 000000000..7c4808746 --- /dev/null +++ b/.config/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 249221c12..3cff727fc 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,9 +1,2 @@ -vim.loader.enable() -require("config.options") -require("lazy-init") -require("config.autocmds") -require("config.filetypes") -require("funcs").set_title() -require("funcs").set_cwd() -require("funcs").set_maps(require("config.keymaps").standard_maps()) -require("funcs").diagnostic_setup(require("config.diagnostic")) +require("custom") +require("config.lazy") diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json new file mode 100644 index 000000000..f03853fb9 --- /dev/null +++ b/.config/nvim/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "3314" + }, + "version": 3 +} \ No newline at end of file diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index f851d7c73..3b3089a0f 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -1,3 +1,7 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here + local autocmds = { { -- Automatically change line numeration { "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, @@ -23,82 +27,25 @@ local autocmds = { -- end, }, }, - { -- Use 'q' to quit from common plugins - "FileType", - { - pattern = { - "PlenaryTestPopup", - "help", - "lspinfo", - "notify", - "qf", - "query", - "spectre_panel", - "startuptime", - "tsplayground", - "neotest-output", - "checkhealth", - "neotest-summary", - "neotest-output-panel", - }, - callback = function(event) - vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) - end, - }, - }, - { -- make it easier to close man-files when opened inline - "FileType", - { - group = "man_unlisted", - pattern = { "man" }, - callback = function(event) - vim.bo[event.buf].buflisted = false - end, - }, - }, - { - "Filetype", - { - pattern = { "gitcommit", "markdown" }, - callback = function() - vim.opt_local.spell = true - end, - }, - }, - { -- Fix auto comment - "BufWinEnter", - { - command = "set formatoptions-=cro", - }, - }, - { -- Highlight yanked text - "TextYankPost", - { - callback = function() - vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) - end, - }, - }, { -- Trigger shortcuts script "BufWritePost", { pattern = { "directories", "files" }, - command = "silent!!shortcuts" + command = "silent!!shortcuts", }, }, { -- Trigger xrdb "BufWritePost", { pattern = { "xresources" }, - command = "silent!!xrdb %" + command = "silent!!xrdb %", }, }, - { -- Trigger xrdb + { -- Trigger asciidoctor-pdf "BufWritePost", { pattern = { "*.adoc" }, - command = "silent!!asciidoctor-pdf % &" + command = "silent!!asciidoctor-pdf % &", }, }, } diff --git a/.config/nvim/lua/config/diagnostic.lua b/.config/nvim/lua/config/diagnostic.lua deleted file mode 100644 index ad3f71636..000000000 --- a/.config/nvim/lua/config/diagnostic.lua +++ /dev/null @@ -1,40 +0,0 @@ -local M = {} -local icons = require("config.icons") - -M.signs = { - { name = "DapStopped", text = icons.DapStopped, texthl = "DiagnosticWarn" }, - { name = "DapBreakpoint", text = icons.DapBreakpoint, texthl = "DiagnosticInfo" }, - { name = "DapBreakpointRejected", text = icons.DapBreakpointRejected, texthl = "DiagnosticError" }, - { name = "DapBreakpointCondition", text = icons.DapBreakpointCondition, texthl = "DiagnosticInfo" }, - { name = "DapLogPoint", text = icons.DapLogPoint, texthl = "DiagnosticInfo" }, - { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticSignError" }, - { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticSignWarn" }, - { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticSignHint" }, - { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticSignInfo" }, -} - -M.diagnostic = { - virtual_text = true, - signs = { - text = { - [vim.diagnostic.severity.ERROR] = icons.Error, - [vim.diagnostic.severity.HINT] = icons.Hint, - [vim.diagnostic.severity.WARN] = icons.Warn, - [vim.diagnostic.severity.INFO] = icons.Info, - }, - active = M.signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focused = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, -} - -return M diff --git a/.config/nvim/lua/config/filetypes.lua b/.config/nvim/lua/config/filetypes.lua deleted file mode 100644 index 4a9b4007b..000000000 --- a/.config/nvim/lua/config/filetypes.lua +++ /dev/null @@ -1,27 +0,0 @@ -local ansible_test = function(path, bufnr) - if string.find(path, "templates") or string.find(path, "files") then - return "yaml" - end - local find = { "tasks", "roles", "handlers", "group_vars", "host_vars", "ansible.cfg", ".ansible-lint" } - local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path } - if next(vim.fs.find(find, opts)) ~= nil then - return "yaml.ansible" - else - return "yaml" - end -end - -local filetypes = { - extension = { - yml = ansible_test, - yaml = ansible_test, - }, - filename = { - ["Xresources"] = "xdefaults", - ["Xdefaults"] = "xdefaults", - ["xresources"] = "xdefaults", - ["xdefaults"] = "xdefaults", - }, -} - -vim.filetype.add(filetypes) diff --git a/.config/nvim/lua/config/icons.lua b/.config/nvim/lua/config/icons.lua deleted file mode 100644 index ba6cd1983..000000000 --- a/.config/nvim/lua/config/icons.lua +++ /dev/null @@ -1,88 +0,0 @@ -return { - Diagnostic = "󰭷", - Error = "󰅗", - Hint = "󰌵", - Info = "󰋼", - Warn = "󰀦", - Bug = "󰠭", - True = "󰸞", - Pending = "󰁪", - False = "󱎘", - Close = "󱎘", - Selected = "󰅂", - Console = "󰆍", - Gear = "󰒓", - Event = "󱐋", - File = "󰈔", - NewFile = "󰝒", - FileTree = "󰙅", - Import = "󰈠", - Keyboard = "󰌌", - Sleep = "󰒲", - Package = "󰏗", - Runtime = "", - Source = "󰈮", - Code = "", - Start = "", - Task = "󰱒", - Buffer = "󰧭", - Search = "", - Speed = "󰾆", - Test = "", - Flame = "", - Leave = "", - Git = "󰊢", - Loaded = "󰜄", - Unloaded = "󰛲", - Added = "󰜄", - Modified = "󱗝", - Removed = "󰛲", - Untracked = "", - ChangeDelete = "󰅘", - Truncate = "", - Note = "", - Dap = { - Breakpoint = "", - BreakpointCondition = "", - BreakpointRejected = "", - LogPoint = ".>", - Stopped = "󰁕", - }, - lspkind = { - Array = "󰅪", - Boolean = "⊨", - Class = "󰌗", - Color = "", - Constant = "", - Constructor = "", - Enum = "", - EnumMember = "", - Event = "", - Field = "", - File = "󰈔", - Folder = "󰉋", - Function = "", - Interface = "", - Key = "󰌆", - Keyword = "", - Method = "", - Module = "", - Namespace = "󰅪", - Null = "󰟢", - Number = "", - Object = "󰀚", - Operator = "", - Package = "󰏗", - Property = "", - Reference = "", - Snippet = "󰆐", - String = "󰀬", - Struct = "", - Text = "", - TypeParameter = "󰊄", - Unit = "", - Value = "", - Variable = "", - }, - progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" }, -} diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 29cdb5a80..3fe8206fa 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -1,1219 +1,8 @@ -local M = {} -local f = require("funcs") -local icons = require("config.icons") +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here -M.sections = { - p = { desc = icons.Package .. " Packages" }, - b = { desc = icons.Buffer .. " Buffers" }, - bs = { desc = "Sort Buffers" }, - d = { desc = icons.Bug .. " Debugger" }, - g = { desc = icons.Git .. " Git" }, - f = { desc = icons.Search .. " Find" }, - l = { desc = icons.Code .. " LSP" }, - t = { desc = icons.Console .. " Terminal" }, - u = { desc = icons.Gear .. " Utility" }, - n = { desc = icons.Note .. " Notes" }, - e = { desc = icons.FileTree .. " File Manager" }, -} +local unmap = vim.api.nvim_del_keymap --- TODO: Move these to LazyKeysSpec tables -M.standard_maps = function() - local maps = f.empty_map_table() - -- Standard -- - maps.n["j"] = { "v:count == 0 ? 'gj' : 'j'", expr = true, desc = "Move cursor down" } - maps.n["k"] = { "v:count == 0 ? 'gk' : 'k'", expr = true, desc = "Move cursor up" } - maps.n["w"] = { "w", desc = "Write buffer" } - maps.n["c"] = { "conf q", desc = "Quit" } - maps.n["C"] = { "conf qa", desc = "Quit all" } - maps.n["h"] = { "noh", desc = "Clear highlight" } - maps.n[""] = { "w!", desc = "Force write buffer" } - maps.n[""] = { "qa!", desc = "Force quit all" } - maps.n["|"] = { "vsplit", desc = "Vertical split" } - maps.n["\\"] = { "split", desc = "Horizontal split" } - maps.v["<"] = { ""] = { ">gv", desc = "Indent line" } - maps.n["q"] = { f.buf_close, desc = "Close buffer" } - maps.n[""] = { "" } - maps.n[""] = { "" } - maps.i[""] = { "" } - maps.v["p"] = { "pgvy" } - maps.n["bn"] = { "ene", desc = "New buffer" } - - -- Utility -- - if f.is_available("nvim-colorizer.lua") then - maps.n["u"] = M.sections.u - maps.n["uc"] = { "ColorizerToggle", desc = "Toggle colorizer" } - end - - -- Notes -- - if f.is_available("zk-nvim") then - maps.n["n"] = M.sections.n - maps.v["n"] = maps.n["n"] - maps.n["nn"] = { - function() - require("zk").new({ notebook_path = vim.g.wikidir, title = vim.fn.input("Title: ") }) - end, - desc = "New Note", - } - maps.v["nnt"] = { - ":ZkNewFromTitleSelection { notebook_path = vim.g.wikidir }", - desc = "New Note (Selection as title)", - } - maps.v["nnc"] = { - ":ZkNewFromContentSelection { notebook_path = vim.g.wikidir, title = vim.fn.input('Title: ') }", - desc = "New Note (Selection as content)", - } - maps.n["no"] = { - function() - require("zk").edit({ notebook_path = vim.g.wikidir }) - end, - desc = "Open Note", - } - maps.n["ni"] = { - function() - require("zk").index({ notebook_path = vim.g.wikidir }) - end, - desc = "Index Notes", - } - end - - -- Window Navigation -- - maps.n[""] = { "h", desc = "Move to left split" } - maps.n[""] = { "j", desc = "Move to below split" } - maps.n[""] = { "k", desc = "Move to above split" } - maps.n[""] = { "l", desc = "Move to right split" } - maps.n[""] = { "resize -2", desc = "Resize split up" } - maps.n[""] = { "resize +2", desc = "Resize split down" } - maps.n[""] = { "vertical resize +2", desc = "Resize split left" } - maps.n[""] = { "vertical resize -2", desc = "Resize split right" } - -- NOTE: These don't make sense when predominantly using floating terminals - -- maps.t[""] = { "wincmd h", desc = "Terminal left window navigation" } - -- maps.t[""] = { "wincmd j", desc = "Terminal down window navigation" } - -- maps.t[""] = { "wincmd k", desc = "Terminal up window navigation" } - -- maps.t[""] = { "wincmd l", desc = "Terminal right window navigation" } - - -- Plugin Manager -- - maps.n["p"] = M.sections.p - maps.n["ph"] = { - function() - require("lazy").home() - end, - desc = "Home", - } - maps.n["pi"] = { - function() - require("lazy").install() - end, - desc = "Install", - } - maps.n["pu"] = { - function() - require("lazy").update() - end, - desc = "Update", - } - maps.n["ps"] = { - function() - require("lazy").sync() - end, - desc = "Sync", - } - maps.n["px"] = { - function() - require("lazy").clean() - end, - desc = "Clean", - } - maps.n["pc"] = { - function() - require("lazy").check() - end, - desc = "Check", - } - maps.n["pl"] = { - function() - require("lazy").log() - end, - desc = "Log", - } - maps.n["pr"] = { - function() - require("lazy").restore() - end, - desc = "Restore", - } - maps.n["pp"] = { - function() - require("lazy").profile() - end, - desc = "Profile", - } - maps.n["pd"] = { - function() - require("lazy").debug() - end, - desc = "Debug", - } - maps.n["p?"] = { - function() - require("lazy").help() - end, - desc = "Help", - } - - if f.is_available("bufferline.nvim") then - maps.n[""] = { - function() - require("bufferline").cycle(1) - end, - desc = "Switch to next buffer", - } - maps.n[""] = { - function() - require("bufferline").cycle(-1) - end, - desc = "Switch to previous buffer", - } - maps.n[""] = { - function() - require("bufferline").move(1) - end, - desc = "Move buffer to next", - } - maps.n[""] = { - function() - require("bufferline").move(-1) - end, - desc = "Move buffer to previous", - } - maps.n["b"] = M.sections.b - maps.n["bc"] = { - function() - require("bufferline").close_others() - end, - desc = "Close other buffers", - } - maps.n["bl"] = { - function() - require("bufferline").close_in_direction("left") - end, - desc = "Close lefthand buffers", - } - maps.n["br"] = { - function() - require("bufferline").close_in_direction("right") - end, - desc = "Close righthand buffers", - } - maps.n["bs"] = M.sections.bs - maps.n["bse"] = { - function() - require("bufferline").sort_by("extension") - end, - desc = "By extension", - } - maps.n["bsd"] = { - function() - require("bufferline").sort_by("directory") - end, - desc = "By directory", - } - maps.n["bsr"] = { - function() - require("bufferline").sort_by("relative_directory") - end, - desc = "By relative directory", - } - maps.n["bst"] = { - function() - require("bufferline").sort_by("tabs") - end, - desc = "By tabs", - } - end - - if f.is_available("Comment.nvim") then - maps.n["/"] = { - function() - require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) - end, - desc = "Toggle comment line", - } - maps.v["/"] = { - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - desc = "Toggle comment for selection", - } - end - - if f.is_available("gitsigns.nvim") then - maps.n["g"] = M.sections.g - maps.n["]g"] = { - function() - require("gitsigns").next_hunk() - end, - desc = "Next Git hunk", - } - maps.n["[g"] = { - function() - require("gitsigns").prev_hunk() - end, - desc = "Previous Git hunk", - } - maps.n["gl"] = { - function() - require("gitsigns").blame_line() - end, - desc = "View Git blame", - } - maps.n["gL"] = { - function() - require("gitsigns").blame_line({ full = true }) - end, - desc = "View full Git blame", - } - maps.n["gp"] = { - function() - require("gitsigns").preview_hunk() - end, - desc = "Preview Git hunk", - } - maps.n["gh"] = { - function() - require("gitsigns").reset_hunk() - end, - desc = "Reset Git hunk", - } - maps.n["gr"] = { - function() - require("gitsigns").reset_buffer() - end, - desc = "Reset Git buffer", - } - maps.n["gs"] = { - function() - require("gitsigns").stage_hunk() - end, - desc = "Stage Git hunk", - } - maps.n["gS"] = { - function() - require("gitsigns").stage_buffer() - end, - desc = "Stage Git buffer", - } - maps.n["gu"] = { - function() - require("gitsigns").undo_stage_hunk() - end, - desc = "Unstage Git hunk", - } - maps.n["gd"] = { - function() - require("gitsigns").diffthis() - end, - desc = "View Git diff", - } - end - - if f.is_available("taolf") then - maps.n["e"] = M.sections.e - maps.n["E"] = { - function() - require("taolf").start({ dir = "fd" }) - end, - desc = "File manager", - } - -- maps.n["gE"] = { "" } - maps.n["ec"] = { - function() - require("taolf").start() - end, - desc = "File manager in vim's working directory", - } - maps.n["eg"] = { - function() - require("taolf").start({ dir = "gwd" }) - end, - desc = "File manager in git root", - } - maps.n["ef"] = { - function() - require("taolf").start({ dir = "fd" }) - end, - desc = "File manager in open file's directory", - } - end - - if f.is_available("mason.nvim") then - maps.n["pm"] = { "Mason", desc = "Mason" } - end - - if f.is_available("aerial.nvim") then - maps.n["l"] = M.sections.l - maps.n["lS"] = { - function() - require("aerial").toggle() - end, - desc = "Symbols outline", - } - end - - if f.is_available("telescope.nvim") then - maps.n["f"] = M.sections.f - maps.n["g"] = M.sections.g - maps.n["gb"] = { - function() - require("telescope.builtin").git_branches({ use_file_path = true }) - end, - desc = "Git branches", - } - maps.n["gc"] = { - function() - require("telescope.builtin").git_commits({ use_file_path = true }) - end, - desc = "Git commits (repository)", - } - maps.n["gC"] = { - function() - require("telescope.builtin").git_bcommits({ use_file_path = true }) - end, - desc = "Git commits (current file)", - } - maps.n["gt"] = { - function() - require("telescope.builtin").git_status({ use_file_path = true }) - end, - desc = "Git status", - } - maps.n["f"] = { - function() - require("telescope.builtin").resume() - end, - desc = "Resume previous search", - } - maps.n["f'"] = { - function() - require("telescope.builtin").marks() - end, - desc = "Find marks", - } - maps.n["f/"] = { - function() - require("telescope.builtin").current_buffer_fuzzy_find() - end, - desc = "Find words in current buffer", - } - maps.n["fc"] = { - function() - require("telescope.builtin").grep_string({ cwd = f.get_gwd() }) - end, - desc = "Find word under cursor", - } - maps.n["fC"] = { - function() - require("telescope.builtin").commands() - end, - desc = "Find commands", - } - maps.n["ff"] = { - function() - require("telescope.builtin").find_files({ hidden = true, no_ignore = true, cwd = f.get_gwd() }) - end, - desc = "Find files", - } - maps.n["fg"] = { - function() - require("telescope.builtin").git_files({ hidden = true, no_ignore = true, cwd = f.get_gwd() }) - end, - desc = "Find git files", - } - maps.n["fh"] = { - function() - require("telescope.builtin").help_tags() - end, - desc = "Find help", - } - maps.n["fk"] = { - function() - require("telescope.builtin").keymaps() - end, - desc = "Find keymaps", - } - maps.n["fo"] = { - function() - require("telescope.builtin").oldfiles() - end, - desc = "Find history", - } - maps.n["fr"] = { - function() - require("telescope.builtin").registers() - end, - desc = "Find registers", - } - maps.n["fw"] = { - function() - require("telescope.builtin").live_grep({ - cwd = f.get_gwd(), - additional_args = function(args) - return vim.list_extend(args, { "--hidden", "--no-ignore" }) - end, - }) - end, - desc = "Find words", - } - maps.n["fb"] = { - function() - require("telescope.builtin").buffers() - end, - desc = "Find buffers", - } - maps.n["ft"] = { - function() - require("telescope").extensions["todo-comments"].todo() - end, - desc = "Find buffers", - } - maps.n["l"] = M.sections.l - maps.n["ls"] = { - function() - local aerial_avail, _ = pcall(require, "aerial") - if aerial_avail then - require("telescope").extensions.aerial.aerial() - else - require("telescope.builtin").lsp_document_symbols() - end - end, - desc = "Search symbols", - } - end - - if f.is_available("toggleterm.nvim") then - maps.n["t"] = M.sections.t - if vim.fn.executable("lazygit") == 1 then - maps.n["g"] = M.sections.g - maps.n["gg"] = { - function() - local worktree = f.file_worktree() - local flags = worktree - and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir) - or "" - f.toggle_term_cmd("lazygit " .. flags) - end, - desc = "ToggleTerm lazygit", - } - maps.n["tl"] = maps.n["gg"] - end - if vim.fn.executable("node") == 1 then - maps.n["tn"] = { - function() - f.toggle_term_cmd("node") - end, - desc = "ToggleTerm node", - } - end - if vim.fn.executable("gdu") == 1 then - maps.n["tu"] = { - function() - f.toggle_term_cmd("gdu") - end, - desc = "ToggleTerm gdu", - } - end - if vim.fn.executable("btm") == 1 then - maps.n["tt"] = { - function() - f.toggle_term_cmd("btm") - end, - desc = "ToggleTerm btm", - } - end - local python = vim.fn.executable("python") == 1 and "python" or vim.fn.executable("python3") == 1 and "python3" - if python then - maps.n["tp"] = { - function() - f.toggle_term_cmd(python) - end, - desc = "ToggleTerm python", - } - end - maps.n["tf"] = { "ToggleTerm direction=float", desc = "ToggleTerm float" } - maps.n["th"] = { "ToggleTerm direction=horizontal", desc = "ToggleTerm horizontal split" } - maps.n[""] = { "ToggleTerm", desc = "Toggle terminal" } - maps.t[""] = maps.n[""] - end - - if f.is_available("nvim-dap") then - local conditional_breakpoint = function() - vim.ui.input({ prompt = "Condition: " }, function(condition) - if condition then - require("dap").set_breakpoint(condition) - end - end) - end - maps.n["d"] = M.sections.d - maps.v["d"] = M.sections.d - maps.n[""] = { - function() - require("dap").continue() - end, - desc = "Debugger: Start", - } - maps.n[""] = { - function() - require("dap").terminate() - end, - desc = "Debugger: Stop", - } - - -- S-F9 - maps.n[""] = { conditional_breakpoint, desc = "Debugger: Conditional Breakpoint" } - -- C-F5 - maps.n[""] = { - function() - require("dap").restart_frame() - end, - desc = "Debugger: Restart", - } - maps.n[""] = { - function() - require("dap").pause() - end, - desc = "Debugger: Pause", - } - maps.n[""] = { - function() - require("dap").toggle_breakpoint() - end, - desc = "Debugger: Toggle Breakpoint", - } - maps.n[""] = { - function() - require("dap").step_over() - end, - desc = "Debugger: Step Over", - } - maps.n[""] = { - function() - require("dap").step_into() - end, - desc = "Debugger: Step Into", - } - -- S-F11 - maps.n[""] = { - function() - require("dap").step_out() - end, - desc = "Debugger: Step Out", - } - maps.n["db"] = { - function() - require("dap").toggle_breakpoint() - end, - desc = "Toggle Breakpoint (F9)", - } - maps.n["dB"] = { - function() - require("dap").clear_breakpoints() - end, - desc = "Clear Breakpoints", - } - maps.n["dc"] = { - function() - require("dap").continue() - end, - desc = "Start/Continue (F5)", - } - maps.n["dC"] = { conditional_breakpoint, desc = "Conditional Breakpoint (S-F9)" } - maps.n["di"] = { - function() - require("dap").step_into() - end, - desc = "Step Into (F11)", - } - maps.n["do"] = { - function() - require("dap").step_over() - end, - desc = "Step Over (F10)", - } - maps.n["dO"] = { - function() - require("dap").step_out() - end, - desc = "Step Out (S-F11)", - } - maps.n["dq"] = { - function() - require("dap").close() - end, - desc = "Close Session", - } - maps.n["dQ"] = { - function() - require("dap").terminate() - end, - desc = "Terminate Session (S-F5)", - } - maps.n["dp"] = { - function() - require("dap").pause() - end, - desc = "Pause (F6)", - } - maps.n["dr"] = { - function() - require("dap").restart_frame() - end, - desc = "Restart (C-F5)", - } - maps.n["dR"] = { - function() - require("dap").repl.toggle() - end, - desc = "Toggle REPL", - } - maps.n["ds"] = { - function() - require("dap").run_to_cursor() - end, - desc = "Run To Cursor", - } - - if f.is_available("nvim-dap-ui") then - maps.n["dE"] = { - function() - vim.ui.input({ prompt = "Expression: " }, function(expr) - if expr then - ---@diagnostic disable-next-line: missing-fields - require("dapui").eval(expr, { enter = true }) - end - end) - end, - desc = "Evaluate Input", - } - maps.v["dE"] = { - function() - require("dapui").eval() - end, - desc = "Evaluate Input", - } - maps.n["du"] = { - function() - require("dapui").toggle() - end, - desc = "Toggle Debugger UI", - } - maps.n["dh"] = { - function() - require("dap.ui.widgets").hover() - end, - desc = "Debugger Hover", - } - end - end - - if f.is_available("nvim-ufo") then - maps.n["zR"] = { - function() - require("ufo").openAllFolds() - end, - desc = "Open all folds", - } - maps.n["zM"] = { - function() - require("ufo").closeAllFolds() - end, - desc = "Close all folds", - } - maps.n["zr"] = { - function() - require("ufo").openFoldsExceptKinds() - end, - desc = "Fold less", - } - maps.n["zm"] = { - function() - require("ufo").closeFoldsWith() - end, - desc = "Fold more", - } - maps.n["zp"] = { - function() - require("ufo").peekFoldedLinesUnderCursor() - end, - desc = "Peek fold", - } - end - - return maps -end - -M.lsp_maps = function(client, bufnr) - local maps = f.empty_map_table() - - maps.n["ld"] = { - function() - vim.diagnostic.open_float() - end, - desc = "Hover diagnostics", - } - maps.n["[d"] = { - function() - vim.diagnostic.goto_prev() - end, - desc = "Previous diagnostic", - } - maps.n["]d"] = { - function() - vim.diagnostic.goto_next() - end, - desc = "Next diagnostic", - } - maps.n["gl"] = { - function() - vim.diagnostic.open_float() - end, - desc = "Hover diagnostics", - } - - if f.is_available("telescope.nvim") then - maps.n["lD"] = { - function() - require("telescope.builtin").diagnostics() - end, - desc = "Search diagnostics", - } - end - - if f.is_available("mason-lspconfig.nvim") then - maps.n["li"] = { "LspInfo", desc = "LSP information" } - end - - if f.is_available("none-ls.nvim") then - maps.n["lI"] = { "NullLsInfo", desc = "Null-ls information" } - end - - if client.supports_method("textDocument/codeAction") then - maps.n["la"] = { - function() - vim.lsp.buf.code_action() - end, - desc = "Code action", - } - maps.v["la"] = maps.n["la"] - end - - if client.supports_method("textDocument/codeLens") then - vim.lsp.codelens.refresh() - maps.n["ll"] = { - function() - vim.lsp.codelens.refresh() - end, - desc = "Refresh CodeLens", - } - maps.n["lL"] = { - function() - vim.lsp.codelens.run() - end, - desc = "Run CodeLens", - } - maps.n["u"] = { desc = icons.Gear .. " Utility" } - maps.n["uL"] = { - function() - vim.lsp.codelens.clear() - end, - desc = "Toggle CodeLens", - } - end - - if client.supports_method("textDocument/definition") then - maps.n["gd"] = { - function() - vim.lsp.buf.definition() - end, - desc = "Go to definition", - } - end - - if client.supports_method("textDocument/typeDefinition") then - maps.n["gy"] = { - function() - vim.lsp.buf.type_definition() - end, - desc = "Go to type definition", - } - end - - if client.supports_method("textDocument/declaration") then - maps.n["gD"] = { - function() - vim.lsp.buf.declaration() - end, - desc = "Go to declaration", - } - end - - if client.supports_method("textDocument/implementation") then - maps.n["gI"] = { - function() - vim.lsp.buf.implementation() - end, - desc = "List implementations", - } - end - - if client.supports_method("textDocument/references") then - maps.n["gr"] = { - function() - vim.lsp.buf.references() - end, - desc = "List references", - } - end - - if client.supports_method("workspace/symbol") then - maps.n["lG"] = { - function() - vim.lsp.buf.workspace_symbol("") - end, - desc = "List symbols", - } - end - - if client.supports_method("textDocument/rename") then - maps.n["lr"] = { - function() - vim.lsp.buf.rename() - end, - desc = "Rename symbol", - } - end - - -- TODO: Check this on 0.10.0 release - if client.supports_method("textDocument/semanticTokens/full") and vim.lsp.semantic_tokens then - maps.n["u"] = { desc = icons.Gear .. " Utility" } - maps.n["uY"] = { - function() - vim.b[bufnr].semantic_tokens_enabled = not vim.b[bufnr].semantic_tokens_enabled - for _, active_client in ipairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do - if active_client.server_capabilities.semanticTokensProvider then - vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens_enabled and "start" or "stop"]( - bufnr, - active_client.id - ) - end - end - end, - desc = "Toggle LSP semantic highlight (buffer)", - } - end - - if client.supports_method("textDocument/formatting") then - maps.n["lf"] = { - function() - vim.lsp.buf.format({ - filter = function(c) - local filetype = vim.bo.filetype - local n = require("null-ls") - local s = require("null-ls.sources") - local method = n.methods.FORMATTING - local available_formatters = s.get_available(filetype, method) - if #available_formatters > 0 then - return c.name == "null-ls" - end - return true - end, - }) - end, - desc = "Format buffer", - } - maps.v["lf"] = maps.n["lf"] - end - - if client.supports_method("textDocument/hover") then - -- TODO: Check this on 0.10.0 release - if vim.fn.has("nvim-0.10") == 0 then - maps.n["K"] = { - function() - vim.lsp.buf.hover() - end, - desc = "Hover symbol", - } - end - end - - if client.supports_method("textDocument/inlayHint") then - if vim.lsp.inlay_hint then - maps.n["u"] = { desc = icons.Gear .. " Utility" } - -- TODO: Check this on 0.10.0 release - maps.n["uH"] = { - function() - vim.b[bufnr].inlay_hints_enabled = not vim.b[bufnr].inlay_hints_enabled - if vim.lsp.inlay_hint then - vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints_enabled) - end - end, - desc = "Toggle inlay hints", - } - end - end - - if client.supports_method("textDocument/signatureHelp") then - maps.n["lh"] = { - function() - vim.lsp.buf.signature_help() - end, - desc = "Signature help", - } - end - - if f.is_available("telescope.nvim") then - if maps.n.gd then - maps.n.gd[1] = function() - require("telescope.builtin").lsp_definitions() - end - end - if maps.n.gI then - maps.n.gI[1] = function() - require("telescope.builtin").lsp_implementations() - end - end - if maps.n.gr then - maps.n.gr[1] = function() - require("telescope.builtin").lsp_references() - end - end - if maps.n["lR"] then - maps.n["lR"][1] = function() - require("telescope.builtin").lsp_references() - end - end - if maps.n.gy then - maps.n.gy[1] = function() - require("telescope.builtin").lsp_type_definitions() - end - end - if maps.n["lG"] then - maps.n["lG"][1] = function() - vim.ui.input({ prompt = "Symbol Query: (leave empty for word under cursor)" }, function(query) - if query then - -- word under cursor if given query is empty - if query == "" then - query = vim.fn.expand("") - end - require("telescope.builtin").lsp_workspace_symbols({ - query = query, - prompt_title = ("Find word (%s)"):format(query), - }) - end - end) - end - end - end - - if not vim.tbl_isempty(maps.v) then - if maps.v["la"] or maps.v["lf"] then - maps.v["l"] = { desc = icons.Code .. " LSP" } - end - end - - return maps -end - -M.surround = { - insert = false, - insert_line = false, - normal = "ys", - normal_cur = "yss", - normal_line = "yS", - normal_cur_line = "ySS", - visual = "S", - visual_line = "gS", - delete = "ds", - change = "cs", - change_line = "cS", -} - -M.aerial = { - ["[y"] = "actions.prev", - ["]y"] = "actions.next", - ["[Y"] = "actions.prev_up", - ["]Y"] = "actions.next_up", - ["{"] = false, - ["}"] = false, - ["[["] = false, - ["]]"] = false, -} - -M.treesitter = { - select = { - ["ak"] = { query = "@block.outer", desc = "around block" }, - ["ik"] = { query = "@block.inner", desc = "inside block" }, - ["ac"] = { query = "@class.outer", desc = "around class" }, - ["ic"] = { query = "@class.inner", desc = "inside class" }, - ["a?"] = { query = "@conditional.outer", desc = "around conditional" }, - ["i?"] = { query = "@conditional.inner", desc = "inside conditional" }, - ["af"] = { query = "@function.outer", desc = "around function " }, - ["if"] = { query = "@function.inner", desc = "inside function " }, - ["al"] = { query = "@loop.outer", desc = "around loop" }, - ["il"] = { query = "@loop.inner", desc = "inside loop" }, - ["aa"] = { query = "@parameter.outer", desc = "around argument" }, - ["ia"] = { query = "@parameter.inner", desc = "inside argument" }, - }, - move = { - goto_next_start = { - ["]k"] = { query = "@block.outer", desc = "Next block start" }, - ["]f"] = { query = "@function.outer", desc = "Next function start" }, - ["]a"] = { query = "@parameter.inner", desc = "Next argument start" }, - }, - goto_next_end = { - ["]K"] = { query = "@block.outer", desc = "Next block end" }, - ["]F"] = { query = "@function.outer", desc = "Next function end" }, - ["]A"] = { query = "@parameter.inner", desc = "Next argument end" }, - }, - goto_previous_start = { - ["[k"] = { query = "@block.outer", desc = "Previous block start" }, - ["[f"] = { query = "@function.outer", desc = "Previous function start" }, - ["[a"] = { query = "@parameter.inner", desc = "Previous argument start" }, - }, - goto_previous_end = { - ["[K"] = { query = "@block.outer", desc = "Previous block end" }, - ["[F"] = { query = "@function.outer", desc = "Previous function end" }, - ["[A"] = { query = "@parameter.inner", desc = "Previous argument end" }, - }, - }, - swap = { - -- TODO: Move to config.keymaps - swap_next = { - [">K"] = { query = "@block.outer", desc = "Swap next block" }, - [">F"] = { query = "@function.outer", desc = "Swap next function" }, - [">A"] = { query = "@parameter.inner", desc = "Swap next argument" }, - }, - -- TODO: Move to config.keymaps - swap_previous = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.close, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_left, - [""] = actions.preview_scrolling_right, - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - [""] = actions.results_scrolling_left, - [""] = actions.results_scrolling_right, - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - [""] = actions.which_key, - [""] = actions.which_key, -- keys from pressing - [""] = { "", type = "command" }, - [""] = actions.insert_original_cword, - [""] = actions.nop, - }, - n = { - [""] = actions.close, - ["q"] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - ["H"] = actions.move_to_top, - ["M"] = actions.move_to_middle, - ["L"] = actions.move_to_bottom, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_left, - [""] = actions.preview_scrolling_right, - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - [""] = actions.results_scrolling_left, - [""] = actions.results_scrolling_right, - ["?"] = actions.which_key, - }, - } -end - -M.cmp = { - [""] = require("cmp").mapping.select_prev_item({ behavior = require("cmp").SelectBehavior.Select }), - [""] = require("cmp").mapping.select_next_item({ behavior = require("cmp").SelectBehavior.Select }), - [""] = require("cmp").mapping.select_prev_item({ behavior = require("cmp").SelectBehavior.Insert }), - [""] = require("cmp").mapping.select_next_item({ behavior = require("cmp").SelectBehavior.Insert }), - [""] = require("cmp").mapping.select_prev_item({ behavior = require("cmp").SelectBehavior.Insert }), - [""] = require("cmp").mapping.select_next_item({ behavior = require("cmp").SelectBehavior.Insert }), - [""] = require("cmp").mapping(require("cmp").mapping.scroll_docs(-4), { "i", "c" }), - [""] = require("cmp").mapping(require("cmp").mapping.scroll_docs(4), { "i", "c" }), - [""] = require("cmp").mapping(require("cmp").mapping.complete(), { "i", "c" }), - [""] = require("cmp").config.disable, - [""] = require("cmp").mapping({ i = require("cmp").mapping.abort(), c = require("cmp").mapping.close() }), - [""] = require("cmp").mapping.confirm({ select = false }), - [""] = require("cmp").mapping(function(fallback) - local function has_words_before() - local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - if require("cmp").visible() then - require("cmp").select_next_item() - elseif require("luasnip").expand_or_locally_jumpable() then - require("luasnip").expand_or_jump() - elseif has_words_before() then - require("cmp").complete() - else - fallback() - end - end, { "i", "s" }), - [""] = require("cmp").mapping( - function(fallback) - if require("cmp").visible() then - require("cmp").select_prev_item() - elseif require("luasnip").jumpable(-1) then - require("luasnip").jump(-1) - else - fallback() - end - end, - { "i", "s" } - ), -} - -M.ufo = { - scrollB = "", - scrollF = "", - scrollU = "", - scrollD = "", -} - -M.tabnine = { - accept_keymap = "", - dismiss_keymap = "", -} - -return M +unmap("n", "uL") +unmap("n", "ul") diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 000000000..e09f3eb8f --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,47 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { import = "lazyvim.plugins.extras.coding.yanky" }, + { import = "lazyvim.plugins.extras.coding.copilot" }, + { import = "lazyvim.plugins.extras.dap.core" }, + { import = "lazyvim.plugins.extras.ui.edgy" }, + { import = "lazyvim.plugins.extras.editor.aerial" }, + { import = "lazyvim.plugins.extras.editor.leap" }, + { import = "lazyvim.plugins.extras.test.core" }, + { import = "plugins" }, + }, + defaults = { + lazy = false, + version = false, + }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + -- "matchit", + "matchparen", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/.config/nvim/lua/config/lsp.lua b/.config/nvim/lua/config/lsp.lua deleted file mode 100644 index 404c9924f..000000000 --- a/.config/nvim/lua/config/lsp.lua +++ /dev/null @@ -1,37 +0,0 @@ -local conf = { handlers = {} } -local f = require("funcs") - -conf.handlers.intelephense = { - init_options = { - storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense", - globalStoragePath = os.getenv("XDG_CONFIG_HOME") .. "/intelephense", - licenceKey = f.get_lsp_key("intelephense") - }, -} - -conf.handlers.sourcery = { - on_attach = function(client, _) - client.server_capabilities.hoverProvider = false - end, - init_options = { - token = f.get_lsp_key("sourcery") - } -} - -conf.handlers.bashls = { - settings = { - bashIde = { - shellcheckPath = vim.fn.stdpath("data") .. "/mason/bin/shellcheck", - }, - }, -} - -conf.handlers.yamlls = { - filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.ansible' }, -} - -conf.required = { "lua_ls", "zk", "bashls" } - -conf.ignore = { "rust_analyzer" } -- This will be set up by rustacean.nvim - -return conf diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 97b66e145..8eea91fe1 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -1,56 +1,9 @@ -local g = vim.g +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here + local o = vim.opt -local d = vim.diagnostic.config -g.mapleader = " " -g.maplocalleader = " " -g.vim_json_conceal = 0 -g.git_worktrees = { - { toplevel = vim.env.HOME, gitdir = vim.env.XDG_DATA_HOME .. "/dots" }, -} -g.max_lines = 1000 -g.max_size = 1024 * 100 - -o.undodir = { vim.fn.stdpath("cache") .. "/undo" } -o.clipboard = "unnamedplus" -o.conceallevel = 0 -o.numberwidth = 3 -o.hlsearch = true -o.ignorecase = true -o.showmode = false -o.smartindent = true -o.splitbelow = true -o.splitbelow = true -o.splitbelow = true -o.updatetime = 250 -o.writebackup = false -o.expandtab = true o.shiftwidth = 4 o.tabstop = 4 -o.cursorline = true -o.signcolumn = "yes" -o.wrap = false o.scrolloff = 8 -o.sidescrolloff = 8 -o.undofile = true -o.title = true -o.smartcase = true --- o.mouse = "" -o.backspace = "indent,eol,start" -o.termguicolors = true -o.timeoutlen = 500 -o.number = true -o.relativenumber = true -o.laststatus = 3 -o.modeline = true -o.modelines = 3 -o.listchars = { eol = "¬", tab = "→ ", extends = "❯", precedes = "❮", trail = "·", nbsp = "␣" } - --- ufo needs these settings -o.foldcolumn = "0" -o.foldmethod = "manual" -o.foldenable = true -o.foldlevel = 99 -o.foldlevelstart = 99 - -d({ virtual_text = false }) diff --git a/.config/nvim/lua/custom/init.lua b/.config/nvim/lua/custom/init.lua new file mode 100644 index 000000000..6f86a66db --- /dev/null +++ b/.config/nvim/lua/custom/init.lua @@ -0,0 +1,14 @@ +---@class custom +---@field dashboard custom.dashboard +---@field language custom.language +local M = {} + +_G.Custom = M + +setmetatable(M, { + __index = function(_, k) + return require("custom." .. k) + end, +}) + +return M diff --git a/.config/nvim/lua/custom/language.lua b/.config/nvim/lua/custom/language.lua new file mode 100644 index 000000000..7336a82df --- /dev/null +++ b/.config/nvim/lua/custom/language.lua @@ -0,0 +1,185 @@ +---@diagnostic disable: missing-fields +---@class custom.language +local M = {} + +---@type table +M.formatters_by_ft = { + lua = { "stylua" }, + sh = { "shfmt" }, +} + +---@type table +M.formatters = { + injected = { options = { ignore_errors = true } }, + shfmt = { prepend_args = { "-i", "4", "-ci" } }, +} + +---@type table +M.linters_by_ft = { + dockerfile = { "hadolint" }, + markdown = { "markdownlint" }, +} + +---@type table +M.linters = {} + +---@type Array +M.mason_install = { + "ansible-lint", + "ansible-language-server", + "basedpyright", + "codelldb", + "dockerfile-language-server", + "docker-compose-language-service", + "json-lsp", + "lua-language-server", + "hadolint", + "marksman", + "markdownlint", + "ruff-lsp", +} + +---@type Array +M.treesitter_install = { + "bash", + "c", + "diff", + "dockerfile", + "html", + "json", + "jsonc", + "json5", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "ninja", + "python", + "query", + "regex", + "ron", + "rst", + "rust", + "toml", + "vim", + "vimdoc", + "xml", + "yaml", +} + +---@type lspconfig.options +M.lsp = { + jsonls = { + on_new_config = function(new_config) + new_config.settings.json.schemas = new_config.settings.json.schemas or {} + vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas()) + end, + settings = { + json = { + format = { + enable = true, + }, + validate = { enable = true }, + }, + }, + }, + lua_ls = { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + codeLens = { + enable = true, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }, + ruff_lsp = { + keys = { + { + "co", + function() + vim.lsp.buf.code_action({ + apply = true, + context = { + only = { "source.organizeImports" }, + diagnostics = {}, + }, + }) + end, + desc = "Organize Imports", + }, + }, + }, + yamlls = { + capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, + }, + on_new_config = function(new_config) + new_config.settings.yaml.schemas = vim.tbl_deep_extend( + "force", + new_config.settings.yaml.schemas or {}, + require("schemastore").yaml.schemas() + ) + end, + settings = { + redhat = { telemetry = { enabled = false } }, + yaml = { + keyOrdering = false, + format = { + enable = true, + }, + validate = true, + schemaStore = { + enable = false, + url = "", + }, + }, + }, + }, +} + +---@type table +M.lsp_setup = { + ruff_lsp = function() + LazyVim.lsp.on_attach(function(client, _) + if client.name == "ruff_lsp" then + client.server_capabilities.hoverProvider = false + end + end) + end, + rust_analyzer = function() + return true + end, + ["*"] = function(server, opts) + local base = vim.lsp.protocol.make_client_capabilities() + local cmp = require("cmp_nvim_lsp").default_capabilities() + vim.tbl_deep_extend("force", opts.capabilities, base) + vim.tbl_deep_extend("force", opts.capabilities, cmp) + require("lspconfig")[server].setup(opts) + end, +} + +setmetatable(M, { + __index = function(_, k) + if k == "lsp" then + for l, _ in pairs(M.lsp) do + M.lsp[l].mason = false + return M.lsp + end + end + return require("custom." .. k) + end, +}) + +return M diff --git a/.config/nvim/lua/custom/ui.lua b/.config/nvim/lua/custom/ui.lua new file mode 100644 index 000000000..406402006 --- /dev/null +++ b/.config/nvim/lua/custom/ui.lua @@ -0,0 +1,121 @@ +---@class custom.dashboard +local M = {} + +---@type Array +M.banners = { + [[ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀ +⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀ +⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀ +⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀ +⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀ +⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷ +⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿ +⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁ +⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀ +⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀ +⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +]], + [[ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀ +⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀ +⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀ +⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀ +⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀ +⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀ +⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀ +⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀ +⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀ +⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀ +⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀ +⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀ +]], + [[ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀ +⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀ +⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀ +⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀ +⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀ +⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀ +⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀ +]], +} + +---@type Array +M.buttons = { + { + action = LazyVim.telescope("files"), + desc = " Find File" .. string.rep(" ", 33), + icon = " ", + key = "f", + }, + { + action = "ene | startinsert", + desc = " New File" .. string.rep(" ", 34), + icon = " ", + key = "n", + }, + { + action = "Telescope live_grep", + desc = " Find Text" .. string.rep(" ", 33), + icon = " ", + key = "g", + }, + { + action = "TodoTelescope", + desc = " Find Todo" .. string.rep(" ", 33), + icon = "󰱒 ", + key = "t", + }, + { + action = 'lua require("persistence").load()', + desc = " Restore Session" .. string.rep(" ", 27), + icon = " ", + key = "s", + }, + { + action = "qa", + desc = " Quit" .. string.rep(" ", 38), + icon = " ", + key = "q", + }, +} + +return M diff --git a/.config/nvim/lua/funcs.lua b/.config/nvim/lua/funcs.lua deleted file mode 100644 index b88dddec7..000000000 --- a/.config/nvim/lua/funcs.lua +++ /dev/null @@ -1,335 +0,0 @@ -local M = {} - -function M.lsp_on_attach(client, bufnr) - -- TODO: Check this on 0.10.0 release - if client.supports_method("textDocument/semanticTokens/full") and vim.lsp.semantic_tokens then - vim.b[bufnr].semantic_tokens_enabled = true - end - - if client.supports_method("textDocument/documentHighlight") then - M.add_buffer_autocmd("lsp_document_highlight", bufnr, { - { - events = { "CursorHold", "CursorHoldI" }, - desc = "highlight references when cursor holds", - callback = function() - if not M.has_capability("textDocument/documentHighlight", { bufnr = bufnr }) then - M.del_buffer_autocmd("lsp_document_highlight", bufnr) - return - end - vim.lsp.buf.document_highlight() - end, - }, - { - events = { "CursorMoved", "CursorMovedI", "BufLeave" }, - desc = "clear references when cursor moves", - callback = function() - vim.lsp.buf.clear_references() - end, - }, - }) - end - - if client.supports_method("textDocument/inlayHint") then - if vim.b[bufnr].inlay_hints_enabled == nil then - vim.b[bufnr].inlay_hints_enabled = true - end - -- TODO: Check this on 0.10.0 release - if vim.lsp.inlay_hint and vim.b[bufnr].inlay_hints_enabled then - vim.lsp.inlay_hint.enable(bufnr, true) - end - end - - -- TODO: Check this on 0.10.0 release - if vim.lsp.inlay_hint and vim.b[bufnr].inlay_hints_enabled then - vim.lsp.inlay_hint.enable(bufnr, true) - end - - local maps = require("config.keymaps").lsp_maps(client, bufnr) - M.set_maps(maps, { buffer = bufnr }) -end - -function M.set_title() - local title = " %t" - local f = io.popen([[ zsh -lc 'print -P $PS1' | sed 's/\[[0-9;]*m//g;s/» / %t/g' ]]) - if f ~= nil then - title = f:read("*a") or "" - f:close() - end - vim.opt.titlestring = title -end - -function M.buf_close(bufnr, force) - local kill_command = "bd" - - local bo = vim.bo - local api = vim.api - local fnamemodify = vim.fn.fnamemodify - - if bufnr == 0 or bufnr == nil then - bufnr = api.nvim_get_current_buf() - end - - local bufname = api.nvim_buf_get_name(bufnr) - - if not force then - local warning - if bo[bufnr].modified then - warning = string.format([[No write since last change for (%s)]], fnamemodify(bufname, ":t")) - elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then - warning = string.format([[Terminal %s will be killed]], bufname) - end - if warning then - vim.ui.input({ - prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning), - }, function(choice) - if choice:match("ye?s?") then - force = true - end - end) - if not force then - return - end - end - end - - -- Get list of window IDs with the buffer to close - local windows = vim.tbl_filter(function(win) - return api.nvim_win_get_buf(win) == bufnr - end, api.nvim_list_wins()) - - if #windows == 0 then - return - end - - if force then - kill_command = kill_command .. "!" - end - - -- Get list of active buffers - local buffers = vim.tbl_filter(function(buf) - return api.nvim_buf_is_valid(buf) and bo[buf].buflisted - end, api.nvim_list_bufs()) - - -- If there is only one buffer (which has to be the current one), vim will - -- create a new buffer on :bd. - -- For more than one buffer, pick the previous buffer (wrapping around if necessary) - if #buffers > 1 then - for i, v in ipairs(buffers) do - if v == bufnr then - local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1) - local prev_buffer = buffers[prev_buf_idx] - for _, win in ipairs(windows) do - api.nvim_win_set_buf(win, prev_buffer) - end - end - end - else - vim.cmd("q!") - end - - -- Check if buffer still exists, to ensure the target buffer wasn't killed - -- due to options like bufhidden=wipe. - if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then - vim.cmd(string.format("%s %d", kill_command, bufnr)) - end -end - -function M.is_available(plugin) - local lazy_config_avail, lazy_config = pcall(require, "lazy.core.config") - return lazy_config_avail and lazy_config.spec.plugins[plugin] ~= nil -end - -function M.empty_map_table() - local maps = {} - for _, mode in ipairs({ "", "n", "v", "x", "s", "o", "!", "i", "l", "c", "t" }) do - maps[mode] = {} - end - -- TODO: Check this on 0.10.0 release - if vim.fn.has("nvim-0.10.0") == 1 then - for _, abbr_mode in ipairs({ "ia", "ca", "!a" }) do - maps[abbr_mode] = {} - end - end - return maps -end - -function M.toggle_term_cmd(opts) - if not vim.g.user_terminals then - vim.g.user_terminals = {} - end - local terms = vim.g.user_terminals - if type(opts) == "string" then - opts = { cmd = opts, hidden = true } - end - local num = vim.v.count > 0 and vim.v.count or 1 - if not terms[opts.cmd] then - terms[opts.cmd] = {} - end - if not terms[opts.cmd][num] then - if not opts.count then - opts.count = vim.tbl_count(terms) * 100 + num - end - if not opts.on_exit then - opts.on_exit = function() - terms[opts.cmd][num] = nil - end - end - terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts) - end - terms[opts.cmd][num]:toggle() -end - -function M.cmd(cmd, show_error) - if type(cmd) == "string" then - cmd = { cmd } - end - local result = vim.fn.system(cmd) - local success = vim.api.nvim_get_vvar("shell_error") == 0 - if not success and (show_error == nil or show_error) then - vim.api.nvim_err_writeln( - ("Error running command %s\nError message:\n%s"):format(table.concat(cmd, " "), result) - ) - end - return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil -end - -function M.file_worktree(file, worktrees) - worktrees = worktrees or vim.g.git_worktrees - file = file or vim.fn.expand("%") - for _, worktree in ipairs(worktrees) do - if - M.cmd({ - "git", - "--work-tree", - worktree.toplevel, - "--git-dir", - worktree.gitdir, - "ls-files", - "--error-unmatch", - file, - }, false) - then - return worktree - end - end -end - -function M.which_key_register() - if M.which_key_queue then - local wk_avail, wk = pcall(require, "which-key") - if wk_avail then - for mode, registration in pairs(M.which_key_queue) do - wk.register(registration, { mode = mode }) - end - M.which_key_queue = nil - end - end -end - -function M.set_maps(map_table, base) - base = base or {} - for mode, maps in pairs(map_table) do - for keymap, options in pairs(maps) do - if options then - local cmd = options - local keymap_opts = base - if type(options) == "table" then - cmd = options[1] - keymap_opts = vim.tbl_deep_extend("force", keymap_opts, options) - keymap_opts[1] = nil - end - if not cmd or keymap_opts.name then -- which-key mapping - if not keymap_opts.name then - keymap_opts.name = keymap_opts.desc - end - if not M.which_key_queue then - M.which_key_queue = {} - end - if not M.which_key_queue[mode] then - M.which_key_queue[mode] = {} - end - M.which_key_queue[mode][keymap] = keymap_opts - else -- not which-key mapping - vim.keymap.set(mode, keymap, cmd, keymap_opts) - end - end - end - end - if package.loaded["which-key"] then - M.which_key_register() - end -end - -function M.del_buffer_autocmd(augroup, bufnr) - local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr }) - if cmds_found then - vim.tbl_map(function(cmd) - vim.api.nvim_del_autocmd(cmd.id) - end, cmds) - end -end - -function M.add_buffer_autocmd(augroup, bufnr, autocmds) - if not vim.tbl_islist(autocmds) then - autocmds = { autocmds } - end - local cmds_found, cmds = pcall(vim.api.nvim_get_autocmds, { group = augroup, buffer = bufnr }) - if not cmds_found or vim.tbl_isempty(cmds) then - vim.api.nvim_create_augroup(augroup, { clear = false }) - for _, autocmd in ipairs(autocmds) do - local events = autocmd.events - autocmd.events = nil - autocmd.group = augroup - autocmd.buffer = bufnr - vim.api.nvim_create_autocmd(events, autocmd) - end - end -end - -function M.has_capability(capability, filter) - for _, client in ipairs(vim.lsp.get_active_clients(filter)) do - if client.supports_method(capability) then - return true - end - end - return false -end - -function M.diagnostic_setup(conf) - for _, sign in ipairs(conf.signs) do - vim.fn.sign_define(sign.name, sign) - end - vim.diagnostic.config(conf.diagnostic) -end - -function M.has_value(table, value) - for _, v in ipairs(table) do - if v == value then - return true - end - end - return false -end - -function M.get_gwd(path) - return require("lspconfig.util").find_git_ancestor(path or vim.fn.getcwd()) -end - -function M.set_cwd() - local dir = M.get_gwd() - if dir ~= nil then - vim.fn.chdir(dir) - end -end - -function M.get_lsp_key(key) - local ok, keys = pcall(require, "config.keys") - if ok then - return keys[key] - end -end - -function M.lazy_file() -end - -return M diff --git a/.config/nvim/lua/lazy-init.lua b/.config/nvim/lua/lazy-init.lua deleted file mode 100644 index d083a9be6..000000000 --- a/.config/nvim/lua/lazy-init.lua +++ /dev/null @@ -1,13 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) -require("lazy").setup("plugins", require("plugins.lazy").opts) diff --git a/.config/nvim/lua/plugins/cmp/cmp.lua b/.config/nvim/lua/plugins/cmp/cmp.lua deleted file mode 100644 index 0b6edb527..000000000 --- a/.config/nvim/lua/plugins/cmp/cmp.lua +++ /dev/null @@ -1,72 +0,0 @@ -local M = { "hrsh7th/nvim-cmp" } - -M.dependencies = { - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", -} - -M.event = "InsertEnter" - -M.opts = function() - local cmp = require("cmp") - local snip_status_ok, luasnip = pcall(require, "luasnip") - local lspkind_status_ok, lspkind = pcall(require, "lspkind") - if not snip_status_ok then - return - end - - local border_opts = { - border = "rounded", - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None", - } - - return { - enabled = function() - local dap_prompt = require("funcs").is_available("cmp-dap") - and vim.tbl_contains( - { "dap-repl", "dapui_watches", "dapui_hover" }, - vim.api.nvim_get_option_value("filetype", { buf = 0 }) - ) - if vim.api.nvim_get_option_value("buftype", { buf = 0 }) == "prompt" and not dap_prompt then - return false - end - return true - end, - preselect = cmp.PreselectMode.None, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = lspkind_status_ok and lspkind.cmp_format(require("plugins.misc.lspkind").opts) or nil, - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - duplicates = { - nvim_lsp = 1, - luasnip = 1, - cmp_tabnine = 1, - buffer = 1, - path = 1, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - completion = cmp.config.window.bordered(border_opts), - documentation = cmp.config.window.bordered(border_opts), - }, - mapping = require("config.keymaps").cmp, - sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 1000 }, - { name = "luasnip", priority = 750 }, - { name = "buffer", priority = 500 }, - { name = "path", priority = 250 }, - }), - } -end - -return M diff --git a/.config/nvim/lua/plugins/cmp/dap.lua b/.config/nvim/lua/plugins/cmp/dap.lua deleted file mode 100644 index 1c4fabb0d..000000000 --- a/.config/nvim/lua/plugins/cmp/dap.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = { "rcarriga/cmp-dap" } - -M.event = { "VeryLazy" } - -M.dependencies = { "nvim-cmp" } - -M.config = function() - require("cmp").setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, { - sources = { - { name = "dap" }, - }, - }) -end - -return M diff --git a/.config/nvim/lua/plugins/cmp/init.lua b/.config/nvim/lua/plugins/cmp/init.lua deleted file mode 100644 index 7a3f456d1..000000000 --- a/.config/nvim/lua/plugins/cmp/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - require("plugins.cmp.cmp"), - require("plugins.cmp.dap"), - require("plugins.cmp.luasnip"), -} diff --git a/.config/nvim/lua/plugins/cmp/luasnip.lua b/.config/nvim/lua/plugins/cmp/luasnip.lua deleted file mode 100644 index 9ab255a6f..000000000 --- a/.config/nvim/lua/plugins/cmp/luasnip.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = { "L3MON4D3/LuaSnip" } - -M.lazy = true - -M.build = "make install_jsregexp" - -M.dependencies = { "rafamadriz/friendly-snippets" } - -M.opts = { - history = true, - delete_check_events = "TextChanged", - region_check_events = "CursorMoved", -} - -M.config = function(_, opts) - require("luasnip").config.setup(opts) - vim.tbl_map(function(type) - require("luasnip.loaders.from_" .. type).lazy_load() - end, { "vscode", "snipmate", "lua" }) -end - -return M diff --git a/.config/nvim/lua/plugins/dap/dap-ui.lua b/.config/nvim/lua/plugins/dap/dap-ui.lua deleted file mode 100644 index d54a41290..000000000 --- a/.config/nvim/lua/plugins/dap/dap-ui.lua +++ /dev/null @@ -1,23 +0,0 @@ -local M = { "rcarriga/nvim-dap-ui" } - -M.dependencies = { "mason-nvim-dap.nvim" } - -M.opts = { - floating = { border = "rounded" }, -} - -M.config = function(_, opts) - local dap, dapui = require("dap"), require("dapui") - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() - end - dapui.setup(opts) -end - -return M diff --git a/.config/nvim/lua/plugins/dap/init.lua b/.config/nvim/lua/plugins/dap/init.lua deleted file mode 100644 index 598260f72..000000000 --- a/.config/nvim/lua/plugins/dap/init.lua +++ /dev/null @@ -1,19 +0,0 @@ -local icons = require("config.icons") -local signs = { - { name = "DapStopped", text = icons.Dap.Stopped, texthl = "DiagnosticWarn" }, - { name = "DapBreakpoint", text = icons.Dap.Breakpoint, texthl = "DiagnosticInfo" }, - { name = "DapBreakpointRejected", text = icons.Dap.BreakpointRejected, texthl = "DiagnosticError" }, - { name = "DapBreakpointCondition", text = icons.Dap.BreakpointCondition, texthl = "DiagnosticInfo" }, - { name = "DapLogPoint", text = icons.Dap.LogPoint, texthl = "DiagnosticInfo" }, -} - -for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, sign) -end - -return { - { "mfussenegger/nvim-dap" }, - { "nvim-neotest/nvim-nio" }, - require("plugins.dap.dap-ui"), - require("plugins.dap.mason-dap"), -} diff --git a/.config/nvim/lua/plugins/dap/mason-dap.lua b/.config/nvim/lua/plugins/dap/mason-dap.lua deleted file mode 100644 index de9a7aec5..000000000 --- a/.config/nvim/lua/plugins/dap/mason-dap.lua +++ /dev/null @@ -1,11 +0,0 @@ -local M = { "jay-babu/mason-nvim-dap.nvim" } - -M.dependencies = { "mason.nvim", "nvim-dap" } - -M.cmd = { "DapInstall", "DapUninstall" } - -M.opts = { - handlers = {} -} - -return M diff --git a/.config/nvim/lua/plugins/language.lua b/.config/nvim/lua/plugins/language.lua new file mode 100644 index 000000000..8fbcb020a --- /dev/null +++ b/.config/nvim/lua/plugins/language.lua @@ -0,0 +1,214 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = { + auto_install = true, + ensure_installed = Custom.language.treesitter_install, + }, + }, + { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = Custom.language.formatters_by_ft, + formatters = Custom.language.formatters, + }, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = Custom.language.lsp, + setup = Custom.language.lsp_setup, + }, + }, + { + "mfussenegger/nvim-lint", + opts = { + linters_by_ft = Custom.language.linters_by_ft, + linters = Custom.language.linters, + }, + }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = Custom.language.mason_install, + }, + }, + { + "hrsh7th/nvim-cmp", + opts = function(_, opts) + local cmp = require("cmp") + local function has_words_before() + local line, col = (unpack or table.unpack)(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 + and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + -- stylua: ignore + table.insert(opts.auto_brackets, "python") + table.insert(opts.sources, { name = "crates" }) + + opts.mapping = vim.tbl_deep_extend("force", opts.mapping, { + [""] = require("cmp").mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), + [""] = require("cmp").mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), + [""] = require("cmp").mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = require("cmp").mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = require("cmp").mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = require("cmp").mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = require("cmp").mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), + [""] = require("cmp").mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), + [""] = cmp.mapping.confirm({ select = false }), + [""] = cmp.config.disable, + [""] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), + [""] = vim.NIL, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_locally_jumpable() then + require("luasnip").expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, + { + "mfussenegger/nvim-ansible", + keys = { + { + "tr", + function() + require("ansible").run() + end, + silent = true, + }, + }, + { + "b0o/SchemaStore.nvim", + lazy = true, + version = false, + }, + }, + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = function() + vim.fn["mkdp#util#install"]() + end, + keys = { + { + "cp", + ft = "markdown", + "MarkdownPreviewToggle", + desc = "Markdown Preview", + }, + }, + config = function() + vim.cmd([[do FileType]]) + end, + }, + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/neotest-python", + }, + opts = function(_, opts) + local _, rt = pcall(require, "rustaceanvim.neotest") + opts.adapters = vim.tbl_deep_extend("force", opts.adapters, { + ["neotest-python"] = {}, + rt, + }) + end, + }, + { + "mfussenegger/nvim-dap-python", + -- stylua: ignore + keys = { + { "dPt", function() require("dap-python").test_method() end, desc = "Debug Method", ft = "python" }, + { "dPc", function() require("dap-python").test_class() end, desc = "Debug Class", ft = "python" }, + }, + config = function() + local path = require("mason-registry").get_package("debugpy"):get_install_path() + require("dap-python").setup(path .. "/venv/bin/python") + end, + }, + { + "linux-cultist/venv-selector.nvim", + cmd = "VenvSelect", + opts = function(_, opts) + if LazyVim.has("nvim-dap-python") then + opts.dap_enabled = true + end + return vim.tbl_deep_extend("force", opts, { + name = { + "venv", + ".venv", + "env", + ".env", + }, + }) + end, + keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv" } }, + }, + { + "Saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + opts = { + src = { + cmp = { enabled = true }, + }, + }, + }, + { + "mrcjkb/rustaceanvim", + version = "^4", + ft = { "rust" }, + opts = { + server = { + on_attach = function(_, bufnr) + vim.keymap.set("n", "cR", function() + vim.cmd.RustLsp("codeAction") + end, { desc = "Code Action", buffer = bufnr }) + vim.keymap.set("n", "dr", function() + vim.cmd.RustLsp("debuggables") + end, { desc = "Rust Debuggables", buffer = bufnr }) + end, + default_settings = { + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, + checkOnSave = { + allFeatures = true, + command = "clippy", + extraArgs = { "--no-deps" }, + }, + procMacro = { + enable = true, + ignored = { + ["async-trait"] = { "async_trait" }, + ["napi-derive"] = { "napi" }, + ["async-recursion"] = { "async_recursion" }, + }, + }, + }, + }, + }, + }, + config = function(_, opts) + vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) + end, + }, +} diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua deleted file mode 100644 index d7f434ac5..000000000 --- a/.config/nvim/lua/plugins/lazy.lua +++ /dev/null @@ -1,56 +0,0 @@ -local M = { "folke/lazy.nvim" } -local icons = require("config.icons") - -M.opts = { - dev = { - path = (os.getenv("XDG_DOCUMENTS_DIR") or "~/Documents") .. "/dev/nvim", - patterns = { "ssnailed" }, - }, - install = { - missing = true, - colorscheme = { "tokyonight" }, - }, - ui = { - title = "packages", - border = "single", - icons = { - cmd = icons.Console .. " ", - config = icons.Gear, - event = icons.Event, - ft = icons.File .. " ", - init = icons.Gear .. " ", - import = icons.Import .. " ", - keys = icons.Keyboard .. " ", - lazy = icons.Sleep .. " ", - loaded = icons.Loaded, - not_loaded = icons.Unloaded, - plugin = icons.Package, - runtime = icons.Runtime .. " ", - source = icons.Source .. " ", - start = icons.Start, - task = icons.Task, - }, - }, - change_detection = { - enabled = false, - }, - -- checker = { - -- enabled = true, - -- }, - disabled_plugins = { - "gzip", - -- "matchit", - "matchparen", - "netrwPlugin", - "tarPlugin", - -- "tohtml", - "tutor", - "zipPlugin", - }, - profiling = { - loader = true, - require = true, - } -} - -return M diff --git a/.config/nvim/lua/plugins/lsp/aerial.lua b/.config/nvim/lua/plugins/lsp/aerial.lua deleted file mode 100644 index 83e5cb8ff..000000000 --- a/.config/nvim/lua/plugins/lsp/aerial.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = { "stevearc/aerial.nvim" } - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.opts = { - attach_mode = "global", - backends = { "lsp", "treesitter", "markdown", "man" }, - disable_max_lines = vim.g.max_lines, - disable_max_size = vim.g.max_size, - layout = { min_width = 28 }, - show_guides = true, - filter_kind = false, - guides = { - mid_item = "├ ", - last_item = "└ ", - nested_top = "│ ", - whitespace = " ", - }, - keymaps = require("config.keymaps").aerial, -} - -return M diff --git a/.config/nvim/lua/plugins/lsp/init.lua b/.config/nvim/lua/plugins/lsp/init.lua deleted file mode 100644 index c90adad5b..000000000 --- a/.config/nvim/lua/plugins/lsp/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { "neovim/nvim-lspconfig" }, - { "folke/neoconf.nvim" }, - { "folke/neodev.nvim", opts = {} }, - require("plugins.lsp.mason-lspconfig"), - require("plugins.lsp.mason-null-ls"), - require("plugins.lsp.null-ls"), - require("plugins.lsp.aerial"), -} diff --git a/.config/nvim/lua/plugins/lsp/mason-lspconfig.lua b/.config/nvim/lua/plugins/lsp/mason-lspconfig.lua deleted file mode 100644 index 271fc3e77..000000000 --- a/.config/nvim/lua/plugins/lsp/mason-lspconfig.lua +++ /dev/null @@ -1,43 +0,0 @@ -local M = { "williamboman/mason-lspconfig.nvim" } -local f = require("funcs") -local serverconf = require("config.lsp") - -M.dependencies = { "mason.nvim", "neoconf.nvim", "neodev.nvim" } - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.cmd = { "LspInstall", "LspUninstall" } - -local function merge(table, overwrite) - overwrite = overwrite or {} - return table and vim.tbl_deep_extend("force", table, overwrite) or overwrite -end - -local base_capabilities = vim.lsp.protocol.make_client_capabilities() -local cmp_capabilities = require('cmp_nvim_lsp').default_capabilities() -local capabilities = merge(base_capabilities, cmp_capabilities) -capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true } - -M.config = function() - require("neoconf").setup() - require("neodev").setup() - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", silent = true }) - vim.lsp.handlers["textDocument/signatureHelp"] = - vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded", silent = true }) - - local mlsp = require("mason-lspconfig") - mlsp.setup({ ensure_installed = serverconf.required }) - - mlsp.setup_handlers({ - function(server) - if not f.has_value(serverconf.ignore, server) then - local ls = require("lspconfig")[server] - local ls_opts = merge(ls, { capabilities = capabilities, on_attach = require("funcs").lsp_on_attach }) - local opts = merge(ls_opts, serverconf.handlers[server]) - require("lspconfig")[server].setup(opts) - end - end, - }) -end - -return M diff --git a/.config/nvim/lua/plugins/lsp/mason-null-ls.lua b/.config/nvim/lua/plugins/lsp/mason-null-ls.lua deleted file mode 100644 index a9b5c312c..000000000 --- a/.config/nvim/lua/plugins/lsp/mason-null-ls.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = { "jay-babu/mason-null-ls.nvim" } - -M.dependencies = { "mason.nvim" } - -M.opts = { handlers = {} } - -return M diff --git a/.config/nvim/lua/plugins/lsp/null-ls.lua b/.config/nvim/lua/plugins/lsp/null-ls.lua deleted file mode 100644 index 2796ecc9a..000000000 --- a/.config/nvim/lua/plugins/lsp/null-ls.lua +++ /dev/null @@ -1,11 +0,0 @@ -local M = { "nvimtools/none-ls.nvim" } - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.dependencies = { "mason-null-ls.nvim" } - -M.opts = { - on_attach = require("funcs").lsp_on_attach, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/alpha.lua b/.config/nvim/lua/plugins/misc/alpha.lua deleted file mode 100644 index 6cfef7b32..000000000 --- a/.config/nvim/lua/plugins/misc/alpha.lua +++ /dev/null @@ -1,169 +0,0 @@ -local M = { "goolord/alpha-nvim" } - -M.lazy = true - -M.event = { "VimEnter" } - -M.dependencies = { "telescope.nvim", "todo-comments.nvim" } - -M.opts = function() - local icons = require("config.icons") - local dashboard = require("alpha.themes.dashboard") - - dashboard.section.header.opts.hl = "DashboardHeader" - dashboard.section.footer.opts.hl = "DashboardFooter" - - local banners = { - [1] = { - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀", - "⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀", - "⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀", - "⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀", - "⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀", - "⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷", - "⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿", - "⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁", - "⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀", - "⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀", - "⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - }, - [2] = { - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢒⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⡈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢣⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⡦⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⣸⠂⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠸⡢⡀⠀⠀⠀⠀⠀⠔⣰⠏⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⢖⡠⣨⠊⠒⠠⣀⢀⠊⣠⠃⡰⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠠⠠⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⢰⠑⠚⠀⠀⠀⡉⠀⢇⡰⠀⠀⠀⠀⠀⢀⠠⠐⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠐⠤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠘⠠⠐⡇⠀⠀⠀⠠⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠀⢀⠁⠀⢀⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠀⠀⠼⢄⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⢸⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀⠀⠈⠢⠄⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠸⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠎⠀⠀⠀⠀⠀⠀⡠⠀⠈⢆⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠨⠀⠀⠀⠀⠀⠀⠀⢆⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⡌⠀⠀⢎⠨⡄⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡂⠀⠀⠀⠀⠀⠀⠈⢎⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇⠀⠀⠀⠀⠀⠸⠀⠀⢸⠸⢀⠇⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠡⢕⠠⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⢐⠀⠀⠈⠢⠥⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡉⠒⠠⣀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⡰⠁⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠠⢄⠈⠑⠒⠤⡀⠀⢐⠅⠀⠀⠀⠀⠀⠀⠀⡁⡂⠉⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠤⢀⠓⠈⠢⢀⢀⠠⠤⠐⠀⡉⠌⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠰⠐⠪⠤⢀⢀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠢⠄⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠂⠒⡠⠄", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠀⠂⠐⠐⠐⠂⠂⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠐⠂⠂⠀⠉⠀⠀⠀", - }, - [3] = { - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣷⣶⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⠿⠟⠛⠉⠉⠉⠉⠉⢉⣭⡉⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣦⡀⠀⠀⠀⠉⠛⢿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀", - "⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀", - "⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⡀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀", - "⠀⠀⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡦⠀⠀⠀⠀⠀⢻⣿⣿⣿⣷⠀⠀", - "⠀⣼⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣧⠀", - "⢠⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⡄", - "⢸⣿⣿⣿⡇⠀⡀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⢸⣿⣿⣿⡇", - "⣿⣿⣿⣿⡇⠀⣿⣦⣤⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⢸⣿⣿⣿⣿", - "⣿⣿⣿⣿⠀⠀⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿", - "⣿⣿⣿⣿⡇⠀⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⢸⣿⣿⣿⣿", - "⢸⣿⣿⣿⡇⠀⠉⠉⠉⠉⠉⠉⠉⢠⡀⠀⠀⣠⣾⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢸⣿⣿⣿⡇", - "⠘⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣦⣾⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⠃", - "⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⣤⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡟⠀", - "⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⠀⠀", - "⠀⠀⠈⢿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⡀⠀⣠⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠁⠀⠀", - "⠀⠀⠀⠈⠻⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀", - "⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⣤⣀⠀⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠦⠀⠀⠀⠀⠀⣀⣤⣾⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⣀⣀⣀⣀⣀⣀⣀⣀⣤⣴⣶⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⠿⠿⢿⣿⣿⣿⣿⣿⡿⠿⠿⠟⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - }, - [4] = { - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢇⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⢸⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⠀⠀", - "⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀", - "⠀⠀⢠⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⠀⠀⠀", - "⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⠀⠀⠀⠀⠀", - "⠀⠀⣸⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⡀⠀⠀⢉⣿⣿⠀⠀⠀⠀⠀", - "⠀⠀⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠿⠟⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀", - "⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣤⣤⣀⡀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⢀⣴⣿⣿⡇⠀⠀⠀⠀⠀", - "⠀⠀⠀⠘⣿⣿⣿⣯⡉⠙⠛⠻⠿⢿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣶⣦⣄⣀⡀⠀⠀⠀⣀⣀⣠⣤⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠸⣿⣿⣿⣷⣤⠀⠀⠀⠀⠀⠉⠙⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⣿⣶⣶⣤⣄⠀⢀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠀⠈⠙⠛⠻⠿⠿⠿⠀⢀⣠⣴⣶⣦⡀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣷⡀⢀⠀⠀⠀⠀⠀⠀⡀⢠⣿⠟⠉⠀⠀⠁⣀⡀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣷⣤⣦⣀⣤⣿⣿⣿⡀⠀⢀⣠⣾⣿⣿", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠃", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠻⠿⠿⠿⣿⡿⠿⠿⠿⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀", - }, - } - - dashboard.section.header.val = banners[4] - - dashboard.section.buttons.val = { - dashboard.button("n", icons.File .. " New file", "ene"), - dashboard.button("f", icons.Search .. " Find file", "lua require('telescope.builtin').find_files()"), - dashboard.button( - "e", - icons.FileTree .. " Browse files", - "lua require('taolf').start({ dir = 'gwd' })" - ), - dashboard.button( - "t", - icons.Task .. " Find todo", - ":lua require('telescope').extensions['todo-comments'].todo()" - ), - dashboard.button("q", icons.Leave .. " Quit", "qa"), - } - - dashboard.section.footer.val = "Behold: a Snail's Vim" - - dashboard.config.layout = { - { type = "padding", val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) }, - dashboard.section.header, - { type = "padding", val = 5 }, - dashboard.section.buttons, - { type = "padding", val = 3 }, - dashboard.section.footer, - } - - dashboard.config.opts.noautocmd = true - - return dashboard -end - -M.config = function(_, opts) - require("alpha").setup(opts.config) - - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - desc = "Add Alpha dashboard footer", - once = true, - callback = function() - local stats = require("lazy").stats() - local ms = math.floor(stats.startuptime * 100 + 0.5) / 100 - opts.section.footer.val = { "Behold: a Snail's Vim | " .. stats.count .. "  " .. ms .. "ms" } - pcall(vim.cmd.AlphaRedraw) - end, - }) -end - -return M diff --git a/.config/nvim/lua/plugins/misc/autopairs.lua b/.config/nvim/lua/plugins/misc/autopairs.lua deleted file mode 100644 index 9c8759ad5..000000000 --- a/.config/nvim/lua/plugins/misc/autopairs.lua +++ /dev/null @@ -1,17 +0,0 @@ -local M = { "windwp/nvim-autopairs" } - -M.lazy = true - -M.event = { "VeryLazy" } - -M.opts = { - check_ts = true, - disable_filetype = { "TelescopePrompt", "vim" }, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/bufferline.lua b/.config/nvim/lua/plugins/misc/bufferline.lua deleted file mode 100644 index ad3e80982..000000000 --- a/.config/nvim/lua/plugins/misc/bufferline.lua +++ /dev/null @@ -1,58 +0,0 @@ -local M = { "akinsho/bufferline.nvim" } - -M.event = { "VeryLazy" } - -M.opts = function() - local icons = require("config.icons") - - local function diagnostics_indicator(_, _, diagnostics, _) - local result = {} - local symbols = { - error = icons.Error, - warning = icons.Warn, - info = icons.Info, - } - for name, count in pairs(diagnostics) do - if symbols[name] and count > 0 then - table.insert(result, symbols[name] .. " " .. count) - end - end - local result_str = table.concat(result, " ") - return #result_str > 0 and result_str or "" - end - - local config = { - highlights = { - background = { - italic = true, - bold = false, - }, - buffer_selected = { - italic = false, - bold = true, - }, - }, - options = { - indicator = { - style = "none", - }, - buffer_close_icon = icons.Close, - modified_icon = icons.Modified, - close_icon = icons.Close, - left_trunc_marker = icons.Truncate, - right_trunc_marker = icons.Truncate, - diagnostics = "nvim_lsp", - diagnostics_indicator = diagnostics_indicator, - offsets = {}, - show_buffer_close_icons = false, - show_close_icon = false, - separator_style = { "", "" }, - move_wraps_at_ends = true, - always_show_bufferline = false, - sort_by = "id", - }, - } - return config -end - -return M diff --git a/.config/nvim/lua/plugins/misc/colorizer.lua b/.config/nvim/lua/plugins/misc/colorizer.lua deleted file mode 100644 index d41e1de7b..000000000 --- a/.config/nvim/lua/plugins/misc/colorizer.lua +++ /dev/null @@ -1,9 +0,0 @@ -local M = { "NvChad/nvim-colorizer.lua" } - -M.lazy = true - -M.cmd = { "ColorizerToggle", "ColorizerAttachToBuffer", "ColorizerDetachFromBuffer", "ColorizerReloadAllBuffers" } - -M.opts = { user_default_options = { names = false } } - -return M diff --git a/.config/nvim/lua/plugins/misc/comment.lua b/.config/nvim/lua/plugins/misc/comment.lua deleted file mode 100644 index 259be9f9f..000000000 --- a/.config/nvim/lua/plugins/misc/comment.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = { "numToStr/Comment.nvim" } - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.opts = { - mappings = { - basic = false, - extra = false, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/gitsigns.lua b/.config/nvim/lua/plugins/misc/gitsigns.lua deleted file mode 100644 index 2f093aa6b..000000000 --- a/.config/nvim/lua/plugins/misc/gitsigns.lua +++ /dev/null @@ -1,18 +0,0 @@ -local M = { "lewis6991/gitsigns.nvim" } - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -local icons = require("config.icons") - -M.opts = { - signs = { - add = { text = icons.Added }, - change = { text = icons.Modified }, - delete = { text = icons.Removed }, - topdelete = { text = icons.Removed }, - changedelete = { text = icons.ChangeDelete }, - untracked = { text = icons.Untracked }, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/indent-blankline.lua b/.config/nvim/lua/plugins/misc/indent-blankline.lua deleted file mode 100644 index faf8a38fc..000000000 --- a/.config/nvim/lua/plugins/misc/indent-blankline.lua +++ /dev/null @@ -1,37 +0,0 @@ -local M = { "lukas-reineke/indent-blankline.nvim" } - -M.main = "ibl" - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.dependencies = { "nvim-treesitter" } - -M.opts = { - indent = { - char = "▏", - tab_char = "▏", - }, - scope = { - char = "▎", - enabled = true, - show_start = false, - show_end = false, - }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/init.lua b/.config/nvim/lua/plugins/misc/init.lua deleted file mode 100644 index d8359c2e8..000000000 --- a/.config/nvim/lua/plugins/misc/init.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - { "nvim-lua/plenary.nvim", lazy = true }, - { "kyazdani42/nvim-web-devicons", lazy = true }, - { "zk-org/zk-nvim", opts = { picker = "telescope" }, main = "zk" }, - { "NMAC427/guess-indent.nvim", config = true }, - { "JoosepAlviste/nvim-ts-context-commentstring", dependencies = { "nvim-treesitter" } }, - { "nvim-treesitter/nvim-treesitter-textobjects", dependencies = { "nvim-treesitter" } }, - { "windwp/nvim-ts-autotag" }, - require("plugins.misc.alpha"), - require("plugins.misc.autopairs"), - require("plugins.misc.bufferline"), - require("plugins.misc.colorizer"), - require("plugins.misc.comment"), - require("plugins.misc.gitsigns"), - require("plugins.misc.indent-blankline"), - require("plugins.misc.taolf"), - require("plugins.misc.lspkind"), - require("plugins.misc.lualine"), - require("plugins.misc.mason"), - require("plugins.misc.rustacean"), - require("plugins.misc.surround"), - require("plugins.misc.telescope"), - require("plugins.misc.telescope-fzf-native"), - require("plugins.misc.todo-comments"), - require("plugins.misc.toggleterm"), - require("plugins.misc.tokyonight"), - require("plugins.misc.treesitter"), - require("plugins.misc.ufo"), - require("plugins.misc.vimtex"), - require("plugins.misc.which-key"), - -- require("plugins.misc.tabnine"), -} diff --git a/.config/nvim/lua/plugins/misc/lspkind.lua b/.config/nvim/lua/plugins/misc/lspkind.lua deleted file mode 100644 index 0ca29c04f..000000000 --- a/.config/nvim/lua/plugins/misc/lspkind.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = { "onsails/lspkind.nvim" } - -M.lazy = true - -M.opts = { - mode = "symbol", - symbol_map = require("config.icons").lspkind, - menu = {}, -} - -M.config = function(_, opts) - require("lspkind").init(opts) -end - -return M diff --git a/.config/nvim/lua/plugins/misc/lualine.lua b/.config/nvim/lua/plugins/misc/lualine.lua deleted file mode 100644 index 1cf01e7e3..000000000 --- a/.config/nvim/lua/plugins/misc/lualine.lua +++ /dev/null @@ -1,219 +0,0 @@ -local M = { "nvim-lualine/lualine.nvim" } - --- M.event = { "VeryLazy" } - -M.opts = function() - local colors = require("tokyonight.colors").setup({ transform = true }) - local icons = require("config.icons") - local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand("%:p:h") - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, - } - - -- local function search_result() - -- if vim.v.hlsearch == 0 then - -- return "" - -- end - -- local last_search = vim.fn.getreg("/") - -- if not last_search or last_search == "" then - -- return "" - -- end - -- local searchcount = vim.fn.searchcount({ maxcount = 9999 }) - -- return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")" - -- end - - local config = { - options = { - component_separators = "", - section_separators = "", - -- theme = { - -- normal = { c = { fg = colors.fg, bg = colors.bg } }, - -- inactive = { c = { fg = colors.fg, bg = colors.bg } }, - -- }, - disabled_filetypes = { - statusline = { "alpha" }, - }, - ignore_focus = { "toggleterm", "NvimTree" }, - globalstatus = true, - }, - sections = { - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - } - - local function ins_left(component) - table.insert(config.sections.lualine_c, component) - end - - local function ins_right(component) - table.insert(config.sections.lualine_x, component) - end - - local function mode_color() - local color = { - n = colors.red, - i = colors.green, - v = colors.magenta, - [string.char(22)] = colors.magenta, - V = colors.magenta, - c = colors.blue, - no = colors.red, - s = colors.orange, - S = colors.orange, - [string.char(19)] = colors.orange, - ic = colors.yellow, - R = colors.purple, - Rv = colors.purple, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ["r?"] = colors.cyan, - ["!"] = colors.red, - t = colors.red, - } - return { fg = color[vim.fn.mode()] } - end - - ins_left({ - function() - return "▊" - end, - color = function() - return mode_color() - end, - padding = { right = 1 }, - }) - - ins_left({ - "filename", - cond = conditions.buffer_not_empty, - color = { fg = colors.magenta, gui = "bold" }, - }) - - ins_left({ - "fileformat", - fmt = string.upper, - icons_enabled = false, - color = { fg = colors.green }, - }) - - ins_left({ - "o:encoding", - fmt = string.upper, - cond = conditions.hide_in_width, - color = { fg = colors.green }, - }) - - ins_left({ - "filesize", - fmt = string.upper, - icons_enabled = false, - color = { fg = colors.green }, - }) - - ins_left({ - "%04l:%04c", - }) - - -- NOTE: My beloved :( - - -- ins_left { - -- function() - -- local current_line = vim.fn.line "." - -- local total_lines = vim.fn.line "$" - -- local chars = icons.progress - -- local line_ratio = current_line / total_lines - -- local index = math.ceil(line_ratio * #chars) - -- return chars[index] - -- end, - -- color = { fg = colors.yellow } - -- } - - -- ins_right({ - -- search_result, - -- color = { fg = colors.fg }, - -- padding = { left = 1 }, - -- }) - - -- ins_right({ - -- 'tabnine', - -- color = { fg = colors.green1, gui = "bold" }, - -- }) - - ins_right({ - function() - local msg = "" - local buf_ft = vim.api.nvim_buf_get_option(0, "filetype") - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return "No LSP" - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - msg = msg .. ", " .. client.name - end - end - return msg:sub(3) - end, - color = { fg = colors.green2, gui = "bold" }, - }) - - ins_right({ - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { - error = icons.Error .. " ", - warn = icons.Warn .. " ", - info = icons.Info .. " ", - }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, - }) - - ins_right({ - "filetype", - color = { fg = colors.green, gui = "bold" }, - padding = { left = 1 }, - }) - - ins_right({ - function() - return "▊" - end, - color = function() - return mode_color() - end, - padding = { left = 1 }, - }) - - return config -end - -return M diff --git a/.config/nvim/lua/plugins/misc/mason.lua b/.config/nvim/lua/plugins/misc/mason.lua deleted file mode 100644 index 378bb14c1..000000000 --- a/.config/nvim/lua/plugins/misc/mason.lua +++ /dev/null @@ -1,29 +0,0 @@ -local M = { "williamboman/mason.nvim" } - -local icons = require("config.icons") - -M.cmd = { - "Mason", - "MasonInstall", - "MasonUninstall", - "MasonUninstallAll", - "MasonLog", - "MasonUpdate", -} - -M.build = ":MasonUpdate" - -M.opts = { - ui = { - border = "none", - icons = { - package_installed = icons.True, - package_pending = icons.Pending, - package_uninstalled = icons.False, - }, - }, - log_level = vim.log.levels.INFO, - max_concurrent_installers = 4, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/rustacean.lua b/.config/nvim/lua/plugins/misc/rustacean.lua deleted file mode 100644 index 2133549b4..000000000 --- a/.config/nvim/lua/plugins/misc/rustacean.lua +++ /dev/null @@ -1,24 +0,0 @@ -local M = { "mrcjkb/rustaceanvim" } - -M.build = ":MasonInstall codelldb" - -M.ft = { "rust" } - -M.init = function() - local extension_path = os.getenv("XDG_DATA_HOME") .. "/nvim/mason/packages/codelldb/extension/" - local codelldb_path = extension_path .. "apapter/codelldb" - local liblldb_path = extension_path .. "lldb/lib/liblldb.so" - local adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, liblldb_path) - vim.g.rustaceanvim = function() - return { - dap = { - adapter = adapter, - }, - server = { - on_attach = require("funcs").lsp_on_attach, - }, - } - end -end - -return M diff --git a/.config/nvim/lua/plugins/misc/surround.lua b/.config/nvim/lua/plugins/misc/surround.lua deleted file mode 100644 index 7b3f6f9b1..000000000 --- a/.config/nvim/lua/plugins/misc/surround.lua +++ /dev/null @@ -1,21 +0,0 @@ -local M = { "kylechui/nvim-surround" } - -M.event = "VeryLazy" - -M.opts = { - keymaps = require("config.keymaps").surround, - surrounds = { - ["B"] = { - add = { "{{ ", " }}" }, - find = function() - return require("nvim-surround.config").get_selection({ pattern = "{{ .- }}" }) - end, - delete = "^(.. ?)().-( ?..)()$", - }, - }, - aliases = { - ["B"] = false, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/tabnine.lua b/.config/nvim/lua/plugins/misc/tabnine.lua deleted file mode 100644 index e9282c99b..000000000 --- a/.config/nvim/lua/plugins/misc/tabnine.lua +++ /dev/null @@ -1,23 +0,0 @@ -local M = { "codota/tabnine-nvim" } - -M.build = "./dl_binaries.sh" - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.main = "tabnine" - -M.opts = function() - local colors = require("tokyonight.colors").setup({ transform = true }) - local maps = require("config.keymaps").tabnine - return { - disable_auto_comment = true, - accept_keymap = maps.accept_keymap, - dismiss_keymap = maps.dismiss_keymap, - debounce_ms = 800, - suggestion_color = { gui = colors.fg_gutter, cterm = 244 }, - exclude_filetypes = { "TelescopePrompt", "NvimTree" }, - log_file_path = nil, -- absolute path to Tabnine log file - } -end - -return M diff --git a/.config/nvim/lua/plugins/misc/taolf.lua b/.config/nvim/lua/plugins/misc/taolf.lua deleted file mode 100644 index 5429eec65..000000000 --- a/.config/nvim/lua/plugins/misc/taolf.lua +++ /dev/null @@ -1,13 +0,0 @@ -local M = { "ssnailed/taolf" } - -M.dev = false - -M.event = "VeryLazy" - -M.cmd = { "Lf" } - -M.dependencies = { "toggleterm.nvim" } - -M.config = true - -return M diff --git a/.config/nvim/lua/plugins/misc/telescope-fzf-native.lua b/.config/nvim/lua/plugins/misc/telescope-fzf-native.lua deleted file mode 100644 index 9b40ca3f4..000000000 --- a/.config/nvim/lua/plugins/misc/telescope-fzf-native.lua +++ /dev/null @@ -1,5 +0,0 @@ -local M = { "nvim-telescope/telescope-fzf-native.nvim" } - -M.build = "make" - -return M diff --git a/.config/nvim/lua/plugins/misc/telescope.lua b/.config/nvim/lua/plugins/misc/telescope.lua deleted file mode 100644 index 738bb6268..000000000 --- a/.config/nvim/lua/plugins/misc/telescope.lua +++ /dev/null @@ -1,35 +0,0 @@ -local M = { "nvim-telescope/telescope.nvim" } -local icons = require("config.icons") - -M.dependencies = { "telescope-fzf-native.nvim", "aerial.nvim" } - -M.cmd = "Telescope" - -M.opts = function() - return { - defaults = { - git_worktrees = vim.g.git_worktrees, - prompt_prefix = icons.Selected, - path_display = { "truncate" }, - sorting_startegy = "ascending", - layout_config = { - horizontal = { prompt_position = "top", preview_width = 0.7 }, - vertical = { mirror = false }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - }, - } -end - -M.config = function(_, opts) - local actions = require("telescope.actions") - opts.mappings = require("config.keymaps").telescope(actions) - local m = require("telescope") - m.setup(opts) - m.load_extension("aerial") - m.load_extension("fzf") -end - -return M diff --git a/.config/nvim/lua/plugins/misc/todo-comments.lua b/.config/nvim/lua/plugins/misc/todo-comments.lua deleted file mode 100644 index 8b49255e0..000000000 --- a/.config/nvim/lua/plugins/misc/todo-comments.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = { "folke/todo-comments.nvim" } -local icons = require("config.icons") - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - -M.opts = { - signs = false, - highlight = { - multiline = false, - }, - keywords = { - BUG = { icon = icons.Bug, color = "error", alt = { "FIXME", "FIX", "FIXIT", "ISSUE" } }, - TODO = { icon = icons.Task, color = "info" }, - HACK = { icon = icons.Flame, color = "warning" }, - WARN = { icon = icons.Warn, color = "warning", alt = { "WARNING", "XXX" } }, - PERF = { icon = icons.Speed, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, - NOTE = { icon = icons.Buffer, color = "hint", alt = { "INFO" } }, - TEST = { icon = icons.Test, color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/toggleterm.lua b/.config/nvim/lua/plugins/misc/toggleterm.lua deleted file mode 100644 index cdee562df..000000000 --- a/.config/nvim/lua/plugins/misc/toggleterm.lua +++ /dev/null @@ -1,42 +0,0 @@ -local M = { "akinsho/toggleterm.nvim" } - -M.cmd = { "ToggleTerm", "TermExec" } - -M.opts = { - size = function(term) - if term.direction == "horizontal" then - return vim.o.lines * 0.33 - elseif term.direction == "vertical" then - return vim.o.colums * 0.33 - end - end, - -- TODO: Move to config.keymaps - open_mapping = "", - direction = "float", - highlights = { - Normal = { link = "Normal" }, - NormalNC = { link = "NormalNC" }, - NormalFloat = { link = "NormalFloat" }, - FloatBorder = { link = "FloatBorder" }, - StatusLine = { link = "StatusLine" }, - StatusLineNC = { link = "StatusLineNC" }, - WinBar = { link = "WinBar" }, - WinBarNC = { link = "WinBarNC" }, - }, - float_opts = { - border = "curved", - -- winblend = 10, - width = function() - return math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 20))) - end, - height = function() - return math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 10))) - end, - }, - on_create = function() - vim.opt.foldcolumn = "0" - vim.opt.signcolumn = "no" - end, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/tokyonight.lua b/.config/nvim/lua/plugins/misc/tokyonight.lua deleted file mode 100644 index 689f2da3f..000000000 --- a/.config/nvim/lua/plugins/misc/tokyonight.lua +++ /dev/null @@ -1,18 +0,0 @@ -local M = { "folke/tokyonight.nvim" } - -M.priority = 1000 - -local opts = { - style = "night", - transparent = true, - on_highlights = function(hl, _) - hl.CurSearch = nil - end, -} - -M.config = function() - require("tokyonight").setup(opts) - vim.cmd("colorscheme tokyonight") -end - -return M diff --git a/.config/nvim/lua/plugins/misc/treesitter.lua b/.config/nvim/lua/plugins/misc/treesitter.lua deleted file mode 100644 index 8cf931afd..000000000 --- a/.config/nvim/lua/plugins/misc/treesitter.lua +++ /dev/null @@ -1,64 +0,0 @@ -local M = { "nvim-treesitter/nvim-treesitter" } - -M.build = ":TSUpdate" - -M.event = { "BufReadPost", "BufNewFile", "BufWritePre" } - --- M.cmd = { --- "TSBufDisable", --- "TSBufEnable", --- "TSBufToggle", --- "TSDisable", --- "TSEnable", --- "TSToggle", --- "TSInstall", --- "TSInstallInfo", --- "TSInstallSync", --- "TSModuleInfo", --- "TSUninstall", --- "TSUpdate", --- "TSUpdateSync", --- } - -M.init = function(plugin) - require("lazy.core.loader").add_to_rtp(plugin) - require("nvim-treesitter.query_predicates") - require("nvim-treesitter.install").setup_auto_install() -end - -local maps = require("config.keymaps").treesitter -M.opts = { - autotag = { enable = true }, - highlight = { - enable = true, - }, - -- HACK: this doesn't work for some reason, so I manually call it in M.init - -- auto_install = true, - autopairs = { - enable = false, - }, - incremental_selection = { enable = true }, - indent = { enable = true }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = maps.select, - }, - move = { - enable = true, - set_jumps = true, - goto_next_start = maps.move.goto_next_start, - goto_next_end = maps.move.goto_next_end, - goto_previous_start = maps.move.goto_previous_start, - goto_previous_end = maps.move.goto_previous_end, - }, - swap = { - enable = true, - swap_next = maps.swap.swap_next, - swap_previous = maps.swap.swap_previous, - }, - }, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/ufo.lua b/.config/nvim/lua/plugins/misc/ufo.lua deleted file mode 100644 index 3121f75d8..000000000 --- a/.config/nvim/lua/plugins/misc/ufo.lua +++ /dev/null @@ -1,34 +0,0 @@ -local M = { "kevinhwang91/nvim-ufo" } - -M.event = { "InsertEnter" } - -M.dependencies = { "kevinhwang91/promise-async", "nvim-treesitter" } - -M.opts = { - preview = { - mappings = require("config.keymaps").ufo, - }, - provider_selector = function(_, filetype, buftype) - local function handleFallbackException(bufnr, err, providerName) - if type(err) == "string" and err:match("UfoFallbackException") then - return require("ufo").getFolds(bufnr, providerName) - else - return require("promise").reject(err) - end - end - - return (filetype == "" or buftype == "nofile") and "indent" -- only use indent until a file is opened - or function(bufnr) - return require("ufo") - .getFolds(bufnr, "lsp") - :catch(function(err) - return handleFallbackException(bufnr, err, "treesitter") - end) - :catch(function(err) - return handleFallbackException(bufnr, err, "indent") - end) - end - end, -} - -return M diff --git a/.config/nvim/lua/plugins/misc/vimtex.lua b/.config/nvim/lua/plugins/misc/vimtex.lua deleted file mode 100644 index 190340f5e..000000000 --- a/.config/nvim/lua/plugins/misc/vimtex.lua +++ /dev/null @@ -1,11 +0,0 @@ -local M = { "lervag/vimtex" } - -M.init = function() - vim.g.vimtex_view_method = "zathura" - vim.g.tex_flavor = "latex" - vim.g.vimtex_quickfix_mode = 0 - vim.o.conceallevel = 1 - vim.g.tex_conceal = "abdmg" -end - -return M diff --git a/.config/nvim/lua/plugins/misc/which-key.lua b/.config/nvim/lua/plugins/misc/which-key.lua deleted file mode 100644 index 6e667cfe7..000000000 --- a/.config/nvim/lua/plugins/misc/which-key.lua +++ /dev/null @@ -1,37 +0,0 @@ -local M = { "folke/which-key.nvim" } - -local icons = require("config.icons") - -M.event = "VeryLazy" - -M.init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 -end - -M.opts = { - plugins = { - presets = { - operators = false, - motions = false, - }, - }, - icons = { - breadcrumb = icons.Selected, - separator = icons.Selected, - group = "", - }, - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, - triggers = "auto", - triggers_blacklist = { - i = { "j", "k", "v", "y" }, - v = { "j", "k", "y" }, - }, -} - -M.config = function(_, opts) - require("which-key").setup(opts) - require("funcs").which_key_register() -end - -return M diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua new file mode 100644 index 000000000..c90725925 --- /dev/null +++ b/.config/nvim/lua/plugins/ui.lua @@ -0,0 +1,38 @@ +return { + { + "folke/tokyonight.nvim", + lazy = true, + opts = { style = "night" }, + -- on_highlights = function(hl, _) + -- hl.CurSearch = nil + -- end + }, + { + "nvimdev/dashboard-nvim", + opts = function(_, opts) + local center = Custom.ui.buttons + local banners = Custom.ui.banners + for _, button in ipairs(center) do + button.desc = button.desc .. string.rep(" ", 43 - #button.desc) + button.key_format = " %s" + end + math.randomseed(os.time()) + local banner = "\n\n" .. banners[math.random(#banners)] .. "\n\n" + opts.config.header = vim.split(banner, "\n") + opts.config.center = center + opts.config.footer = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + return { "Behold: a Snail's Vim | " .. stats.count .. "  " .. ms .. "ms" } + end + end, + }, + { + "echasnovski/mini.indentscope", + opts = { + draw = { + animation = require("mini.indentscope").gen_animation.none(), + }, + }, + }, +} diff --git a/.config/nvim/spell/de.utf-8.add b/.config/nvim/spell/de.utf-8.add deleted file mode 100644 index 90c081b54..000000000 --- a/.config/nvim/spell/de.utf-8.add +++ /dev/null @@ -1,13 +0,0 @@ -Gentoo -Witzenrath -Kubernetes -Vallendor -basis -KVM -Qemu -Tralios -Libvirt -POSIX -Ansible -Hosting -Meilensteinplans diff --git a/.config/nvim/spell/en.utf-8.add b/.config/nvim/spell/en.utf-8.add deleted file mode 100644 index 9847dc717..000000000 --- a/.config/nvim/spell/en.utf-8.add +++ /dev/null @@ -1,12 +0,0 @@ -config -Neovim -ansible -traefik -yml -yaml -dir -blocksync -LV -proxmox -NVMe -blocksize diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml new file mode 100644 index 000000000..e55efd51f --- /dev/null +++ b/.config/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 4 +column_width = 120 diff --git a/.config/nvim/todo b/.config/nvim/todo deleted file mode 100644 index 4f841fc8b..000000000 --- a/.config/nvim/todo +++ /dev/null @@ -1,5 +0,0 @@ -Continue checking for old keymaps -Configure Todo Telescope integration etc. -Figure out why the theme breaks when you install a plugin -Indicate if various lsp toggles are active -map q to toggle the terminal in taolf