From 1e7e40ca1bc91892491be2ef668e0d01c22194e5 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 26 Jan 2024 20:06:07 +0200 Subject: [PATCH] refactor: remove vimwiki --- after/plugin/snips/markdown.lua | 21 ------ lazy-lock.json | 33 +++++----- lua/plugins/cmp.lua | 19 +++++- lua/plugins/cmp_git.lua | 109 +++++++++++++++++++++++++++++++ lua/plugins/codeium.lua | 2 +- lua/plugins/dap.lua | 2 +- lua/plugins/fugitive.lua | 8 +-- lua/plugins/gitsigns.lua | 1 + lua/plugins/harpoon.lua | 47 ++++++++----- lua/plugins/lsp/typst.lua | 12 ---- lua/plugins/lspconfig.lua | 109 ++++++++----------------------- lua/plugins/lualine.lua | 4 +- lua/plugins/markdown.lua | 87 ++++++++++++++++++++++++ lua/plugins/markdown_preview.lua | 5 +- lua/plugins/null_ls.lua | 3 - lua/plugins/oil.lua | 4 +- lua/plugins/rest.lua | 2 +- lua/plugins/rust_tools.lua | 1 - lua/plugins/surround.lua | 4 +- lua/plugins/tagbar.lua | 2 +- lua/plugins/telescope.lua | 29 +++----- lua/plugins/treesitter.lua | 4 +- lua/plugins/trouble.lua | 2 +- lua/plugins/typst.lua | 11 +++- lua/plugins/vimtex.lua | 1 + lua/plugins/vimwiki.lua | 14 ---- lua/plugins/which_key.lua | 3 +- lua/solo/init.lua | 2 - lua/solo/keymaps.lua | 14 ++-- lua/solo/typst.lua | 9 --- lua/solo/vimwiki.lua | 13 ---- 31 files changed, 338 insertions(+), 239 deletions(-) delete mode 100644 after/plugin/snips/markdown.lua create mode 100644 lua/plugins/cmp_git.lua delete mode 100644 lua/plugins/lsp/typst.lua create mode 100644 lua/plugins/markdown.lua delete mode 100644 lua/plugins/vimwiki.lua delete mode 100644 lua/solo/typst.lua delete mode 100644 lua/solo/vimwiki.lua diff --git a/after/plugin/snips/markdown.lua b/after/plugin/snips/markdown.lua deleted file mode 100644 index 5bfc286..0000000 --- a/after/plugin/snips/markdown.lua +++ /dev/null @@ -1,21 +0,0 @@ -if not pcall(require, "luasnip") then - return -end - -local ls = require("luasnip") - -local s = ls.snippet -local i = ls.insert_node -local t = ls.text_node -local c = ls.choice_node -local fmt = require("luasnip.extras.fmt").fmt - -ls.add_snippets({ "markdown", "vimwiki" }, { - s( - "t", - fmt("- [{}] {}", { - c(2, { t(" "), t("-"), t("x") }), - i(1, "task"), - }) - ), -}) diff --git a/lazy-lock.json b/lazy-lock.json index d8482be..11e7be9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,12 +6,15 @@ "cheatsheet.nvim": { "branch": "master", "commit": "53325f0c7bef73f875d798f2a951362f4f3f50bc" }, "clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" }, "cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" }, - "cmake-tools.nvim": { "branch": "master", "commit": "aba5b805082b3c1027ac4f5051b84c61989c34c8" }, + "cmake-tools.nvim": { "branch": "master", "commit": "b7554dd2aeb436012b852a3d30780c00a2f9f30b" }, "cmp-async-path": { "branch": "main", "commit": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-conventionalcommits": { "branch": "master", "commit": "a4dfacf0601130b7f8afa7c948d735c27802fb7f" }, "cmp-dotenv": { "branch": "main", "commit": "fd78929551010bc20602e7e663e42a5e14d76c96" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-git": { "branch": "main", "commit": "8d8993680d627c8f13bd85094eba84604107dbdd" }, "cmp-nerdfont": { "branch": "main", "commit": "a3b7c0cadb7bd389f513eecda376d4c6bec90003" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, @@ -20,37 +23,37 @@ "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf" }, "crates.nvim": { "branch": "main", "commit": "8437522d12a8c523da2aee9db2979d070b2ecc33" }, - "darkplus.nvim": { "branch": "master", "commit": "617cc122718e04bafe3e8e56e46900a9b3084970" }, - "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "darkplus.nvim": { "branch": "master", "commit": "1720335988b6b6db1eb375a5de825d50fa83c9b4" }, "dracula.nvim": { "branch": "main", "commit": "a6cb758d4b182d9f2b7e742910078d94877c1059" }, "friendly-snippets": { "branch": "main", "commit": "aced40b66b7bae9bc2c37fd7b11841d54727a7b0" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, - "gitsigns.nvim": { "branch": "main", "commit": "300a306da9973e81c2c06460f71fd7a079df1f36" }, + "gitsigns.nvim": { "branch": "main", "commit": "0a2a93f687ec051292943a4d139366332ac93688" }, "harpoon": { "branch": "harpoon2", "commit": "2cd4e03372f7ee5692c8caa220f479ea07970f17" }, "hypersonic.nvim": { "branch": "main", "commit": "a98dbd6b5ac1aac3cd895990e08d1ea40e67a9e3" }, "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "lazygit.nvim": { "branch": "main", "commit": "1e08e3f5ac1152339690140e61a4a32b3bdc7de5" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, - "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "markdown-togglecheck": { "branch": "main", "commit": "5e9ee3184109a102952c01ef816babe8835b299a" }, + "markdown.nvim": { "branch": "master", "commit": "c5cb265f8e997476925c165d660678048ec47f38" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "b9084b1f42f790d6230dc66dbcb6bcc35b148552" }, "mason-null-ls.nvim": { "branch": "main", "commit": "558de4372d23bd432cc3594666c4d812cd071bbf" }, - "mason.nvim": { "branch": "main", "commit": "9c9416817c9f4e6f333c749327a1ed5355cfab61" }, + "mason.nvim": { "branch": "main", "commit": "dcd0ea30ccfc7d47e879878d1270d6847a519181" }, "melange-nvim": { "branch": "master", "commit": "ca3444c8e5002ee5ab6f077660317f869c7b6a36" }, - "neodev.nvim": { "branch": "main", "commit": "e7ca4a2ea0da5e39a639c08c3edb352b9355f09e" }, + "neodev.nvim": { "branch": "main", "commit": "64b2a51b02c6f2ae177c745e4d8bc801a339fe09" }, "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" }, "neorg": { "branch": "main", "commit": "28cbafbc0cde316d8e2618ff26377200225e9393" }, "nightfly": { "branch": "master", "commit": "0c5f52d717c65951173455a70592f6383b3487e7" }, - "nightfox.nvim": { "branch": "main", "commit": "7e9487875dc5f69a2fd6f60d3a3ef4fb457b57c1" }, + "nightfox.nvim": { "branch": "main", "commit": "57b8154aba0de8ced36722ea2674a7b97e4f468f" }, "none-ls.nvim": { "branch": "main", "commit": "a311c7cc8f17543143a7482cdbe3a384c371d56a" }, - "nvim": { "branch": "main", "commit": "bc1f2151f23227ba02ac203c2c59ad693352a741" }, + "nvim": { "branch": "main", "commit": "afab7ec2a79c7127627dede79c0018b6e45663d0" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-lspconfig": { "branch": "master", "commit": "8917d2c830e04bf944a699b8c41f097621283828" }, - "nvim-surround": { "branch": "main", "commit": "0c02c52182a9c2a7fa7e122b4037f6408e98434a" }, - "nvim-treesitter": { "branch": "master", "commit": "1bee80469d3d1569de47a62dd59824d9f9af0866" }, + "nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" }, + "nvim-treesitter": { "branch": "master", "commit": "efda19a54a157da8635aa6cb84f56a10593b1a23" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "19a91a38b02c1c28c14e0ba468d20ae1423c39b2" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, @@ -78,6 +81,7 @@ "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, "tokyonight.nvim": { "branch": "main", "commit": "e3301873c1e96903daebb98cc9b5926810bf73dd" }, + "treesitter-utils": { "branch": "main", "commit": "0e1ac3ae9ae55a371f09aa1d7bbc757275567627" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, "typst.vim": { "branch": "main", "commit": "816ba15885cb5eb742e06bafcd53b1a8531d334b" }, @@ -86,13 +90,12 @@ "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, - "vim-dadbod-ui": { "branch": "master", "commit": "e99dcfd5162d9b9b4b24a5d035cf114315f1aeec" }, + "vim-dadbod-ui": { "branch": "master", "commit": "165699c573469e6a95b48d35052f848c340c5911" }, "vim-fugitive": { "branch": "master", "commit": "854a8df0d06b8d3fcb30fa7f2b08c62b553eee3b" }, - "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, + "vim-illuminate": { "branch": "master", "commit": "97c1265ff0b67064b6cfdc15bafc50202a537ae2" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, "vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, "vimtex": { "branch": "master", "commit": "fe20ab1bd82a23441ac55054afefcd60001947a2" }, - "vimwiki": { "branch": "dev", "commit": "d0e6d5e517120c85e25d5e32d60bbd26f7d82451" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" }, "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 932be57..ba88aa6 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,9 +1,9 @@ return { "hrsh7th/nvim-cmp", event = { "InsertEnter", "CmdlineEnter" }, - lazy = false, dependencies = { "hrsh7th/cmp-buffer", -- buffer completions + "hrsh7th/cmp-cmdline", "FelipeLema/cmp-async-path", -- path completionsplu "hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-nvim-lsp", @@ -22,6 +22,8 @@ return { { "zbirenbaum/copilot-cmp", opts = {}, dependencies = { "zbirenbaum/copilot.lua" } }, "Exafunction/codeium.nvim", "chrisgrieser/cmp-nerdfont", + "petertriho/cmp-git", + "davidsierradz/cmp-conventionalcommits", }, config = function() local cmp = require("cmp") @@ -77,7 +79,7 @@ return { { name = "crates" }, { name = "async_path" }, { name = "luasnip" }, - { name = "buffer" }, + { name = "buffer", keyword_length = 4 }, { name = "neorg" }, { name = "pypi" }, { name = "dadbod" }, @@ -87,6 +89,8 @@ return { { name = "copilot" }, { name = "codeium" }, { name = "nerdfont" }, + { name = "git" }, + { name = "conventionalcommits" }, }, snippet = { expand = function(args) @@ -98,15 +102,17 @@ return { format = function(entry, vim_item) vim_item.kind = kind_icons[vim_item.kind] vim_item.menu = ({ + git = "[git]", + conventionalcommits = "[CC]", calc = "[calc]", emoji = "[emoji]", nerdfont = "[nerdfont]", nvim_lsp = "[LSP]", nvim_lua = "[lua]", + async_path = "[path]", copilot = "[copilot]", codeium = "[codeium]", luasnip = "[snip]", - async_path = "[path]", neorg = "[neorg]", crates = "[crates]", pypi = "[pypi]", @@ -131,5 +137,12 @@ return { select = false, }, }) + + cmp.setup.cmdline("/", { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) end, } diff --git a/lua/plugins/cmp_git.lua b/lua/plugins/cmp_git.lua new file mode 100644 index 0000000..6bdfbdd --- /dev/null +++ b/lua/plugins/cmp_git.lua @@ -0,0 +1,109 @@ +return { + "petertriho/cmp-git", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local format = require("cmp_git.format") + local sort = require("cmp_git.sort") + + require("cmp_git").setup({ + -- defaults + filetypes = { "gitcommit", "octo" }, + remotes = { "upstream", "origin" }, -- in order of most to least prioritized + enableRemoteUrlRewrites = false, -- enable git url rewrites, see https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf + git = { + commits = { + limit = 100, + sort_by = sort.git.commits, + format = format.git.commits, + }, + }, + github = { + hosts = {}, -- list of private instances of github + issues = { + fields = { "title", "number", "body", "updatedAt", "state" }, + filter = "all", -- assigned, created, mentioned, subscribed, all, repos + limit = 100, + state = "open", -- open, closed, all + sort_by = sort.github.issues, + format = format.github.issues, + }, + mentions = { + limit = 100, + sort_by = sort.github.mentions, + format = format.github.mentions, + }, + pull_requests = { + fields = { "title", "number", "body", "updatedAt", "state" }, + limit = 100, + state = "open", -- open, closed, merged, all + sort_by = sort.github.pull_requests, + format = format.github.pull_requests, + }, + }, + gitlab = { + hosts = {}, -- list of private instances of gitlab + issues = { + limit = 100, + state = "opened", -- opened, closed, all + sort_by = sort.gitlab.issues, + format = format.gitlab.issues, + }, + mentions = { + limit = 100, + sort_by = sort.gitlab.mentions, + format = format.gitlab.mentions, + }, + merge_requests = { + limit = 100, + state = "opened", -- opened, closed, locked, merged + sort_by = sort.gitlab.merge_requests, + format = format.gitlab.merge_requests, + }, + }, + trigger_actions = { + { + debug_name = "git_commits", + trigger_character = ":", + action = function(sources, trigger_char, callback, params, git_info) + return sources.git:get_commits(callback, params, trigger_char) + end, + }, + { + debug_name = "gitlab_issues", + trigger_character = "#", + action = function(sources, trigger_char, callback, params, git_info) + return sources.gitlab:get_issues(callback, git_info, trigger_char) + end, + }, + { + debug_name = "gitlab_mentions", + trigger_character = "@", + action = function(sources, trigger_char, callback, params, git_info) + return sources.gitlab:get_mentions(callback, git_info, trigger_char) + end, + }, + { + debug_name = "gitlab_mrs", + trigger_character = "!", + action = function(sources, trigger_char, callback, params, git_info) + return sources.gitlab:get_merge_requests(callback, git_info, trigger_char) + end, + }, + { + debug_name = "github_issues_and_pr", + trigger_character = "#", + action = function(sources, trigger_char, callback, params, git_info) + return sources.github:get_issues_and_prs(callback, git_info, trigger_char) + end, + }, + { + debug_name = "github_mentions", + trigger_character = "@", + action = function(sources, trigger_char, callback, params, git_info) + return sources.github:get_mentions(callback, git_info, trigger_char) + end, + }, + }, + }) + end, +} diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua index e4ded71..e09f537 100644 --- a/lua/plugins/codeium.lua +++ b/lua/plugins/codeium.lua @@ -1,6 +1,6 @@ return { "Exafunction/codeium.nvim", - cond = false, + enabled = false, dependencies = { "nvim-lua/plenary.nvim" }, opts = {}, } diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index b24e3e0..9b14664 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -1,6 +1,6 @@ return { "jayp0521/mason-nvim-dap.nvim", - cond = false, + enabled = false, opts = { ensure_installed = { "python", diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index ad27ca5..4627050 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,10 +1,8 @@ return { "tpope/vim-fugitive", + lazy = false, keys = { - { - "gg", - vim.cmd.Git, - desc = "Git", - }, + { "gg", vim.cmd.G, desc = "[G]it" }, + { "gd", vim.cmd.Gdiffsplit, desc = "[G]it [D]iff" }, }, } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index b6f31cd..c855f1f 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,5 +1,6 @@ return { "lewis6991/gitsigns.nvim", + lazy = false, keys = { { "gb", diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index f1643ae..52e82a5 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -11,29 +11,44 @@ return { desc = "Harpoon [A]dd File", }, { - "", + "", function() local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end, desc = "Toggle Harpoon Menu", }, + { + "", + function() + require("harpoon"):list():select(1) + end, + desc = "Harpoon [1]", + }, + { + "", + function() + require("harpoon"):list():select(2) + end, + desc = "Harpoon [2]", + }, + { + "", + function() + require("harpoon"):list():select(3) + end, + desc = "Harpoon [3]", + }, + { + "", + function() + require("harpoon"):list():select(4) + end, + desc = "Harpoon [4]", + }, }, - config = function() - local harpoon = require("harpoon") - harpoon:setup() - vim.keymap.set("n", "", function() - harpoon:list():select(1) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(2) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(3) - end) - vim.keymap.set("n", "", function() - harpoon:list():select(4) - end) + config = function() + require("harpoon"):setup() end, } diff --git a/lua/plugins/lsp/typst.lua b/lua/plugins/lsp/typst.lua deleted file mode 100644 index 1374ea5..0000000 --- a/lua/plugins/lsp/typst.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - -M.setup = function(lsp, capabilities) - lsp.lua_ls.setup({ - capabilities = capabilities, - settings = { - exportPdf = "onSave", - }, - }) -end - -return M diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index ee93f9e..9f7dd91 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -7,77 +7,7 @@ return { "folke/neodev.nvim", "nvim-telescope/telescope.nvim", }, - keys = { - { - "la", - vim.lsp.buf.code_action, - desc = "Code [A]ction", - }, - { - "lD", - vim.lsp.buf.type_definition, - desc = "Type [D]efinitions", - }, - { - "lf", - function() - vim.lsp.buf.format({ async = true }) - end, - desc = "[F]ormat", - }, - { - "lo", - vim.diagnostic.open_float, - desc = "[O]pen Float", - }, - { - "ls", - vim.diagnostic.setloclist, - desc = "[S]etloclist", - }, - { - "lr", - vim.lsp.buf.rename, - desc = "[R]ename", - }, - { - "lds", - require("telescope.builtin").lsp_document_symbols, - desc = "[D]ocument [S]ymbols", - }, - { - "lwd", - require("telescope.builtin").diagnostics, - desc = "[W]orkspace [D]iagnostics", - }, - { - "lws", - require("telescope.builtin").lsp_dynamic_workspace_symbols, - desc = "[W]orkspace [S]ymbols", - }, - { - "lwa", - vim.lsp.buf.add_workspace_folder, - desc = "[W]orkspace [A]dd Folder", - }, - { - "lwr", - vim.lsp.buf.remove_workspace_folder, - desc = "[W]orkspace [R]emove Folder", - }, - { - "lwl", - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, - desc = "[W]orkspace [L]ist Folder", - }, - { - "lq", - require("telescope.builtin").quickfix, - desc = "Telescope [Q]uickfix", - }, - }, + config = function() require("mason").setup() local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() @@ -102,20 +32,36 @@ return { vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc }) end + nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition") + nmap("K", vim.lsp.buf.hover, "Hover Documentation") + nmap("gi", vim.lsp.buf.implementation, "[G]oto [I]mplementation") + vim.keymap.set( + "i", + "", + vim.lsp.buf.signature_help, + { buffer = event.buf, desc = "Signature Documentation" } + ) + nmap("wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder") + nmap("wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder") + nmap("wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, "[W]orkspace [L]ist Folders") + nmap("lD", vim.lsp.buf.type_definition, "Type [D]efinition") + nmap("lr", vim.lsp.buf.rename, "[R]ename") + vim.keymap.set( + { "n", "v" }, + "la", + vim.lsp.buf.code_action, + { buffer = event.buf, desc = "Code [A]ction" } + ) nmap("gr", function() require("trouble").toggle("lsp_references") end, "[G]oto [R]eferences") nmap("gR", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") - nmap("gI", vim.lsp.buf.implementation, "[G]oto [I]mplementation") - nmap("K", vim.lsp.buf.hover, "Hover Documentation") - vim.keymap.set( - "i", - "", - vim.lsp.buf.signature_help, - { buffer = event.buf, desc = "Signature Documentation" } - ) - nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") + nmap("f", function() + vim.lsp.buf.format({ async = true }) + end, "[F]ormat") end, }) @@ -198,9 +144,6 @@ return { texlab = function() require("plugins.lsp.tex").setup(lsp, lsp_capabilities) end, - typst_lsp = function() - require("plugins.lsp.typst").setup(lsp, lsp_capabilities) - end, lua_ls = function() require("plugins.lsp.lua").setup(lsp, lsp_capabilities) end, diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 6111acb..a5324f5 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,6 +1,7 @@ return { "nvim-lualine/lualine.nvim", dependencies = { + "nvim-tree/nvim-web-devicons", "arkav/lualine-lsp-progress", }, opts = { @@ -27,11 +28,12 @@ return { `windows` (shows currently available windows) ]] sections = { lualine_a = { "mode" }, - lualine_b = { "branch" }, + lualine_b = { "branch", "diff" }, lualine_c = { "filename", "diff", "lsp_progress" }, lualine_x = { "diagnostics", "encoding", "filetype", "filesize" }, lualine_y = { "progress" }, lualine_z = { "location" }, }, + extentions = { "fzf", "fugitive", "lazy", "mason", "man", "oil", "nvim-dap-ui", "trouble" }, }, } diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua new file mode 100644 index 0000000..a207942 --- /dev/null +++ b/lua/plugins/markdown.lua @@ -0,0 +1,87 @@ +return { + { + "nfrid/markdown-togglecheck", + dependencies = { "nfrid/treesitter-utils" }, + ft = { "markdown" }, + keys = { + { + "", + function() + require("markdown-togglecheck").toggle() + end, + desc = "Toggle Checkmark", + }, + }, + opts = { + -- create empty checkbox on item without any while toggling + create = true, + -- remove checked checkbox instead of unckecking it while toggling + remove = false, + }, + }, + { + "tadmccorkle/markdown.nvim", + ft = { "markdown" }, + opts = { + -- Disable all keymaps by setting mappings field to 'false'. + -- Selectively disable keymaps by setting corresponding field to 'false'. + mappings = { + inline_surround_toggle = "gs", -- (string|boolean) toggle inline style + inline_surround_toggle_line = "gss", -- (string|boolean) line-wise toggle inline style + inline_surround_delete = "ds", -- (string|boolean) delete emphasis surrounding cursor + inline_surround_change = "cs", -- (string|boolean) change emphasis surrounding cursor + link_add = "gl", -- (string|boolean) add link + link_follow = "gx", -- (string|boolean) follow link + go_curr_heading = "]c", -- (string|boolean) set cursor to current section heading + go_parent_heading = "]p", -- (string|boolean) set cursor to parent section heading + go_next_heading = "]]", -- (string|boolean) set cursor to next section heading + go_prev_heading = "[[", -- (string|boolean) set cursor to previous section heading + }, + inline_surround = { + -- For the emphasis, strong, strikethrough, and code fields: + -- * 'key': used to specify an inline style in toggle, delete, and change operations + -- * 'txt': text inserted when toggling or changing to the corresponding inline style + emphasis = { + key = "i", + txt = "*", + }, + strong = { + key = "b", + txt = "**", + }, + strikethrough = { + key = "s", + txt = "~~", + }, + code = { + key = "c", + txt = "`", + }, + }, + link = { + paste = { + enable = true, -- whether to convert URLs to links on paste + }, + }, + toc = { + -- Comment text to flag headings/sections for omission in table of contents. + omit_heading = "toc omit heading", + omit_section = "toc omit section", + -- Cycling list markers to use in table of contents. + -- Use '.' and ')' for ordered lists. + markers = { "-" }, + }, + -- Hook functions allow for overriding or extending default behavior. + -- Called with a table of options and a fallback function with default behavior. + -- Signature: fun(opts: table, fallback: fun()) + hooks = { + -- Called when following links. Provided the following options: + -- * 'dest' (string): the link destination + -- * 'use_default_app' (boolean|nil): whether to open the destination with default application + -- (refer to documentation on mappings for explanation of when this option is used) + follow_link = nil, + }, + on_attach = nil, -- (fun(bufnr: integer)) callback when plugin attaches to a buffer + }, + }, +} diff --git a/lua/plugins/markdown_preview.lua b/lua/plugins/markdown_preview.lua index 7cbf8b6..47212f8 100644 --- a/lua/plugins/markdown_preview.lua +++ b/lua/plugins/markdown_preview.lua @@ -1,8 +1,9 @@ return { "iamcco/markdown-preview.nvim", - ft = { "markdown", "vimwiki" }, + ft = { "markdown" }, + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, build = "cd app && yarn install", init = function() - vim.g.mkdp_filetypes = { "markdown", "vimwiki" } + vim.g.mkdp_filetypes = { "markdown" } end, } diff --git a/lua/plugins/null_ls.lua b/lua/plugins/null_ls.lua index 369c9f2..8b1c6a7 100644 --- a/lua/plugins/null_ls.lua +++ b/lua/plugins/null_ls.lua @@ -33,8 +33,6 @@ return { "strict", }, }), - -- formatting.markdownlint.with({ extra_filetypes = { "vimwiki" }, }), - formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }), -- formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), -- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), -- formatting.sqlfluff.with({ extra_args = { "--dialect", "postgres" } }), @@ -50,7 +48,6 @@ return { "djlint", "google_java_format", "luacheck", - "markdown_toc", "mypy", "stylua", "yamlfmt", diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 1eb92b3..31b84b3 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -59,9 +59,9 @@ return { ["v"] = "actions.select_vsplit", ["s"] = "actions.select_split", ["t"] = "actions.select_tab", - ["p"] = "actions.preview", + [""] = "actions.preview", [""] = "actions.close", - ["q"] = "actions.close", + [""] = "actions.close", [""] = "actions.refresh", ["Y"] = "actions.copy_entry_path", ["-"] = "actions.parent", diff --git a/lua/plugins/rest.lua b/lua/plugins/rest.lua index 6f204cb..5d9fab7 100644 --- a/lua/plugins/rest.lua +++ b/lua/plugins/rest.lua @@ -1,6 +1,6 @@ return { "rest-nvim/rest.nvim", - cond = false, + enabled = false, dependencies = { "nvim-lua/plenary.nvim" }, opts = { -- Open request results in a horizontal split diff --git a/lua/plugins/rust_tools.lua b/lua/plugins/rust_tools.lua index 04caf3a..db00044 100644 --- a/lua/plugins/rust_tools.lua +++ b/lua/plugins/rust_tools.lua @@ -1,6 +1,5 @@ return { "simrat39/rust-tools.nvim", - cond = false, dependencies = { "neovim/nvim-lspconfig" }, ft = "rust", keys = { diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua index 10800f3..42177d2 100644 --- a/lua/plugins/surround.lua +++ b/lua/plugins/surround.lua @@ -2,5 +2,7 @@ return { "kylechui/nvim-surround", version = "*", -- Use for stability; omit to use `main` branch for the latest features event = "VeryLazy", - opts = {}, + config = function() + require("nvim-surround").setup({}) + end, } diff --git a/lua/plugins/tagbar.lua b/lua/plugins/tagbar.lua index 3dabea8..93359f5 100644 --- a/lua/plugins/tagbar.lua +++ b/lua/plugins/tagbar.lua @@ -1,6 +1,6 @@ return { "preservim/tagbar", keys = { - { "t", vim.cmd.TagbarToggle, desc = "Toggle [T]agbar" }, + { "b", vim.cmd.TagbarToggle, desc = "Toggle [T]agbar" }, }, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 04ef910..07c0d64 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -20,7 +20,7 @@ return { }, keys = { { - "", + "", function() require("telescope.builtin").git_files(require("telescope.themes").get_dropdown({ previewer = false })) end, @@ -42,21 +42,9 @@ return { end, desc = "Current Buffer Fuzzy", }, - { - "ps", - require("telescope.builtin").live_grep, - desc = "Live Grep", - }, - { - "pb", - require("telescope.builtin").buffers, - desc = "Find [B]uffers", - }, - { - "pws", - require("telescope.builtin").grep_string, - desc = "[S]tring under the cursor", - }, + { "ps", require("telescope.builtin").live_grep, desc = "Live Grep" }, + { "pb", require("telescope.builtin").buffers, desc = "Find [B]uffers" }, + { "pws", require("telescope.builtin").grep_string, desc = "[S]tring under the cursor" }, { "pe", require("telescope.builtin").symbols, desc = "[E]moji" }, { "pd", require("telescope.builtin").diagnostic, desc = "[D]iagnostics" }, { "pB", require("telescope.builtin").git_branches, desc = "Checkout [B]ranch" }, @@ -64,8 +52,7 @@ return { { "pM", require("telescope.builtin").man_pages, desc = "[M]an Pages" }, { "pr", require("telescope.builtin").oldfiles, desc = "Open [R]ecent Files" }, { "pR", require("telescope.builtin").registers, desc = "[R]egisters" }, - { "pg", require("telescope.builtin").live_grep, desc = "[G]rep" }, - { "pG", require("telescope.builtin").git_files, desc = "[G]it Files" }, + { "pg", require("telescope.builtin").git_files, desc = "[G]it Files" }, { "pk", require("telescope.builtin").keymaps, desc = "[K]eymaps" }, { "pC", require("telescope.builtin").commands, desc = "[C]ommands" }, { "pt", vim.cmd.TodoTelescope, desc = "[T]odo" }, @@ -105,12 +92,12 @@ return { desc = "[H]eading", }, { - "pDs", + "pds", "Telescope software-licenses find", desc = "[S]oftware Licenses", }, { - "pDh", + "pdh", function() require("telescope").extensions.http.list() end, @@ -131,7 +118,7 @@ return { desc = "[G]it Create [N]ew Worktree", }, { - "gd", + "gD", function() require("telescope").extensions.git_diffs.diff_commits() end, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ead95af..5582662 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -26,7 +26,7 @@ return { ) require("nvim-treesitter.configs").setup({ -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "cpp", "lua", "rust", "python", "markdown", "json", "http" }, -- one of "all" or a list of languages + ensure_installed = { "cpp", "lua", "rust", "python", "markdown", "json", "http", "markdown_inline" }, -- one of "all" or a list of languages -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, -- Automatically install missing parsers when entering buffer @@ -127,7 +127,7 @@ return { selection_modes = { ["@parameter.outer"] = "v", -- charwise ["@function.outer"] = "V", -- linewise - ["@class.outer"] = "", -- blockwise + ["@class.outer"] = "", -- blockwise }, -- If you set this to `true` (default is `false`) then any textobject is -- extended to include preceding or succeeding whitespace. Succeeding diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 1619f35..d11e616 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -3,7 +3,7 @@ return { dependencies = { "nvim-tree/nvim-web-devicons" }, keys = { { - "tx", + "tt", function() require("trouble").toggle() end, diff --git a/lua/plugins/typst.lua b/lua/plugins/typst.lua index 0919524..6c313e1 100644 --- a/lua/plugins/typst.lua +++ b/lua/plugins/typst.lua @@ -1,5 +1,14 @@ return { "kaarmu/typst.vim", ft = "typst", - lazy = false, + config = function() + vim.g.typst_cmd = "typst" -- Specifies the location of the Typst executable. Default: 'typst' + vim.g.typst_pdf_viewer = "zathura" -- Specifies pdf viewer that typst watch --open will use. Default: '' + vim.g.typst_conceal = 0 -- Enable concealment. Default: 0 + vim.g.typst_conceal_math = vim.g.typst_conceal -- Enable concealment for math symbols in math mode (i.e. replaces symbols with their actual unicode character). Default: g:typst_conceal + vim.g.typst_conceal_emoji = vim.g.typst_conceal -- Enable concealing emojis, e.g. #emoji.alien becomes 👽. Default: g:typst_conceal + vim.g.typst_auto_close_toc = 0 -- Specifies whether TOC will be automatically closed after using it. Default: 0 + vim.g.typst_auto_open_quickfix = 1 -- Specifies whether the quickfix list should automatically open when there are errors from typst. Default: 1 + vim.g.typst_embedded_languages = { "python", "rust", "c", "cpp" } -- A list of languages that will be highlighted in code blocks. Typst is always highlighted. Default: [] + end, } diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua index 361e8c4..7b58e32 100644 --- a/lua/plugins/vimtex.lua +++ b/lua/plugins/vimtex.lua @@ -1,5 +1,6 @@ return { "lervag/vimtex", + ft = "tex", keys = { { "Tb", vim.cmd.VimtexCompile, desc = "[B]uild" }, { "Tv", vim.cmd.VimtexView, desc = "[V]iew" }, diff --git a/lua/plugins/vimwiki.lua b/lua/plugins/vimwiki.lua deleted file mode 100644 index 8f0c5d6..0000000 --- a/lua/plugins/vimwiki.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "vimwiki/vimwiki", - --[[ keys = { - { "ww", vim.cmd.VimwikiIndex, desc = "Open index file" }, - { "wt", vim.cmd.VimwikiTabIndex, desc = "Open Index File in New [T]ab" }, - { "ws", vim.cmd.VimwikiUISelect, desc = "Display List of Wikis" }, - { "wi", vim.cmd.VimwikiDiaryIndex, desc = "Open Diary Index" }, - { "wh", vim.cmd.Vimwiki2HTML, desc = "Convert File to HTML" }, - { "wH", vim.cmd.Vimwiki2HTMLBrowse, desc = "Convert File to HTML and open in Browser" }, - { "wn", vim.cmd.VimwikiGoto, desc = "Goto link provided by an argument" }, - { "wd", vim.cmd.VimwikiDeleteFile, desc = "Rename file" }, - { "wr", vim.cmd.VimwikiRenameFile, desc = "Delete file" }, - }, ]] -} diff --git a/lua/plugins/which_key.lua b/lua/plugins/which_key.lua index a9b4ce1..97546fa 100644 --- a/lua/plugins/which_key.lua +++ b/lua/plugins/which_key.lua @@ -1,5 +1,6 @@ return { "folke/which-key.nvim", + event = "VeryLazy", init = function() vim.o.timeout = true vim.o.timeoutlen = 300 @@ -41,7 +42,7 @@ return { l = { name = "[L]SP" }, p = { name = "Telescope", - D = { name = "[D]evelopment" }, + d = { name = "[D]evelopment" }, }, z = { name = "[Z]en" }, r = { name = "[R]ust" }, diff --git a/lua/solo/init.lua b/lua/solo/init.lua index ce71dc3..8d9d7d6 100644 --- a/lua/solo/init.lua +++ b/lua/solo/init.lua @@ -1,7 +1,5 @@ require("solo.keymaps") require("solo.options") -require("solo.vimwiki") -require("solo.typst") require("solo.lazy") require("solo.autocmds") require("solo.cmds") diff --git a/lua/solo/keymaps.lua b/lua/solo/keymaps.lua index dbdc623..22d601e 100644 --- a/lua/solo/keymaps.lua +++ b/lua/solo/keymaps.lua @@ -20,6 +20,10 @@ nmap("", "zz") nmap("", "zz") nmap("n", "nzzzv") nmap("N", "Nzzzv") +nmap("*", "*zz") +nmap("#", "#zz") +nmap("g*", "g*zz") +nmap("g#", "g#zz") -- nmap("'", ":normal! zz") vim.keymap.set({ "n" }, "j", "gj", { desc = "Allows to navigate though wrapped lines", noremap = true }) @@ -67,9 +71,7 @@ vmap("<", "", ":m '<-2gv=gv", "Move lines up") vmap("", ":m '>+1gv=gv", "Move lines down") --- nmap("-", vim.cmd.Oil, "Open parent directory") - --- tmap("t", "", "h") --- tmap("t", "", "j") --- tmap("t", "", "k") --- tmap("t", "", "l") +tmap("t", "", "h") +tmap("t", "", "j") +tmap("t", "", "k") +tmap("t", "", "l") diff --git a/lua/solo/typst.lua b/lua/solo/typst.lua deleted file mode 100644 index df80b83..0000000 --- a/lua/solo/typst.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.g.typst_cmd = "typst" -- Specifies the location of the Typst executable. Default: 'typst' -vim.g.typst_pdf_viewer = "zathura" -- Specifies pdf viewer that typst watch --open will use. Default: '' -vim.g.typst_conceal = 0 -- Enable concealment. Default: 0 -vim.g.typst_conceal_math = vim.g.typst_conceal -- Enable concealment for math symbols in math mode (i.e. replaces symbols with their actual unicode character). --- OBS: this can affect performance, see issue #64. Default: g:typst_conceal -vim.g.typst_conceal_emoji = vim.g.typst_conceal -- Enable concealing emojis, e.g. #emoji.alien becomes 👽. Default: g:typst_conceal -vim.g.typst_auto_close_toc = 0 -- Specifies whether TOC will be automatically closed after using it. Default: 0 -vim.g.typst_auto_open_quickfix = 1 -- Specifies whether the quickfix list should automatically open when there are errors from typst. Default: 1 -vim.g.typst_embedded_languages = { "python", "rust", "c", "cpp" } -- A list of languages that will be highlighted in code blocks. Typst is always highlighted. Default: [] diff --git a/lua/solo/vimwiki.lua b/lua/solo/vimwiki.lua deleted file mode 100644 index 2e56a68..0000000 --- a/lua/solo/vimwiki.lua +++ /dev/null @@ -1,13 +0,0 @@ -vim.g.vimwiki_list = { - { - path = "~/vimwiki", - syntax = "markdown", - ext = ".md", - }, -} -vim.g.vimwiki_ext2syntax = { - [".md"] = "markdown", - [".markdown"] = "markdown", - [".mdown"] = "markdown", -} -vim.g.vimwiki_global_ext = 1