tools/vim

리눅스 man을 vim으로 열어보자

seul chan 2021. 1. 6. 22:05

Use vim for read man page

I don't like to see man or help texts with less. So I try to find out the way to look man page with vim.

I found vim-man - it's quite old but still fascinating.

https://github.com/vim-utils/vim-man

Install with vim-plug

in your ~/.vimrc,

...

Plug 'vim-utils/vim-man'
...

And install plugin (:source %, :PlugInstall)

Then you can now open the man page from vim with :Man command.

But still it's annoying to open vim for man page, then you can use the script from the repository.

(Mac OS based commands)

Add /usr/local/bin/viman file and add the contents below.

#! /bin/sh
vim -c "Man $1 $2" -c 'silent only'
# Add file and add contents above
$ vi /usr/local/bin/viman

# Give execution permission
$ chmod +x /usr/local/bin/viman

# Then you can use viman command instead of vim
$ viman ls

If you want to use viman instead of man, add alias to your bashrc (or ~/.zshrc)

alias man=viman

'tools > vim' 카테고리의 다른 글

Incrementing selected numbers in vim  (0) 2021.03.31
vimgrep 기본 사용법  (0) 2021.01.05
ipython에서 vim 단축키 사용하기  (0) 2021.01.03
vim help text 새 탭에서 보기  (0) 2021.01.02
vim resize split size: vim 창 크기 조절하기  (0) 2021.01.01