LaTeX: Remove old bépo remapping

This commit is contained in:
Fabrice Mouhartem 2024-06-21 11:33:44 +02:00
parent 5a118932f3
commit 0a027afb4d
Signed by: fmouhart
GPG Key ID: 2C5033B228CFE4E7

View File

@ -12,35 +12,3 @@ if vim.fn.maparg("gbc") ~= "" then
or '<Plug>(comment_toggle_blockwise_count)' or '<Plug>(comment_toggle_blockwise_count)'
end, { expr = true, desc = 'Comment toggle current block' }) end, { expr = true, desc = 'Comment toggle current block' })
end end
-- [[ vimtex ]]
-- Some BÉPO mappings for vimtex
local texgroup = vim.api.nvim_create_augroup("latex-after", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.tex", "*.bib", "*.cls", "*.tikz", },
group = texgroup,
callback = function()
local vimtex_remaps = {
-- c <-> t
{ mode = "n", source = "csd", target = "lsd", command = "<Plug>(vimtex-delim-change-math)" },
{ mode = "n", source = "csc", target = "lsc", command = "<Plug>(vimtex-cmd-change)" },
{ mode = "n", source = "cse", target = "lse", command = "<Plug>(vimtex-env-change)" },
{ mode = "n", source = "cs$", target = "ls$", command = "<Plug>(vimtex-env-change-math))" },
-- t <-> j
{ mode = { "x", "n" }, source = "tsD", target = "jsD", command = "<Plug>(vimtex-delim-toggle-modifier-reverse)" },
{ mode = { "x", "n" }, source = "tsd", target = "jsd", command = "<Plug>(vimtex-delim-toggle-modifier)" },
{ mode = { "x", "n" }, source = "tsf", target = "jsf", command = "<Plug>(vimtex-cmd-toggle-frac)" },
{ mode = "n", source = "tsc", target = "jsc", command = "<Plug>(vimtex-cmd-toggle-star)" },
{ mode = "n", source = "ts$", target = "js$", command = "<Plug>(vimtex-env-toggle-math)" },
{ mode = "n", source = "tse", target = "jse", command = "<Plug>(vimtex-env-toggle-star)" },
}
for _, remap in pairs(vimtex_remaps) do
if vim.fn.maparg(remap.source) ~= "" then
vim.keymap.del(remap.mode, remap.source, { buffer = true })
vim.keymap.set(remap.mode, remap.target, remap.command, { silent = true, noremap = true, buffer = true })
end
end
end,
})