I’d like to be able to navigate text in a pager with Vim-style modal editing (moving with hjkl and yank/paste with y/p). Is there a way to enable this in the default pager, or is there an alternative pager that supports this kind of modal behavior?

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    You can set Vim as your pager. If you are on Neovim, its very easy, just set this variable:

    export PAGER='nvim +Man!'
    export MANPAGER="${PAGER}"
    

    Then try man grep. These variables could be set in your .bashrc in example. If you use the “original” Vim, it’s a bit more complicated to setup. I did that before too, so it’s definitely doable.

    • SinTan1729@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 months ago

      This, but I use bat since it seems to be faster for this.

      Edit: I should clarify that I only use bat as the MANPAGER, since bat uses less under the hood for paging anyway. But with support for a built-in pager in the new release, perhaps it makes sense to set it as the PAGER too.