Display Ruler Information in less (cursor position)

3

Sometimes, if I know I'm not going to do any edits in a window, I use less instead of vi. However, vi displays percentage and cursor position in the bottom right corner. Is there a way to mimic this behavior when using less?

PS - I'm 98% that I could see this ruler-type information at my last job, but maybe they were using an older version or an alias?

I tried to find the information in these locations:
vi set ruler and line numbers in less

goodguy5

Posted 2016-03-28T16:09:35.987

Reputation: 171

I know that I could, in theory, use vi -R, but that's not the question. :) – goodguy5 – 2016-04-05T15:07:32.440

Answers

4

I was able to reach out to an old coworker and get their less alias.

less -M

From the man-page:

-m or --long-prompt
Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon.

-M or --LONG-PROMPT
Causes less to prompt even more verbosely than more.

This experience has made me think that vi might be better for most things...

goodguy5

Posted 2016-03-28T16:09:35.987

Reputation: 171