What is a way to read man pages in vim without using temporary files

前端 未结 11 1332
萌比男神i
萌比男神i 2020-12-12 19:36

I want to be able to read man pages in vim. For some reason, it seems that vim isn\'t able to read the output of programs through piping (i.e \'(man ls) | vi\' doesn\'t seem

11条回答
  •  星月不相逢
    2020-12-12 20:26

    For some reason, it seems that vim isn't able to read the output of programs through piping […]

    According to the man-page, you need to specify a file of - to get it to read from standard input; so:

    man ls | vi -
    

    If that doesn't work, you might try using process substitution:

    vi <(man $1)
    

    which creates a sort of pseudo-file and passes it to vi.

提交回复
热议问题