6 ms·
Vim-vertical: Get around 2-dimensionally in vim
- dominotw 10y agotldr; > Many times, I have been at the end of a line after editing it and needed to go to a nearby long line.
- maxaf 10y agoHas the author heard of gj and gk?
- a3n 10y agoMy immediate first thought. Although, the Vim is large and our brains so very small.
- dave2000 10y agoIt's worth reading the description again in that case, and following the examples in the screenshots. It's not doing the same thing.
- a3n 10y agoIf 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 10y agoYeah, 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).
- manulp 10y agoIt's not really the same though, gj and gk move the cursor by displayed lines instead of real lines. Op's plugin is like transposing the buffer like a matrix, and then using normal word motions on the line that was a column.
- lervag 10y agoI find this better solved by vim-columnmove: https://github.com/machakann/vim-columnmove https://github.com/machakann/vim-columnmove
- melling 10y agoMany editors have an Easy Motion plugin: https://code.tutsplus.com/tutorials/vim-essential-plugin-easymotion--net-19223 https://code.tutsplus.com/tutorials/vim-essential-plugin-eas... I believe Sublime, Emacs, and Atom all have one.
- justinmk 10y agoYep, 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 10y agoTry'na make your own then?
- egjerlow 10y agoI think he did ;) https://github.com/justinmk/vim-sneak https://github.com/justinmk/vim-sneak
- lynndylanhurley 10y agoHis is the best of the all. https://github.com/justinmk/vim-sneak https://github.com/justinmk/vim-sneak
- savanaly 10y agoI 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 10y agovim-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
- mixedmath 10y agoFor what it's worth, I use vim-sneak and I like it tremendously. Thank you.
- hacker42 10y agoThere is a Spacemacs layer with nearly the same functionality called evil-snipe which binds s and S.
- sooheon 10y agoIsn'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.
- mpdehaan2 10y agoI'm pretty happy with just :set nu :20 # go to line 20
- gbrown_ 10y agoI 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.
- alfanick 10y agoi'm happy with :relativenumber and classic motions + marks (eg ma + 'a)
- z3t4 10y agoHow 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?
- clishem 10y agoIn my experience, arbitrary movement when what you move to is on the screen is actually faster if you use a mouse. It's unconventional, but I use a mouse for such movements for that reason (vim has excellent mouse support, even its TUI version). In vim some operations require a movement, where vim's movement has an advantage over using the mouse. For example, dt. deletes until the next period, or ci( which deletes the text inside parentheses and then enters insert mode.
- justinmk 10y agoIt'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 10y agoThat 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.
- deleted 10y ago[deleted]
- chestervonwinch 10y ago
- a-b 10y agoFirst 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.
- rbongers 10y agoThanks for the other suggestions for vertical movement. I think /? and vim-vertical is all I need.