Update gitlinker, use custom router for gitea

This commit is contained in:
Andrew Tomaka 2024-09-20 21:45:33 -04:00
parent 4648495a42
commit 1f0b857f0f
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
3 changed files with 42 additions and 15 deletions

View file

@ -5,19 +5,42 @@ vim.keymap.set("n", "<Leader>bd", function()
end)
--- gitlinker.nvim
require"gitlinker".setup()
vim.keymap.set("n", "<Leader>gh", function()
require"gitlinker".get_buf_range_url(
"n",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end, { silent = true })
vim.keymap.set("v", "<leader>gh", function()
require"gitlinker".get_buf_range_url(
"v",
{ action_callback = require"gitlinker.actions".open_in_browser }
)
end)
require"gitlinker".setup({
router = {
browse = {
["^git%.atomaka%.com"] = "https://git.atomaka.com/"
.. "{_A.ORG}/"
.. "{_A.REPO}/commit/"
.. "{_A.REV}/"
},
blame = {
["^git%.atomaka%.com"] = "https://git.atomaka.com/"
.. "{_A.ORG}/"
.. "{_A.REPO}/blame/"
.. "branch/{_A.CURRENT_BRANCH}/"
.. "{_A.FILE}"
},
},
})
vim.keymap.set(
{"n", 'v'},
"<leader>gl",
function()
require("gitlinker").link({ action = require("gitlinker.actions").system })
end,
{ silent = true, noremap = true, desc = "GitLink!" }
)
vim.keymap.set(
{"n", 'v'},
"<leader>glb",
function()
require("gitlinker").link({
router_type = "blame",
action = require("gitlinker.actions").system,
})
end,
{ silent = true, noremap = true, desc = "GitLink! blame" }
)
--- gitsigns.nvim
require("gitsigns").setup()
@ -30,6 +53,10 @@ vim.g["git_messenger_always_into_popup"] = 1
require("nvim-surround").setup()
--- telescope.nvim
vim.api.nvim_set_keymap('n', '<leader>t', ':Telescope<CR>', {
noremap = true,
silent = true,
})
vim.keymap.set("n", "<C-p>", function()
require("telescope.builtin").find_files({
file_ignore_patterns = {".git/", "node_modules/"},

View file

@ -2,7 +2,7 @@
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
"editorconfig.nvim": { "branch": "master", "commit": "5b9e303e1d6f7abfe616ce4cc8d3fffc554790bf" },
"git-messenger.vim": { "branch": "master", "commit": "edc603d4cda7894a743e383e16c638e206d03148" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"gitlinker.nvim": { "branch": "master", "commit": "a221c13fc3c7f5b8799933f4966ee8e618287292" },
"gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" },
"gruvbox": { "branch": "master", "commit": "143a3b8babcfd2bce6c99d6ba496942647c3e30b" },
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },

View file

@ -21,7 +21,7 @@ require("lazy").setup({
-- "FabijanZulj/blame.nvim",
"rhysd/git-messenger.vim",
"lewis6991/gitsigns.nvim",
"ruifm/gitlinker.nvim",
"linrongbin16/gitlinker.nvim",
"tpope/vim-eunuch",
"gruvbox-community/gruvbox",