114 lines
3.0 KiB
Lua
114 lines
3.0 KiB
Lua
return {
|
|
{
|
|
'echasnovski/mini.diff',
|
|
version = false,
|
|
event = "VeryLazy",
|
|
opts = {
|
|
-- Options for how hunks are visualized
|
|
view = {
|
|
-- Visualization style. Possible values are 'sign' and 'number'.
|
|
-- Default: 'number' if line numbers are enabled, 'sign' otherwise.
|
|
style = 'sign',
|
|
|
|
-- Signs used for hunks with 'sign' view
|
|
signs = { add = '▒', change = '▒', delete = '▒' },
|
|
|
|
-- Priority of used visualization extmarks
|
|
priority = 199,
|
|
},
|
|
|
|
-- Source for how reference text is computed/updated/etc
|
|
-- Uses content from Git index by default
|
|
source = nil,
|
|
|
|
-- Delays (in ms) defining asynchronous processes
|
|
delay = {
|
|
-- How much to wait before update following every text change
|
|
text_change = 200,
|
|
},
|
|
|
|
-- Module mappings. Use `''` (empty string) to disable one.
|
|
mappings = {
|
|
-- Apply hunks inside a visual/operator region
|
|
apply = 'gh',
|
|
|
|
-- Reset hunks inside a visual/operator region
|
|
reset = 'gH',
|
|
|
|
-- Hunk range textobject to be used inside operator
|
|
textobject = 'gh',
|
|
|
|
-- Go to hunk range in corresponding direction
|
|
goto_first = '[H',
|
|
goto_prev = '[h',
|
|
goto_next = ']h',
|
|
goto_last = ']H',
|
|
},
|
|
|
|
-- Various options
|
|
options = {
|
|
-- Diff algorithm. See `:h vim.diff()`.
|
|
algorithm = 'histogram',
|
|
|
|
-- Whether to use "indent heuristic". See `:h vim.diff()`.
|
|
indent_heuristic = true,
|
|
|
|
-- The amount of second-stage diff to align lines (in Neovim>=0.9)
|
|
linematch = 60,
|
|
|
|
-- Whether to wrap around edges during hunk navigation
|
|
wrap_goto = false,
|
|
},
|
|
}
|
|
},
|
|
{
|
|
'nvim-telescope/telescope.nvim',
|
|
dependencies = {
|
|
{ 'nvim-lua/plenary.nvim' },
|
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
|
{ 'nvim-tree/nvim-web-devicons' },
|
|
},
|
|
cmd = 'Telescope',
|
|
keys = function()
|
|
local telescope = require('utils').telescope
|
|
|
|
return {
|
|
{ '<leader>ff', telescope 'find_files', desc = 'files' },
|
|
{ '<leader>fg', telescope 'git_files', desc = 'git files' },
|
|
{ '<leader>fr', telescope 'live_grep', desc = 'grep' },
|
|
{ '<leader>fb', telescope 'buffers', desc = 'buffers' },
|
|
{ '<leader>fc', telescope 'colorscheme', desc = 'colorscheme' },
|
|
{ '<leader>fh', telescope 'oldfiles', desc = 'history' },
|
|
}
|
|
end,
|
|
config = function()
|
|
local telescope = require 'telescope'
|
|
telescope.setup {
|
|
defaults = {
|
|
mappings = {
|
|
i = {
|
|
["<Esc>"] = require('telescope.actions').close
|
|
}
|
|
},
|
|
}
|
|
}
|
|
telescope.load_extension 'fzf'
|
|
end,
|
|
},
|
|
{
|
|
'f-person/git-blame.nvim',
|
|
dependencies = {},
|
|
keys = {
|
|
{ '<leader>bt', '<Cmd>GitBlameToggle<CR>', desc = 'Blame toggle' },
|
|
{ '<leader>bo', '<Cmd>GitBlameOpenCommitURL<CR>', desc = 'Open in browser' },
|
|
{ '<leader>bc', '<Cmd>GitBlameCopySHA<CR>', desc = 'Copy SHA1' },
|
|
},
|
|
config = function()
|
|
require('gitblame').setup {
|
|
enabled = false,
|
|
message_template = ' <author> • <date> • <summary>',
|
|
}
|
|
end,
|
|
},
|
|
}
|