86 lines
2.1 KiB
Lua
86 lines
2.1 KiB
Lua
local remap = vim.keymap.set
|
|
local opts = { noremap=true, silent=true, unique=true }
|
|
|
|
-- Align text/easy-align replacement
|
|
require('mini.align').setup({
|
|
mappings = {
|
|
start = '',
|
|
start_with_preview = 'ga',
|
|
},
|
|
})
|
|
-- Comment lines
|
|
require('mini.comment').setup()
|
|
-- Vertical jumps/movement
|
|
require('mini.jump2d').setup({
|
|
allowed_lines = {
|
|
blank = true,
|
|
cursor_before = true,
|
|
cursor_at = true,
|
|
cursor_after = true,
|
|
fold = true,
|
|
},
|
|
allowed_windows = {
|
|
current = true ,
|
|
not_current = false,
|
|
},
|
|
labels = 'arstgmneioqwfpbjluyzxcdvkh',
|
|
mappings = { start_jumping = '' },
|
|
silent = true,
|
|
view = {
|
|
dim = true,
|
|
n_steps_ahead = 0,
|
|
},
|
|
})
|
|
-- Surround actions/vim-surround replacement
|
|
require('mini.surround').setup({})
|
|
-- Highlight and remove white space
|
|
require('mini.trailspace').setup({})
|
|
|
|
-- Key mappings for all mini modules we use
|
|
remap({ 'n', 'o', 'x' }, 'gS', function()
|
|
return require('mini.jump2d').start({
|
|
allowed_lines = {
|
|
blank = false,
|
|
cursor_before = true ,
|
|
cursor_at = false,
|
|
cursor_after = false,
|
|
fold = false,
|
|
}
|
|
})
|
|
end, opts)
|
|
remap({ 'n', 'o', 'x' }, 'gs', function()
|
|
return require('mini.jump2d').start({
|
|
allowed_lines = {
|
|
blank = false,
|
|
cursor_before = false,
|
|
cursor_at = false,
|
|
cursor_after = true ,
|
|
fold = false,
|
|
}
|
|
})
|
|
end, opts)
|
|
remap({ 'n', 'o', 'x' }, 'gl', function()
|
|
local mini_jump2d = require('mini.jump2d')
|
|
local line_start = mini_jump2d.builtin_opts.line_start
|
|
|
|
return mini_jump2d.start(line_start)
|
|
end, opts)
|
|
-- Replacement for f, F, t, T motions/Horizontal movement
|
|
remap({ 'n', 'o', 'x' }, 'f', function()
|
|
local mini_jump2d = require('mini.jump2d')
|
|
local single_char = mini_jump2d.builtin_opts.single_character
|
|
|
|
single_char.allowed_lines = {
|
|
blank = false,
|
|
cursor_before = false,
|
|
cursor_at = true ,
|
|
cursor_after = false,
|
|
fold = false,
|
|
}
|
|
|
|
return mini_jump2d.start(single_char)
|
|
end, opts)
|
|
remap('n', '<Leader>ws', function()
|
|
return require('mini.trailspace').trim()
|
|
end, opts)
|