Hacker News new | past | comments | ask | show | jobs | submit login

Some time ago, I read, that the usage of :x is discouraged, as the typo :X is easy to make and leads to encrypting the file accidentally.



TIL vim has encryption.

If you're annoyed by typoing stuff, like I'm annoyed by typing :Wq or :WQ, you can just alias it of course. Since you (and, presumably, nobody) ever use(s) vim encryption it doesn't matter to override it.

vimrc:

    command Wq wq
    command WQ wq
    command W w
    command Q q


My problem is writing :x instead of :w (on an AZERTY keyboard) and accidentally exiting when I just wanted to save.


Use neovim instead to solve this problem, :X has been removed (and you shouldn't use it in vim either anyway).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: