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
    ·
    11 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.

  • whimsy@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    I’m a bit confused by your question. less is usually the default pager and it supports vim style navigation out of the box. Moreover, a pager is just for viewing content (historically which didn’t fit on the screen), and not for editing. So I’m not sure what you mean by pasting

  • rc__buggy@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    11 months ago

    I’m on my phone, but when using less “v” opens the file in $EDITOR. I don’t remember if it defaults to read only