I was wondering is it possible to create a custom shortcut in vim
or vi
to save open file?
For example, CtrlS instead of typing each time :w
?
Thanks!
vivimvimrc
I was wondering is it possible to create a custom shortcut in vim
or vi
to save open file?
For example, CtrlS instead of typing each time :w
?
Thanks!
Best Answer
Vim comes with a file providing some mappings intended to match Windows files. This is usually in
$VIMRUNTIME/mswin.vim
(run:echo $VIMRUNTIME
to see what it is for you). You can just do:And get a bunch of shortcuts, including CtrlS. See
:h mswin.vim
for more.Note that your terminal emulator might use CtrlS for other purposes, but that's outside Vim.
To just create a mapping to test, do: