use xmap instead of vmap in textobjects

This commit is contained in:
evakuator 2020-09-01 21:44:24 +06:00 committed by Stephan Seitz
parent acba0fd666
commit c5d5e48e0f
2 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ function M.attach(bufnr)
if funcname == "init_selection" then
mode = 'n'
else
mode = 'v'
mode = 'x'
end
local cmd = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()<CR>", funcname)
api.nvim_buf_set_keymap(bufnr, mode, mapping, cmd, { silent = true, noremap = true })

View file

@ -29,7 +29,7 @@ function M.attach(bufnr, lang)
if query then
local cmd = ":lua require'nvim-treesitter.textobjects.select'.select_textobject('"..query.."')<CR>"
api.nvim_buf_set_keymap(buf, "o", mapping, cmd, {silent = true, noremap = true })
api.nvim_buf_set_keymap(buf, "v", mapping, cmd, {silent = true, noremap = true })
api.nvim_buf_set_keymap(buf, "x", mapping, cmd, {silent = true, noremap = true })
end
end
end
@ -47,7 +47,7 @@ function M.detach(bufnr)
end
if query then
api.nvim_buf_del_keymap(buf, "o", mapping)
api.nvim_buf_del_keymap(buf, "v", mapping)
api.nvim_buf_del_keymap(buf, "x", mapping)
end
end
end