LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 555|回复: 6

[Help]讓wheel鍵被xterm辨識成man的滾動軸,而不是xterm的。

[复制链接]
发表于 2010-3-24 13:13:44 | 显示全部楼层 |阅读模式
在xterm裡,使用man 讀手冊的時候,wheel被當成是xterm裡的滾動卷軸了,而不是man裡的滾動捲軸,但可是在vim裡又很正常,該如何讓其它軟件都正常的辨識?請教一下,謝謝!
发表于 2010-3-24 14:38:11 | 显示全部楼层
vim 自身支持滚轴,就可以捕获滚轴事件。

man 本身不支持,所以不能用。
回复 支持 反对

使用道具 举报

发表于 2010-3-24 15:23:31 | 显示全部楼层
你的man的pager不是less吗?

less可以用滚轮的啊.

编辑/etc/man_db.conf看看
回复 支持 反对

使用道具 举报

发表于 2010-3-24 15:53:30 | 显示全部楼层
看man竟然用滚轮 效率多低啊, gg G j k /, 这五个是我最常用的
回复 支持 反对

使用道具 举报

发表于 2010-3-24 16:03:07 | 显示全部楼层
Post by adaml;2077488
看man竟然用滚轮 效率多低啊, gg G j k /, 这五个是我最常用的


我更喜欢用PageDown/PageUp。查找也是常用的。
不过从没用过GG g 。因为我没看出来行号的作用。

PS:滚轮用得多了,有点不好使了。貌似要坏了。。。我的无线鼠标啊。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-3-24 18:28:23 | 显示全部楼层
Post by kevinlei;2077478
你的man的pager不是less吗?

less可以用滚轮的啊.

编辑/etc/man_db.conf看看


export MANPAGER="less -s"就好了嗎?我在終端試過了,可是還是不起作用?還是要在man_db.conf裡面設定?下面是我的man_db.conf,麻煩幫忙看看哪兒錯了?

  1. [~]# export MANPAGER="less -s"
  2. [~]# man ls
  3. .......以下省略......滾輪還是不能動
