Skip to content

Commit

Permalink
Workaround for multi-byte environment in man command
Browse files Browse the repository at this point in the history
  • Loading branch information
crazymaster committed Aug 2, 2015
1 parent e1f9e2b commit 75553c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion autoload/ref/man.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ scriptencoding utf-8

" config. {{{1
if !exists('g:ref_man_cmd') " {{{2
let g:ref_man_cmd = executable('man') ? 'man' : ''
" '-Tutf8' option is workaround for multi-byte environment.
" The option might be unnecessary someday.
let g:ref_man_cmd = executable('man') ? 'man -Tutf8' : ''
endif

if !exists('g:ref_man_lang') " {{{2
Expand Down
11 changes: 7 additions & 4 deletions doc/ref-man.jax
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ manpage が開かれるでしょう。
g:ref_man_cmd *g:ref_man_cmd*
man コマンドを指定します。コマンドとその引数を含む
|List| も指定できます。
デフォルト値は、実行可能ならば "man" です。そうでな
ければ "" です。
Note: MacVim を使ってる場合、以下のようにしてダミーの
ページャを設定する必要があるかもしれません。 >
デフォルト値は、実行可能ならば "man -Tutf8" です。そう
でなければ "" です。"-Tutf8" オプションはマルチバイト
環境のための回避策です。このオプションはいつか要らなく
なるかもしれません。
Note: MacVim を使っている場合、~/.vimrc で以下のように
して、man コマンドのダミーのページャを設定する必要があ
るかもしれません。 >
let g:ref_man_cmd = "man -P cat"
g:ref_man_lang *g:ref_man_lang*
Expand Down
6 changes: 4 additions & 2 deletions doc/ref-man.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ CUSTOMIZING *ref-man-customizing*
g:ref_man_cmd *g:ref_man_cmd*
Specifies the man command. This allows a |List| that
includes command and arguments.
The default value is "man" if it is executable.
Otherwise, it is "".
The default value is "man -Tutf8" if it is executable.
Otherwise, it is "". "-Tutf8" option is workaround
for multi-byte environment. The option might be
unnecessary someday.
Note: If you are a MacVim user, you may want to
specify a dummy pager of man command with the
following line in your ~/.vimrc. >
Expand Down

0 comments on commit 75553c4

Please sign in to comment.