Hacker News new | ask | show | jobs
by grayrest 3531 days ago
> Are there any enormous advantages to using Vim vs. a Vim emulator?

There are lots of vim commands and most emulators do not implement the entire set. Macros, register recording, text objects, correct repeat, recursive keymappings, bookmarks/jump history, and ex mode are the most frequent casualties. Because everybody has a different subset of vim commands they use an emulator that works fine for one person will be unacceptable for others. I personally can't stand any of the VS Code vim plugins, which is a shame because I really would prefer to migrate from vim to vscode for the rest of the vscode ecosystem. The best emulator I've used is Evil (the emacs one, install spacemacs if you want to give it a go) and I find the InteilliJ and Atom emulators to be okay.

There's also plugins that are almost never carried over to emulators (though surround is in Evil):

EasyMotion [0] - Lets you jump around in complicated ways. I use the following config to be able to jump around in a minimal number of keystrokes:

    let g:EasyMotion_keys = 'jfkdlghtyuievnbsa'
    let g:EasyMotion_smartcase = 1

    nmap <space> <Plug>(easymotion-bd-W)
    nmap <S-space> <Plug>(easymotion-s)

Surround [1] - Lets you surround text objects and delete surrounding stuff easily. I use the following to save keystrokes, since I find `sw"` considerably easier to type than `ysiw"`.

    nmap s      ysi
    nmap S      ysa
    nmap s$     ys$
    nmap sv     gvs
[0] https://github.com/easymotion/vim-easymotion [1] https://github.com/tpope/vim-surround