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?
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?
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.
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
.
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.
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.3470
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)
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
The lesskey pointer is very helpful--thanks! – apgwoz – 2012-10-11T18:10:26.693