当我在插入模式下按 Ctrl+S 时,如何阻止 NeoVim 发送 ^S 字符?

发布于 2025-01-13 01:08:38 字数 238 浏览 1 评论 0原文

我想重新映射 以保存文件。它在正常模式下工作正常。但是,当我处于插入模式并按 Ctrl+S 时,它只会发送字符 ^S (作为单个字符)。

我正在使用 Windows 10 和 Powershell 打开 NeoVim。有没有一种方法可以在我当前的情况下映射 Ctrl+S 来保存文件?我还应该坚持使用 Powershell 还是应该切换到另一个终端?

I wanted to remap <C-s> to save a file. It works fine in normal mode. But when I'm in Insert Mode and I press Ctrl+S, it just send the character ^S (as a single character).

I'm using Windows 10 and Powershell to open NeoVim. Is there a way that I can map Ctrl+S to save the file in my current situation? Also should I stick to Powershell or should I switch to another terminal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

知你几分 2025-01-20 01:08:38

我会尝试将其重新映射为类似

  • 离开插入模式
  • 保存
  • 返回到插入模式,在光标之后
inoremap <C-s> <Esc>:w<cr>a

I would try remapping it to something like

  • leave insert mode
  • save
  • return to insert mode, after the cursor
inoremap <C-s> <Esc>:w<cr>a
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文