From 76755437cbd053983012a0d6967146941f9540bb Mon Sep 17 00:00:00 2001 From: shepherdwind Date: Fri, 12 Apr 2024 18:09:10 +0800 Subject: [PATCH] feat: add git blame and add telescope key map --- lazy-lock.json | 2 ++ lua/config/lazy.lua | 2 +- lua/plugins/git-blame.lua | 11 +++++++++++ lua/plugins/telescope.lua | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/git-blame.lua create mode 100644 lua/plugins/telescope.lua diff --git a/lazy-lock.json b/lazy-lock.json index c068342..960c5b7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -12,7 +12,9 @@ "dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" }, "dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "git-blame.nvim": { "branch": "master", "commit": "a0282d05adbee80aaf4e2ff35b81b52940b67bed" }, "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 13d9be0..f572c07 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -16,7 +16,7 @@ require("lazy").setup({ -- { import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "lazyvim.plugins.extras.lang.typescript" }, { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + { import = "lazyvim.plugins.extras.editor.harpoon2" }, -- import/override with your plugins { import = "plugins" }, }, diff --git a/lua/plugins/git-blame.lua b/lua/plugins/git-blame.lua new file mode 100644 index 0000000..6d431e6 --- /dev/null +++ b/lua/plugins/git-blame.lua @@ -0,0 +1,11 @@ +return { + "f-person/git-blame.nvim", + keys = { + { "gb", "GitBlameToggle", "Git Blame Toggle" }, + }, + opts = function() + require("gitblame").setup({ + enabled = false, + }) + end, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..0eb9827 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,14 @@ +return { + "nvim-telescope/telescope.nvim", + opts = function(_, opts) + local actions = require("telescope.actions") + opts.defaults = { + mappings = { + i = { + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.send_to_loclist + actions.open_loclist, + }, + }, + } + end, +}