bsdpower.com

Not clearing terminal on Linux

One thing I like about BSD operating systems is that programs like less and vi do not clear the screen when they quit, allowing e.g. to refer to the output they were showing several pages back in terminal history.

I looked up how to achieve the same behavior on Linux and surprisingly it is not difficult.

less

In ~/.zshrc:

alias less='less -X'

vim

Per this topic, in ~/.vimrc:

set t_ti= t_te=

Comment syntax in vimrc files is, per this Stack Overflow post, a double quote in front of the comment text.