Search code examples
visual-studio-codevscodevim

Why does `dae` command delete everything in a file?


Recently I started exploring vscodevim, and knew about the daw command, that not just deletes before the next word, but completely deletes the current word too. Logically, dae command would delete before the end of the word, but it, suddenly, just clears the file... So, what's wrong?


Solution

  • In vscodevim, the motion ae refers to the entire buffer, hence dae will delete it.

    Note that this has nothing to do with the "real" Vim, that's not a valid command there. I would use Gd1G to have the same effect in Vim:

    • G goes to the last line;
    • d1G deletes from there to the first line.

    Although there are no doubt other ways, Vim is nothing if not prolific in the varying ways to do things :-)