Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

less(1), the terminal file pager, seems to be missing lesskey(1) and the ability to rebind the keystrokes in less. The docs claim it's there, but it doesn't work. Am I crazy or is Apple's version of less broken?

$ less -k ~/.less /etc/fstab
There is no -k option ("less --help" for help)
$ less --help | grep lesskey
  -k [file]  .  --lesskey-file=[file]
                  Use a lesskey file.
$ which lesskey less
/usr/bin/less
$ less --version | head -2
less 418
Copyright (C) 1984-2007 Mark Nudelman

I'm running Lion. It seems odd that Apple would mess with less(1) at all, it's such an old and standard Unix utility. (Less compiles easily from sources on MacOS, so I'm now using my own version.)

share|improve this question
    
As always, consider filing an enhancement bug report at developer.apple.com/bugreporter If you don't have a developer account, it's free to create one. –  Chris Page Oct 12 '11 at 4:32

1 Answer 1

up vote 5 down vote accepted

The Lion build of less indeed comes with the lesskey feature disabled, as can be seen by the customized defines.h it is being built with (line #define USERFILE 0). This doesn't mean it's broken, just that someone decided to customize the build and disable this feature for whatever reason. Sadly they neglected to update the man page, which is why it's still referring to it.

If you want this feature, building your own less from source is just a matter of ./configure && make install (which puts it into /usr/local), and you might also want to get a more recent version while you're at it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.