ctrl + <del> 或 <backspace> 不会删除 Neovim 中的整个单词

问题描述 投票:0回答:1

问题

ctrl + <del>
ctrl + <backspace>
不会删除整个单词。我知道 Neovim 中有另一种方法可以做到这一点,但我想改变当前的行为。

所以我尝试更改我的映射,但 ctrl + del 不起作用

  • 我在Windows终端上使用powershell来使用neovim。
  • lua中的config,突出显示的行是我所做的更改

这是我当前的配置GitHub

windows powershell lua neovim
1个回答
0
投票

是的,你可以这样映射按键图。

vim.keymap.set("n", "<C-BS>", "dw", {silent = true, desc = 'delete from cursor to ending word'})
vim.keymap.set("n", "<C-Del>", "db", {silent = true, desc = 'delete from cursor to beginning word'})

但请注意,在某些情况下,

<C-BS>
无法按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.