walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
585 stars 17 forks source link

bind v to open file in $EDITOR #211

Closed mundry closed 1 week ago

mundry commented 3 weeks ago

Hi there,

first of all: Great job! I've really been enjoying moar so far.

Something that's ingrained in my muscle memory from less is pressing v to open the current file in $EDITOR.

It would be great to have that same functionality in moar, too.

What do you think?

walles commented 2 weeks ago

I want this. It would sort of solve #135 as well.

For reference I tried less's behavior (less 581.2, comes with macOS) and:

Except for the number I think this makes for a reasonable starting point.

walles commented 2 weeks ago

less primarily picks $VISUAL, then falls back to $EDITOR, then to vi (from defines.ds):

https://github.com/gwsw/less/blob/db13e771320d4bfc9d403ee951b623a8c3d5e425/main.c#L331-L342

walles commented 1 week ago

@mundry please try this out in moar 1.24.0!

walles commented 4 days ago

FYI, with v1.24.4 this now works when piping input to moar as well.

I know I have wanted that, maybe you do as well :).