linux 设置中文版man手册 ,让你同时拥有英文与中文版,学习带劲

下载源码包:

wget https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/manpages-zh-1.5.2.tar.bz2/cab232c7bb49b214c2f7ee44f7f35900/manpages-zh-1.5.2.tar.bz2

解压所需要的软件依赖:

yum install bzip2

解压包:

tar jxvf manpages-zh-1.5.2.tar.bz2

设置编译参数:

./configure --disable-zhtw

编译安装:

make && make install

为了不抵消man,新建一个cman命令作为中文查询:

cd ~

vim .bash_profile

在.bash_profile中增加:
alias cman=‘man -M /usr/local/share/man/zh_CN’

更新bash_profile 使其生效:

source .bash_profile
下面是我的.bash_profile内容:

  1 # .bash_profile
  2 
  3 # Get the aliases and functions
  4 if [ -f ~/.bashrc ]; then
  5     . ~/.bashrc
  6 fi
  7 
  8 # User specific environment and startup programs
  9 
 10 PATH=$PATH:$HOME/bin
 11 
 12 export PATH
 13 
 14 #cman Chinese
 15 alias cman='man -M /usr/local/share/man/zh_CN'

可以复制上面的代码来自己的vim编辑样式和代码缩进。

验证是否成功

cman man

转载于:https://www.cnblogs.com/ChairmanYSL/p/12194572.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章