复制代码


  1. # gdbm
  2. #
  3. # This file is used by the man-db package to configure the man and cat paths.
  4. # It is also used to provide a manpath for those without one by examining
  5. # their PATH environment variable. For details see the manpath(5) man page.
  6. #
  7. # Lines beginning with `#' are comments and are ignored. Any combination of
  8. # tabs or spaces may be used as `whitespace' separators.
  9. #
  10. # There are three mappings allowed in this file:
  11. # --------------------------------------------------------
  12. # MANDATORY_MANPATH                        manpath_element
  13. # MANPATH_MAP                path_element        manpath_element
  14. # MANDB_MAP                global_manpath        [relative_catpath]
  15. #---------------------------------------------------------
  16. # every automatically generated MANPATH includes these fields
  17. #
  18. #MANDATORY_MANPATH                         /usr/src/pvm3/man
  19. #
  20. #這裡是系統man手冊存放目錄
  21. MANDATORY_MANPATH                        /usr/man
  22. MANDATORY_MANPATH                        /usr/share/man/zh_CN
  23. MANDATORY_MANPATH                        /usr/share/man
  24. MANDATORY_MANPATH                        /usr/local/share/man
  25. #---------------------------------------------------------
  26. # set up PATH to MANPATH mapping
  27. # ie. what man tree holds man pages for what binary directory.
  28. #
  29. #                *PATH*        ->        *MANPATH*
  30. #
  31. #設定指令要去哪兒找手冊?
  32. MANPATH_MAP        /bin                        /usr/share/man/zh_CN
  33. MANPATH_MAP        /bin                        /usr/share/man
  34. MANPATH_MAP        /usr/bin                /usr/share/man/zh_CN
  35. MANPATH_MAP        /usr/bin                /usr/share/man
  36. MANPATH_MAP        /sbin                        /usr/share/man/zh_CN
  37. MANPATH_MAP        /sbin                        /usr/share/man
  38. MANPATH_MAP        /usr/sbin                /usr/share/man/zh_CN
  39. MANPATH_MAP        /usr/sbin                /usr/share/man
  40. MANPATH_MAP        /usr/local/bin                /usr/local/man
  41. MANPATH_MAP        /usr/local/bin                /usr/local/share/man
  42. MANPATH_MAP        /usr/local/sbin                /usr/local/man
  43. MANPATH_MAP        /usr/local/sbin                /usr/local/share/man
  44. MANPATH_MAP        /usr/X11R6/bin                /usr/X11R6/man
  45. MANPATH_MAP        /usr/bin/X11                /usr/X11R6/man
  46. MANPATH_MAP        /usr/games                /usr/share/man/zh_CN
  47. MANPATH_MAP        /usr/games                /usr/share/man
  48. MANPATH_MAP        /opt/bin                /opt/man
  49. MANPATH_MAP        /opt/sbin                /opt/man
  50. #---------------------------------------------------------
  51. # For a manpath element to be treated as a system manpath (as most of those
  52. # above should normally be), it must be mentioned below. Each line may have
  53. # an optional extra string indicating the catpath associated with the
  54. # manpath. If no catpath string is used, the catpath will default to the
  55. # given manpath.
  56. #
  57. # You *must* provide all system manpaths, including manpaths for alternate
  58. # operating systems, locale specific manpaths, and combinations of both, if
  59. # they exist, otherwise the permissions of the user running man/mandb will
  60. # be used to manipulate the manual pages. Also, mandb will not initialise
  61. # the database cache for any manpaths not mentioned below unless explicitly
  62. # requested to do so.
  63. #
  64. # In a per-user configuration file, this directive only controls the
  65. # location of catpaths and the creation of database caches; it has no effect
  66. # on privileges.
  67. #
  68. # Any manpaths that are subdirectories of other manpaths must be mentioned
  69. # *before* the containing manpath. E.g. /usr/man/preformat must be listed
  70. # before /usr/man.
  71. #
  72. #                *MANPATH*     ->        *CATPATH*
  73. #
  74. MANDB_MAP        /usr/man                /var/cache/man/fsstnd
  75. MANDB_MAP        /usr/share/man/zh_CN        /var/cache/man/zh_CN
  76. MANDB_MAP        /usr/share/man                /var/cache/man
  77. MANDB_MAP        /usr/local/man                /var/cache/man/oldlocal
  78. MANDB_MAP        /usr/local/share/man        /var/cache/man/local
  79. MANDB_MAP        /usr/X11R6/man                /var/cache/man/X11R6
  80. MANDB_MAP        /opt/man                /var/cache/man/opt
  81. #
  82. #---------------------------------------------------------
  83. # Program definitions.  These are commented out by default as the value
  84. # of the definition is already the default.  To change: uncomment a
  85. # definition and modify it.
  86. #
  87. #主要的功能在這裡設
  88. #DEFINE         pager        less -s
  89. #DEFINE         cat        cat
  90. #DEFINE         tr        tr '\255\267\264\327' '\055\157\047\170'
  91. #DEFINE                grep        grep
  92. #DEFINE         troff         groff -mandoc
  93. #DEFINE         nroff         nroff -mandoc
  94. #DEFINE         eqn         eqn
  95. #DEFINE         neqn        neqn
  96. #DEFINE         tbl         tbl
  97. #DEFINE         col         col
  98. #DEFINE         vgrind        
  99. #DEFINE         refer         refer
  100. #DEFINE         grap        
  101. #DEFINE         pic         pic -S
  102. #
  103. #DEFINE                compressor        gzip -c7
  104. #---------------------------------------------------------
  105. # Misc definitions: same as program definitions above.
  106. #
  107. #DEFINE                whatis_grep_flags                -i
  108. #DEFINE                apropos_grep_flags                -iEw
  109. #DEFINE                apropos_regex_grep_flags        -iE
  110. #---------------------------------------------------------
  111. # Section names. Manual sections will be searched in the order listed here;
  112. # the default is 1, n, l, 8, 3, 0, 2, 5, 4, 9, 6, 7. Multiple SECTION
  113. # directives may be given for clarity, and will be concatenated together in
  114. # the expected way.
  115. # If a particular extension is not in this list (say, 1mh), it will be
  116. # displayed with the rest of the section it belongs to. The effect of this
  117. # is that you only need to explicitly list extensions if you want to force a
  118. # particular order. Sections with extensions should usually be adjacent to
  119. # their main section (e.g. "1 1mh 8 ...").
  120. #
  121. #這裡是查找的次序,預設數字越小越前面
  122. SECTION                1 n l 8 3 0 2 5 4 9 6 7
  123. #
  124. #---------------------------------------------------------
  125. # Range of terminal widths permitted when displaying cat pages. If the
  126. # terminal falls outside this range, cat pages will not be created (if
  127. # missing) or displayed.
  128. #
  129. #MINCATWIDTH        80
  130. #MAXCATWIDTH        80
  131. #
  132. # If CATWIDTH is set to a non-zero number, cat pages will always be
  133. # formatted for a terminal of the given width, regardless of the width of
  134. # the terminal actually being used. This should generally be within the
  135. # range set by MINCATWIDTH and MAXCATWIDTH.
  136. #
  137. #CATWIDTH        0
  138. #
  139. #---------------------------------------------------------
  140. # Flags.
  141. # NOCACHE keeps man from creating cat pages.
  142. #NOCACHE
