mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 00:45:17 -06:00
mini jump rice
This commit is contained in:
parent
8da416de1c
commit
3de4c4e289
1 changed files with 27 additions and 8 deletions
|
|
@ -61,7 +61,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>gb',
|
'<leader>gb',
|
||||||
'<Cmd>Git blame -- %<CR>',
|
'<Cmd>vertical Git blame -- %<CR>',
|
||||||
noremap = true,
|
noremap = true,
|
||||||
desc = 'git blame',
|
desc = 'git blame',
|
||||||
},
|
},
|
||||||
|
|
@ -71,6 +71,14 @@ return {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
desc = 'git command',
|
desc = 'git command',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'S',
|
||||||
|
function()
|
||||||
|
MiniJump2d.start { spotter = MiniJump2d.gen_spotter.vimpattern() }
|
||||||
|
end,
|
||||||
|
noremap = true,
|
||||||
|
desc = 'mini jump',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('mini.basics').setup { mappings = { windows = true } }
|
require('mini.basics').setup { mappings = { windows = true } }
|
||||||
|
|
@ -92,7 +100,7 @@ return {
|
||||||
'%<', -- Mark general truncate point
|
'%<', -- Mark general truncate point
|
||||||
{ hl = 'MiniStatuslineFilename', strings = { '' } },
|
{ hl = 'MiniStatuslineFilename', strings = { '' } },
|
||||||
'%=', -- End left alignment
|
'%=', -- End left alignment
|
||||||
{ hl = 'MiniStatusDevinfo', strings = { diff, diagnostics, lsp } },
|
{ hl = 'MiniStatusDevinfo', strings = { diagnostics, lsp } },
|
||||||
{ hl = 'MiniStatuslineFilename', strings = { search } },
|
{ hl = 'MiniStatuslineFilename', strings = { search } },
|
||||||
{ hl = mode_hl, strings = { mode } },
|
{ hl = mode_hl, strings = { mode } },
|
||||||
}
|
}
|
||||||
|
|
@ -110,13 +118,24 @@ return {
|
||||||
require('mini.align').setup()
|
require('mini.align').setup()
|
||||||
require('mini.bracketed').setup()
|
require('mini.bracketed').setup()
|
||||||
require('mini.icons').setup()
|
require('mini.icons').setup()
|
||||||
require('mini.jump2d').setup { mappings = { start_jumping = '<leader>S' } }
|
require('mini.jump2d').setup {
|
||||||
require('mini.operators').setup {
|
view = { n_steps_ahead = 1, dim = true },
|
||||||
replace = {
|
|
||||||
prefix = 'gR',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
require('mini.git').setup()
|
require('mini.git').setup { command = { split = 'vertical' } }
|
||||||
|
-- Bind both windows so that they scroll together
|
||||||
|
local align_blame = function(au_data)
|
||||||
|
if au_data.data.git_subcommand ~= 'blame' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local win_src = au_data.data.win_source
|
||||||
|
vim.wo.wrap = false
|
||||||
|
vim.fn.winrestview { topline = vim.fn.line('w0', win_src) }
|
||||||
|
vim.api.nvim_win_set_cursor(0, { vim.fn.line('.', win_src), 0 })
|
||||||
|
vim.wo[win_src].scrollbind, vim.wo.scrollbind = true, true
|
||||||
|
end
|
||||||
|
|
||||||
|
local au_opts = { pattern = 'MiniGitCommandSplit', callback = align_blame }
|
||||||
|
vim.api.nvim_create_autocmd('User', au_opts)
|
||||||
setup_pairs {
|
setup_pairs {
|
||||||
modes = { insert = true, command = true, terminal = false },
|
modes = { insert = true, command = true, terminal = false },
|
||||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue