2023-10-01 23:39:11 +00:00
|
|
|
-- You can add your own plugins here or in other files in this directory!
|
|
|
|
-- I promise not to create any merge conflicts in this directory :)
|
|
|
|
--
|
|
|
|
-- See the kickstart.nvim README for more information
|
|
|
|
return {
|
|
|
|
{
|
|
|
|
'joaodubas/gitlinker.nvim',
|
2024-03-28 00:18:20 +00:00
|
|
|
config = function()
|
|
|
|
local actions = require 'gitlinker.actions'
|
|
|
|
local hosts = require 'gitlinker.hosts'
|
|
|
|
require('gitlinker').setup {
|
2023-10-01 23:39:11 +00:00
|
|
|
opts = {
|
2024-03-28 00:18:20 +00:00
|
|
|
remote = 'origin',
|
2023-10-01 23:39:11 +00:00
|
|
|
add_current_line_on_normal_mode = true,
|
|
|
|
action_callback = actions.copy_to_clipboard,
|
|
|
|
print_url = true,
|
|
|
|
},
|
|
|
|
callbacks = {
|
2024-03-28 00:18:20 +00:00
|
|
|
['github.com'] = hosts.get_github_type_url,
|
|
|
|
['bitbucket.org'] = hosts.get_bitbucket_type_url,
|
|
|
|
['gitea.dubas.dev'] = hosts.get_gitea_type_url,
|
2023-10-01 23:39:11 +00:00
|
|
|
},
|
2024-03-28 00:18:20 +00:00
|
|
|
mappings = '<leader>gy',
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NeogitOrg/neogit',
|
|
|
|
dependencies = {
|
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
'sindrets/diffview.nvim',
|
|
|
|
'nvim-telescope/telescope.nvim',
|
|
|
|
},
|
|
|
|
opts = {
|
|
|
|
git_services = {
|
|
|
|
['gitea.dubas.dev'] = 'https://gitea.dubas.dev/${owner}/${repository}/compare/${branch_name}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
keys = {
|
|
|
|
{ '<leader>gs', '<cmd>Neogit<cr>', desc = 'Git status' },
|
|
|
|
},
|
2023-10-01 23:39:11 +00:00
|
|
|
},
|
2024-02-01 12:51:41 +00:00
|
|
|
'nvim-treesitter/nvim-treesitter-context',
|
|
|
|
{
|
|
|
|
'kevinhwang91/nvim-ufo',
|
|
|
|
dependencies = { 'kevinhwang91/promise-async' },
|
|
|
|
event = 'BufRead',
|
2024-03-28 00:18:20 +00:00
|
|
|
keys = function()
|
|
|
|
local ufo = require 'ufo'
|
2024-02-01 12:51:41 +00:00
|
|
|
return {
|
2024-03-28 00:18:20 +00:00
|
|
|
{ 'zR', ufo.openAllFolds, { desc = 'Open all folds' } },
|
|
|
|
{ 'zM', ufo.closeAllFolds, { desc = 'Close all folds' } },
|
|
|
|
{ 'zr', ufo.openFoldsExceptKinds, { desc = 'Open fold' } },
|
|
|
|
{ 'zm', ufo.closeFoldsWith, { desc = 'Close fold' } },
|
2024-02-01 12:51:41 +00:00
|
|
|
}
|
|
|
|
end,
|
2024-03-28 00:18:20 +00:00
|
|
|
opts = function()
|
|
|
|
local handler = function(virtText, lnum, endLnum, width, truncate)
|
2024-02-01 12:51:41 +00:00
|
|
|
local newVirtText = {}
|
|
|
|
local suffix = (' %d '):format(endLnum - lnum)
|
|
|
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
|
|
|
local targetWidth = width - sufWidth
|
|
|
|
local curWidth = 0
|
|
|
|
for _, chunk in ipairs(virtText) do
|
|
|
|
local chunkText = chunk[1]
|
|
|
|
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
|
|
if targetWidth > curWidth + chunkWidth then
|
|
|
|
table.insert(newVirtText, chunk)
|
|
|
|
else
|
|
|
|
chunkText = truncate(chunkText, targetWidth - curWidth)
|
|
|
|
local hlGroup = chunk[2]
|
2024-03-28 00:18:20 +00:00
|
|
|
table.insert(newVirtText, { chunkText, hlGroup })
|
2024-02-01 12:51:41 +00:00
|
|
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
|
|
-- str width returned from truncate() may less than 2nd argument, need padding
|
|
|
|
if curWidth + chunkWidth < targetWidth then
|
2024-03-28 00:18:20 +00:00
|
|
|
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
2024-02-01 12:51:41 +00:00
|
|
|
end
|
|
|
|
break
|
|
|
|
end
|
|
|
|
curWidth = curWidth + chunkWidth
|
|
|
|
end
|
|
|
|
table.insert(newVirtText, { suffix, 'MoreMsg' })
|
|
|
|
return newVirtText
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
|
|
fold_virt_text_handler = handler,
|
2024-03-28 00:18:20 +00:00
|
|
|
provider_selector = function(_, _, _)
|
2024-02-01 12:51:41 +00:00
|
|
|
return { 'treesitter', 'indent' }
|
2024-03-28 00:18:20 +00:00
|
|
|
end,
|
2024-02-01 12:51:41 +00:00
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'stevearc/oil.nvim',
|
2024-03-28 00:18:20 +00:00
|
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
2024-02-01 12:51:41 +00:00
|
|
|
keys = {
|
2024-03-28 00:18:20 +00:00
|
|
|
{ '-', '<cmd>Oil<cr>', desc = 'Open parent directory' },
|
2024-02-01 12:51:41 +00:00
|
|
|
},
|
|
|
|
opts = {},
|
|
|
|
},
|
2024-03-28 00:18:20 +00:00
|
|
|
{
|
|
|
|
'vhyrro/luarocks.nvim',
|
|
|
|
priority = 1000,
|
|
|
|
config = true,
|
|
|
|
},
|
2023-10-01 23:39:11 +00:00
|
|
|
{
|
2024-09-17 11:32:59 +00:00
|
|
|
'EvWilson/slimux.nvim',
|
|
|
|
lazy = true,
|
|
|
|
opts = function()
|
|
|
|
local status_ok, slimux = pcall(require, 'slimux')
|
|
|
|
if not status_ok then
|
|
|
|
return {}
|
|
|
|
end
|
|
|
|
return {
|
|
|
|
target_socket = slimux.get_tmux_socket(),
|
|
|
|
target_pane = string.format('%s.1', slimux.get_tmux_window()),
|
|
|
|
}
|
|
|
|
end,
|
2024-03-28 00:18:20 +00:00
|
|
|
keys = function()
|
2023-10-29 21:06:30 +00:00
|
|
|
local status_ok, which_key = pcall(require, 'which-key')
|
2023-10-29 20:46:14 +00:00
|
|
|
if status_ok then
|
2024-08-16 14:44:03 +00:00
|
|
|
which_key.add {
|
|
|
|
{ '<leader>m', group = 'Toggle ter[m]inal' },
|
2024-03-28 00:18:20 +00:00
|
|
|
}
|
2023-10-29 20:46:14 +00:00
|
|
|
end
|
2024-09-17 11:32:59 +00:00
|
|
|
local slimux_status_ok, slimux = pcall(require, 'slimux')
|
|
|
|
if not slimux_status_ok then
|
|
|
|
return {}
|
|
|
|
end
|
2023-10-29 20:46:14 +00:00
|
|
|
return {
|
2024-03-28 00:18:20 +00:00
|
|
|
{
|
2024-09-17 11:32:59 +00:00
|
|
|
'<leader>xr',
|
|
|
|
slimux.send_highlighted_text,
|
|
|
|
mode = 'v',
|
|
|
|
desc = 'Send currently highlighted text to configured tmux pane',
|
2024-03-28 00:18:20 +00:00
|
|
|
},
|
|
|
|
{
|
2024-09-17 11:32:59 +00:00
|
|
|
'<leader>r',
|
|
|
|
slimux.send_paragraph_text,
|
|
|
|
mode = 'n',
|
|
|
|
desc = 'Send paragraph under cursor to configured tmux pane',
|
2024-03-28 00:18:20 +00:00
|
|
|
},
|
2023-10-29 20:46:14 +00:00
|
|
|
}
|
2024-03-28 00:18:20 +00:00
|
|
|
end,
|
2023-12-21 14:06:53 +00:00
|
|
|
},
|
2023-10-01 23:39:11 +00:00
|
|
|
}
|