
Vim-vertical: Get around 2-dimensionally in vim - rbongers
https://github.com/rbong/vim-vertical
======
savanaly
I learned vim about two years ago and have been using it ever since, and at
the time I learned it I learned all the neat combos for moving your cursor
("w", "5w", "b", "^", "$", and many other actually complicated ones besides).

As clever as these motions are though, easymotion simply blows them out of the
water and there's no reason to use them. With easy motion it only takes as
long as it takes your eye to move to where you want to move and you're
there...you really can't beat that.

In some cases of course easymotion isn't enough because the place to which you
need to move isn't on screen. So far all files I edit are short enough that I
can scan the whole thing relatively easily by just holding down "J" or "K"
(which I have mapped to "10j" and "10k")

~~~
justinmk
vim-sneak[1] is a less bling-bling alternative to easymotion. I originally
wrote it to address the sub-optimal valley between Vim's built-in near-
distance (f, t, ...) and long-distance (/) motions. It also tries to avoid the
hesitation that easymotion introduces, by avoiding the need to select a label
if the first match is correct.

[1] [https://github.com/justinmk/vim-sneak](https://github.com/justinmk/vim-
sneak)

~~~
hacker42
There is a Spacemacs layer with nearly the same functionality called evil-
snipe which binds s and S.

~~~
sooheon
Isn't it more accurate to say there's an elisp package called evil-snipe which
does this? The spacemacs layer didn't write the functionality, it's one
example of how to configure it.

~~~
pritambaral
Yes, it sure is. But in the context we're talking about: Vim and Vim users, I
think mentioning it as a Spacemacs layer is an acceptable offense.

------
gbrown_
I find vim-sneak works well for me, as it tries to extend "vim's natural
language" so to speak.

[https://github.com/justinmk/vim-sneak](https://github.com/justinmk/vim-sneak)

Otherwise relative numbers and gj/ gk work well enough for me when it comes to
moving vertically to a position I can see on the screen.

------
maxaf
Has the author heard of gj and gk?

~~~
a3n
My immediate first thought. Although, the Vim is large and our brains so very
small.

~~~
dave2000
It's worth reading the description again in that case, and following the
examples in the screenshots. It's not doing the same thing.

~~~
a3n
If I understand correctly, I can gj down a few times and get the same general
effect, without having to install something.

For me there's a tension between a growing number of very specific features
and my ability to remember them all. These days I opt for minimal vim addons,
as there's usually a good enough way to get something done by default.

But for people who need exactly this sort of thing, this thing is exactly the
sort of thing they'll like.

~~~
dave2000
Yeah, gj is similar in the same way that you can press l a few times instead
of e. (I've mapped j to do the same thing as gj anyway as I want to navigate
the physical screen, not honour lines as indivisible entities).

------
melling
Many editors have an Easy Motion plugin:

[https://code.tutsplus.com/tutorials/vim-essential-plugin-
eas...](https://code.tutsplus.com/tutorials/vim-essential-plugin-easymotion--
net-19223)

I believe Sublime, Emacs, and Atom all have one.

~~~
justinmk
Yep, and all of them have "blind spots" or lack attention to subtle details,
because the authors didn't use Vim for very long, if at all.

~~~
theseatoms
Try'na make your own then?

~~~
egjerlow
I think he did ;)

[https://github.com/justinmk/vim-sneak](https://github.com/justinmk/vim-sneak)

------
dominotw
tldr;

> Many times, I have been at the end of a line after editing it and needed to
> go to a nearby long line.

------
lervag
I find this better solved by vim-columnmove:

[https://github.com/machakann/vim-
columnmove](https://github.com/machakann/vim-columnmove)

------
alfanick
i'm happy with :relativenumber and classic motions + marks (eg ma + 'a)

------
z3t4
How long does it take to learn the Vim way of navigating so that you do not
have to think when doing it, like the fingers move by themselves ?

And how much time do you save, compared to placing the cursor using the mouse?

~~~
justinmk
It's not really a matter of saving time, but eliminating friction (context-
switches). Editing is a chore, and fiddling with text while taking notes, or
debugging, or thinking about a problem, has a cost.

It's also quite alarming to reach a level of proficiency where you can make
non-trivial edits _without looking at what you 're editing_, and know that the
edits are correct. Again, this avoids context-switches.

That's why Vim is so focused on precision ("do exactly this") rather than DWIM
("Do What I Mean [usually]": the emacs/IDE approach).

Certainly whether the ramp-up cost is worth the "payoff" is debatable, but for
me, editing text became so irritating that my initial experiments with Vim
were driven from pure exhaustion after years of blub-craft.

~~~
sooheon
That point about "do exactly this" vs DWIM is interesting. As an evil user, I
didn't think of it that way, but I can definitely see where this is true.

------
mpdehaan2
I'm pretty happy with just

:set nu

:20 # go to line 20

~~~
dave2000
Some people even like:

:set rnu

~~~
rbongers
alright, this solves my problem much better

------
rbongers
Thanks for the other suggestions for vertical movement. I think /? and vim-
vertical is all I need.

------
a-b
First of all, I want to say thanks to both authors Vim-vertical and vim-sneak
for trying to do something useful for Vim community.

Therefore, I think that it's quite a bad idea to use any of this plugins. The
reason is that the most powerful Vim's concept is text-object and such
shortcuts ruining muscle memory and mixing core technology understanding.

IMHO easy-motion gives excellent text-object visualization which helps me to
understand text structure better.