复制代码
回复 支持 反对

使用道具 举报

发表于 2010-3-24 19:17:12 | 显示全部楼层
Post by jiuny0209;2077533
export MANPAGER="less -s"就好了嗎?我在終端試過了,可是還是不起作用?還是要在man_db.conf裡面設定?下面是我的man_db.conf,麻煩幫忙看看哪兒錯了?

  1. [~]# export MANPAGER="less -s"
  2. [~]# man ls
  3. .......以下省略......滾輪還是不能動
复制代码


  1. # gdbm
  2. #
  3. # This file is used by the man-db package to configure the man and cat paths.
  4. # It is also used to provide a manpath for those without one by examining
  5. # their PATH environment variable. For details see the manpath(5) man page.
  6. #
  7. # Lines beginning with `#' are comments and are ignored. Any combination of
  8. # tabs or spaces may be used as `whitespace' separators.
  9. #
  10. # There are three mappings allowed in this file:
  11. # --------------------------------------------------------
  12. # MANDATORY_MANPATH                        manpath_element
  13. # MANPATH_MAP                path_element        manpath_element
  14. # MANDB_MAP                global_manpath        [relative_catpath]
  15. #---------------------------------------------------------
  16. # every automatically generated MANPATH includes these fields
  17. #
  18. #MANDATORY_MANPATH                         /usr/src/pvm3/man
  19. #
  20. #這裡是系統man手冊存放目錄
  21. MANDATORY_MANPATH                        /usr/man
  22. MANDATORY_MANPATH                        /usr/share/man/zh_CN
  23. MANDATORY_MANPATH                        /usr/share/man
  24. MANDATORY_MANPATH                        /usr/local/share/man
  25. #---------------------------------------------------------
  26. # set up PATH to MANPATH mapping
  27. # ie. what man tree holds man pages for what binary directory.
  28. #
  29. #                *PATH*        ->        *MANPATH*
  30. #
  31. #設定指令要去哪兒找手冊?
  32. MANPATH_MAP        /bin                        /usr/share/man/zh_CN
  33. MANPATH_MAP        /bin                        /usr/share/man
  34. MANPATH_MAP        /usr/bin                /usr/share/man/zh_CN
  35. MANPATH_MAP        /usr/bin                /usr/share/man
  36. MANPATH_MAP        /sbin                        /usr/share/man/zh_CN
  37. MANPATH_MAP        /sbin                        /usr/share/man
  38. MANPATH_MAP        /usr/sbin                /usr/share/man/zh_CN
  39. MANPATH_MAP        /usr/sbin                /usr/share/man
  40. MANPATH_MAP        /usr/local/bin                /usr/local/man
  41. MANPATH_MAP        /usr/local/bin                /usr/local/share/man
  42. MANPATH_MAP        /usr/local/sbin                /usr/local/man
  43. MANPATH_MAP        /usr/local/sbin                /usr/local/share/man
  44. MANPATH_MAP        /usr/X11R6/bin                /usr/X11R6/man
  45. MANPATH_MAP        /usr/bin/X11                /usr/X11R6/man
  46. MANPATH_MAP        /usr/games                /usr/share/man/zh_CN
  47. MANPATH_MAP        /usr/games                /usr/share/man
  48. MANPATH_MAP        /opt/bin                /opt/man
  49. MANPATH_MAP        /opt/sbin                /opt/man
  50. #---------------------------------------------------------
  51. # For a manpath element to be treated as a system manpath (as most of those
  52. # above should normally be), it must be mentioned below. Each line may have
  53. # an optional extra string indicating the catpath associated with the
  54. # manpath. If no catpath string is used, the catpath will default to the
  55. # given manpath.
  56. #
  57. # You *must* provide all system manpaths, including manpaths for alternate
  58. # operating systems, locale specific manpaths, and combinations of both, if
  59. # they exist, otherwise the permissions of the user running man/mandb will
  60. # be used to manipulate the manual pages. Also, mandb will not initialise
  61. # the database cache for any manpaths not mentioned below unless explicitly
  62. # requested to do so.
  63. #
  64. # In a per-user configuration file, this directive only controls the
  65. # location of catpaths and the creation of database caches; it has no effect
  66. # on privileges.
  67. #
  68. # Any manpaths that are subdirectories of other manpaths must be mentioned
  69. # *before* the containing manpath. E.g. /usr/man/preformat must be listed
  70. # before /usr/man.
  71. #
  72. #                *MANPATH*     ->        *CATPATH*
  73. #
  74. MANDB_MAP        /usr/man                /var/cache/man/fsstnd
  75. MANDB_MAP        /usr/share/man/zh_CN        /var/cache/man/zh_CN
  76. MANDB_MAP        /usr/share/man                /var/cache/man
  77. MANDB_MAP        /usr/local/man                /var/cache/man/oldlocal
  78. MANDB_MAP        /usr/local/share/man        /var/cache/man/local
  79. MANDB_MAP        /usr/X11R6/man                /var/cache/man/X11R6
  80. MANDB_MAP        /opt/man                /var/cache/man/opt
  81. #
  82. #---------------------------------------------------------
  83. # Program definitions.  These are commented out by default as the value
  84. # of the definition is already the default.  To change: uncomment a
  85. # definition and modify it.
  86. #
  87. #主要的功能在這裡設
  88. #DEFINE         pager        less -s
  89. #DEFINE         cat        cat
  90. #DEFINE         tr        tr '\255\267\264\327' '\055\157\047\170'
  91. #DEFINE                grep        grep
  92. #DEFINE         troff         groff -mandoc
  93. #DEFINE         nroff         nroff -mandoc
  94. #DEFINE         eqn         eqn
  95. #DEFINE         neqn        neqn
  96. #DEFINE         tbl         tbl
  97. #DEFINE         col         col
  98. #DEFINE         vgrind        
  99. #DEFINE         refer         refer
  100. #DEFINE         grap        
  101. #DEFINE         pic         pic -S
  102. #
  103. #DEFINE                compressor        gzip -c7
  104. #---------------------------------------------------------
  105. # Misc definitions: same as program definitions above.
  106. #
  107. #DEFINE                whatis_grep_flags                -i
  108. #DEFINE                apropos_grep_flags                -iEw
  109. #DEFINE                apropos_regex_grep_flags        -iE
  110. #---------------------------------------------------------
  111. # Section names. Manual sections will be searched in the order listed here;
  112. # the default is 1, n, l, 8, 3, 0, 2, 5, 4, 9, 6, 7. Multiple SECTION
  113. # directives may be given for clarity, and will be concatenated together in
  114. # the expected way.
  115. # If a particular extension is not in this list (say, 1mh), it will be
  116. # displayed with the rest of the section it belongs to. The effect of this
  117. # is that you only need to explicitly list extensions if you want to force a
  118. # particular order. Sections with extensions should usually be adjacent to
  119. # their main section (e.g. "1 1mh 8 ...").
  120. #
  121. #這裡是查找的次序,預設數字越小越前面
  122. SECTION                1 n l 8 3 0 2 5 4 9 6 7
  123. #
  124. #---------------------------------------------------------
  125. # Range of terminal widths permitted when displaying cat pages. If the
  126. # terminal falls outside this range, cat pages will not be created (if
  127. # missing) or displayed.
  128. #
  129. #MINCATWIDTH        80
  130. #MAXCATWIDTH        80
  131. #
  132. # If CATWIDTH is set to a non-zero number, cat pages will always be
  133. # formatted for a terminal of the given width, regardless of the width of
  134. # the terminal actually being used. This should generally be within the
  135. # range set by MINCATWIDTH and MAXCATWIDTH.
  136. #
  137. #CATWIDTH        0
  138. #
  139. #---------------------------------------------------------
  140. # Flags.
  141. # NOCACHE keeps man from creating cat pages.
  142. #NOCACHE
复制代码



#DEFINE         pager        less -s

这一行就是了.

P.S. 你装了less吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表