atom / vim-mode

Next generation vim support for atom
MIT License
1.72k stars 253 forks source link

Modifier `j` and `k` off-by-one #51

Closed audreyt closed 9 years ago

audreyt commented 10 years ago

In Vim, dj and dk deletes two lines, while yj and yk yanks two lines. d2j affects three lines, and so on.

In Atom Vim mode it appears j/k is implemented the same as h/l and affects one less line than in Vim mode.

alexispurslane commented 10 years ago

I have tested that in my vim on my mac (osx 10.8, normal vim not macvim) and it turns out that dj and dk only do one line, above the current one.

audreyt commented 10 years ago

Interesting. Here dj and dk deletes the currently line in addition to the below/above line, hence 2 lines.

http://guckes.net/vimberlin/small_commands.txt has:

delete current and next/previous line:
    dj dk

https://github.com/shawncplus/vim-classes/blob/master/expert-1.md has:

    dj  - delete current and next line (j = down)

In the current Atom vim mode, it correctly deletes the line above/below but not the current one.

jabagawee commented 10 years ago

As of vim-mode v0.8.0, dj and dk do the equivalent of vjd and vkd, which are way off since that won't even delete an entire line.

fotanus commented 10 years ago

Can we close this one?

mythmon commented 10 years ago

This seems fixed to me.

watsoncj commented 10 years ago

Verified this is fixed.