Comment by rybosome

1 day ago

Agreed. I wonder if this is somewhat revealing of the mental processes of the creators.

To me, if my cursor is a few lines away from another line, the easiest way for me to get there is by either using h/j a few times, or looking at the absolute line number and doing that with gg.

Relative jumps are only useful to me in macros. Calculating a relative jump myself would 100% pull me out of the flow state where I just want to go up/down a few rows.

I have no proof of this, but I’d guess that the creator of this pattern didn’t feel the same way.

The best tip I got, was to rely more on search instead of other kind of movement. Especially when doing a bunch of editing. Things like easymotion/sneak/avy works best when reading/reviewing.

While I loved multi cursor with sublime. After I moved to Vim, I’ve never needed it. It’s either search~repeat or a macro. Now I’m using emacs, and it’s mostly occur-mode and macro. Grep edit is nice for bigger refactoring.

  • I really, really like flash/easymotion/etc because I effectively also use the same jump motions all the time in my browser (with vimium/tridactyl). So I have double the muscle memory, and I context-switch less between my browser and neovim, compared to if I was primarily using relative line jumps in neovim

  • Why’d you switch to emacs, and do you use evil mode?

    • Vim is a fine editor, but emacs has better tooling. I got in touch with Emacs while learning Common Lisp, and I got hooked by the extensive capabilities and customization available. Vim is fine for extension, but you have to build most of them yourself.

      I tried evil mode, but it clashes with other keybinding in some places and I got unhappy with it. There's a philosophy conflict there. With vim, you're expected to have a command for an action and then bind it to a key. Your editing workflow is to compose those keys.

      But with emacs, you're more expected to have a view and then a set of actions for that view. The power of emacs comes with how easy it is to integrate all those views together. For a programming workflow, you have the file explorer, the symbol explorer, the search result (single file and all files), the version control, the docs, the compilation|build window, the shell, the project tasks,... all together in the same place and linked to each other. With vim, you have to compose all those with a multiplexer and other tools (with conflicting bindings) to get there. Vim is still better for editing, but Emacs is better for workflows.

Why would you ever calculate relative jump yourself instead of having relative line numbers in the gutter?

And yes, for a few lines it's fine, the plugin has this number configurable.

Getting used to thinking about multi-line motions via 5j helped me train to visualise lines that way.

Over time, I started using things like 13dd or 7yy with more ease.

Of course, `set relativenumber` is always recommended.

> Calculating a relative jump myself would 100% pull me out of the flow state where I just want to go up/down a few rows.

Yeah, you can't be a purist about it. If you're hard-focused and jjjjj is the first thing that comes to mind, then that's fine. When you're doing lighter work is when you have the spare mental capacity to train and improve on your workflow.