Are there any pagers that use emacs keybindings?

6

2

Both more and less seem to be heavily influenced by the vi commands. Are there any pagers that are more emacs like out of the box?

apgwoz

Posted 2012-10-11T04:36:46.963

Reputation: 163

Answers

4

less supports actually a subset of both vi and emacs commands. You should be able to add the ones you are missing using the lesskey command.

jlliagre

Posted 2012-10-11T04:36:46.963

Reputation: 12 469

The lesskey pointer is very helpful--thanks! – apgwoz – 2012-10-11T18:10:26.693

1

Not exactly a pager, but GNU Info uses the same bindings as Emacs.

Though I wonder why you would need a pager if you use Emacs…

Emacs can browse man pages with woman, you can « tail » a file with auto-revert-tail-mode.

Daimrod

Posted 2012-10-11T04:36:46.963

Reputation: 553

You use pagers for a lot more than man and info pages... – apgwoz – 2012-10-11T18:15:56.517

My shell run in emacs and if I need to do complex operations on the output, I can simply put it in a buffer and write some elisp, run some shell command (M-|) or use some keyboard macros (C-x k (). Thus I only use a pager when I'm don't have (my) emacs. – Daimrod – 2012-10-11T21:25:37.383

Which shell are you using? I guess I could force myself to do more things within emacs. I already do do a lot of things. I'm just so used to using an xterm I guess... – apgwoz – 2012-10-12T02:11:48.007

I use multi-term to run multiple terminals inside emacs. https://github.com/daimrod/Emacs-config/blob/master/config-multi-term.el And then, you can switch between term-char-mode and term-line-mode with respectively C-c C-k and C-c C-j. term-char-mode has the standard term bindings, and with term-line-mode you can navigate in the buffer like in any other buffers.

– Daimrod – 2012-10-12T06:14:41.720

I've used multi-term in the past, but stopped for some reason--not sure why, but perhaps it's time to try again. My config is here: https://github.com/apgwoz/emacs-config

– apgwoz – 2012-10-12T11:54:52.347

0

I use this bash function to view files (from memory):

ev() {
  emacs "$1" -nw --eval '(setq buffer-read-only t)'
}

It opens the file $1 in a read only buffer.
I don't know the best way to set a bash function as a pager, I suppose you could put it in a shellscript instead and use that as pager instead.

(Not on a computer with bash to test on)

Nifle

Posted 2012-10-11T04:36:46.963

Reputation: 31 337

or add -Q - that also reduces the startup time quite a bit by not loading any customizations or distro-provided packages. – user45469 – 2016-10-19T18:49:35.063

Yeah, it'd be trivial to convert this to a shell script. I'd probably use emacsclient though to avoid the hefty startup time. – apgwoz – 2012-10-11T18:11:22.013