0

I am trying to improve my skill with vim. And I know ESC : w for to save.

But in normal mode the shortcut for w is for "to the next word".

is there another key for to save quickly? or I need press ESC and :.

5
  • 1
    Sounds like the first thing you need to do is get in the habit of making Normal mode your default mode...kind of like your "resting state". That means as soon as you're done entering text hit escape. Every time. Every proficient Vim user does it this way. Then to save you'll usually just need to do :w (and Enter of course).
    – B Layer
    Oct 15, 2020 at 13:01
  • But in spanish keyboard press " : " is "Shift" + " . " and it is more slow than a one key....that I don't know witch.
    – tres.14159
    Oct 15, 2020 at 13:07
  • Well for US keyboards : is shift+;. Pretty much the same effort as yours.
    – B Layer
    Oct 15, 2020 at 13:09
  • Yet it is similar in spanish...instead the key . (dot) .
    – tres.14159
    Oct 15, 2020 at 13:09
  • Maybe I'm misunderstanding your question. Certainly Luc, based on his answer, has a different interpretation.
    – B Layer
    Oct 15, 2020 at 13:12

1 Answer 1

1

If you already are in normal mode, you don't need the ESC part. It's just : + w + ENTER

Unlike ZZ for save+quit, I'm not aware of any shortcut to save. It's up to us to map the save action to anything of our liking.

My early days with Borland IDEs had me have the following in my .vimrc. Others map on CTRL+S.

nnoremap <F2> :<c-u>update<CR>
inoremap <F2> <c-o>:update<CR>
vnoremap <F2> <c-c>:update<CR>gv

PS: Unlike :write, :update doesn't touch a file that is not modified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.