Kim Taeyeon
Kim Taeyeon

Reputation: 13

How to stop NeoVim from sending ^S character while I press Ctrl+S in Insert Mode?

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?

Upvotes: 0

Views: 539

Answers (1)

Igbanam
Igbanam

Reputation: 6082

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

Upvotes: 1

Related Questions