-1

I want to make the default editor for man pages to be vi. Right now it is something else.

I know it is something else, because when I try to do a case insensitive search, it doesn't work the way it does in vim:

/someWord\c

the above does not work in man pages, but it does work in vim.

How do I find out the editor for man pages? thank

makansij
  • 9,303
  • 37
  • 105
  • 183

2 Answers2

3

The default pager for man is less. When -i is passed to less searches with no capital letters are case-insensitive.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

The default pager for man is less. To use vim as the pager, just place the following code in your ~/.bash_profile or ~/.zshrc.

export MANPAGER="/bin/sh -c \"col -b | vim -c 'set ft=man ts=8 nomod nolist nonu noma' -\""

The above command uses the col utility to remove extra ^H (backspace) characters. Next it pipe's the output to vim with the options below.

  • ft=man enables the coloring of the man page.
  • ts=8 ensures the width of tab characters matches less.
  • nomod removes the modification warning when trying to quit.
  • nonu removes line numbers.
  • nolist disables listchars so trailing whitespace and extra tabs are not highlighted.
  • noma prevents the buffer contents from being changed.
byaruhaf
  • 4,128
  • 2
  • 32
  • 50