Search code examples
vimneovim

How frequently do you navigate from symbol to symbol using the f + <symbol> + ' command in Vim or Neovim?


Vim, as well as Neovim, allows you to navigate using specific symbols.

  1. How often do you use this approach? For example, to move to the character 'g', you can press fg', and to move to the next g, just press '.
  2. Is this considered the fastest and default way to navigate? Or is there a better way?
  3. Is it faster than using the mouse?

Solution

    • It is fg, not fg', and you use ; to jump to next g.
    • fFtT jump to a character, not a "symbol".

    Now…

    1. Very rarely. Because, precisely, I tend to jump to actual symbols (names, keywords, operators, etc.). I rarely operate at such a granularity level.

    2. It certainly is the fastest way to jump to the next g. For other scenarios there are other methods. See :help motion.txt.

    3. Using a pointing device like a mouse or trackpad works in two steps. First, the user moves the visual pointer to the target. Second, the user interacts with the target. The latter is obviously quick and easy, but the former is actually a sequence of discrete steps that are very fuzzy by nature: move in the general direction of the target, adjust your aim and move again, etc. The worst is that the farther the target the slower it gets.

      Other navigation methods, like f<char> and many of those documented in the help section mentioned above, can be more deterministic and therefore more efficient.