Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found many sites saying that vim can be used as a pager like less with syntax highlighting.

So to make it work I added this line to my .bash_aliases file:

alias vless='vim -u /usr/share/vim/vim73/macros/less.vim'

but when I run something like

ps -A | vless 

It gives this output and exits without showing me the output of ps:

Vim: Warning: Input is not from a terminal

Please help!

share|improve this question
Related: Terminal borked after invoking Vim with xargs at Vim SE – kenorb Feb 19 '15 at 15:19
up vote 1 down vote accepted

I found the problem. The above command vim -u /usr/share/vim/vim73/macros/less.vim is not handling input from STDIN correctly. However, opening a file with the above works just fine.

Fortunately the Vim installation provides a shell script which loads less.vim and handles the case where input is from STDIN correctly. So changing the alias to this works:

alias vless = '/usr/share/vim/vim73/macros/'
share|improve this answer

Your Answer


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.