I use VSCode Neovim plugin, and I would like to use "Ctrl+S" key for "save this file, and then switch to normal mode", which visually change the cursor style from "thin" to "solid".
My vim/nvim config file is with:
"--- ctrl + s saving
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR><ESC>
But in VSCode, edit some words, then press "Ctrl+S" just save the file, didn't switch to normal mode. i.e. the <C-O>:update<CR><ESC>
is not executed. How can I let it be executed?
Tried solution: In VSCode, Exit Vim Insert Mode on Save
settings.json
:
"macros": {
"saveAndExitVimInsertMode": [
"workbench.action.files.save",
"extension.neovim.escape"
]
}
keybindings.json
:
{
"key": "ctrl+s",
//"command": "workbench.action.files.save"
"command": "macros.saveAndExitVimInsertMode"
},
But still not working.