Skip to content

Commit f2b41b6

Browse files
committed
Update by original
1 parent 21bf191 commit f2b41b6

File tree

2 files changed

+110
-94
lines changed

2 files changed

+110
-94
lines changed

doc/pi_netrw.jax

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*pi_netrw.txt* For Vim バージョン 9.1. Last change: 2024 Oct 27
1+
*pi_netrw.txt* For Vim バージョン 9.1. Last change: 2024 Nov 01
22

33
------------------------------------------------
44
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -55,9 +55,10 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
5555
水平分割ウィンドウを使ったブラウジング..............|netrw-o|
5656
タブを使ったブラウジング............................|netrw-t|
5757
垂直分割ウィンドウを使ったブラウジング..............|netrw-v|
58-
ファイルの権限を変更................................|netrw-gp|
5958
一覧表示スタイル変更 (thin wide long tree)..........|netrw-i|
6059
ブックマークしたディレクトリに移動..................|netrw-gb|
60+
ドットファイルのクイック表示/非表示.................|netrw-gh|
61+
ローカルのみのファイル権限の変更....................|netrw-gp|
6162
前方のディレクトリに移動............................|netrw-u|
6263
後方のディレクトリに移動............................|netrw-U|
6364
特殊ハンドラでブラウジングをカスタマイズ............|netrw-x|
@@ -1434,7 +1435,6 @@ NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
14341435
どちらのコマンドも、本当に削除していいかどうかを確認するダイアログが最初に表示
14351436
されます。ファイルを削除する権限がない場合はエラーメッセージが表示されます。
14361437

1437-
*netrw-gx* *Open* *Launch*
14381438
☆特殊ハンドラでブラウジングをカスタマイズ *netrw-x* *netrw-handler* {{{2
14391439

14401440
html, gif, jpeg, (word/office) doc などのファイルは専用ハンドラ (コンピュータ
@@ -1443,7 +1443,7 @@ html, gif, jpeg, (word/office) doc などのファイルは専用ハンドラ (
14431443

14441444
* ファイルパスの上にあるカーソルで gx を押すか、netrw バッファで x を
14451445
押す。前者は |g:netrw_nogx| 変数を定義することで無効にできます。
1446-
* コマンド ラインで、:Open <path> と入力します
1446+
* コマンド ラインで、:Open <path> と入力します。下記 |:Open| を参照。
14471447

14481448
ビジュアルモード (|visual-start| を参照) を使用して、特殊ハンドラが使用するテ
14491449
キストを選択することもできます。通常、gx はカーソルの下のテキストを取得するた
@@ -1453,47 +1453,55 @@ html, gif, jpeg, (word/office) doc などのファイルは専用ハンドラ (
14531453
に注意してください。または、ビジュアル選択 (|visual-block| を参照) を行ってか
14541454
ら gx を押すことで、gx が使用するテキストを選択することもできます。
14551455

1456-
選択関数は、関数 Netrw_get_URL_<filetype> を追加することで各ファイルタイプに適
1457-
応できます<filetype>&filetype で指定します。
1456+
選択関数は、関数 `Netrw_get_URL_<filetype>` を追加することで各ファイルタイプに
1457+
適応できます<filetype>'filetype' で指定します。
14581458
この関数は、gx が使用する URL またはファイル名を返す必要があり、空の文字列を返
14591459
す場合はデフォルトの動作に戻ります。
14601460
例えば、Markdown と HTML のリンク用の特別なハンドラは、
14611461
>
1462-
" 正確なカーソル位置に関係なく、gx を隠しリンクで動作させる関数 Netrw_get_URL_markdown()
1463-
" 次のような markdown URL [link text](http://ya.ru 'yandex search')
1464-
try
1465-
let save_view = winsaveview()
1466-
if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
1467-
return matchstr(getline('.')[col('.')-1:], '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)')
1468-
endif
1469-
finally
1470-
call winrestview(save_view)
1471-
return ''
1472-
endtry
1473-
endfunction
1474-
1475-
function Netrw_get_URL_html()
1476-
" 次のような HTML URL <a href='http://www.python.org'>Python is here</a>
1477-
" <a href="http://www.python.org"/>
1478-
try
1479-
let save_view = winsaveview()
1480-
if searchpair('<a\s\+href=', '', '\%(</a>\|/>\)\zs', 'cbW', '', line('.')) > 0
1481-
return matchstr(getline('.')[col('.') - 1 : ],
1482-
\ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>')
1483-
endif
1484-
finally
1485-
call winrestview(save_view)
1486-
return ''
1487-
endtry
1488-
endfunction
1462+
" 正確なカーソル位置に関係なく、gx が concealed なリンクで動作するようにする: >
1463+
1464+
function Netrw_get_URL_markdown()
1465+
" 次のような markdown URL [link text](http://ya.ru 'yandex search')
1466+
try
1467+
let save_view = winsaveview()
1468+
if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
1469+
return matchstr(getline('.')[col('.')-1:],
1470+
\ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)')
1471+
endif
1472+
finally
1473+
call winrestview(save_view)
1474+
return ''
1475+
endtry
1476+
endfunction
1477+
1478+
function Netrw_get_URL_html()
1479+
" 次のような HTML URL <a href='http://www.python.org'>Python is here</a>
1480+
" <a href="http://www.python.org"/>
1481+
try
1482+
let save_view = winsaveview()
1483+
if searchpair('<a\s\+href=', '', '\%(</a>\|/>\)\zs', 'cbW', '', line('.')) > 0
1484+
return matchstr(getline('.')[col('.') - 1 : ],
1485+
\ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>')
1486+
endif
1487+
finally
1488+
call winrestview(save_view)
1489+
return ''
1490+
endtry
1491+
endfunction
14891492
<
1490-
14911493
ファイルパス以外に、カーソルの下のテキストが URL である場合もあります。Netrw
14921494
は、デフォルトで次の正規表現を使用して、カーソルの下のテキストが URL であるか
14931495
どうかを判断します。
14941496
>
1495-
g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}'
1497+
:let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}'
14961498
<
1499+
関連する設定変数:
1500+
|g:netrw_gx| gx がカーソルの下のテキストを取得する方法を制御する
1501+
|g:netrw_nogx| 編集中に gx マップを防止する
1502+
|g:netrw_suppress_gx_mesg| gx のブラウザメッセージの抑制を制御する
1503+
1504+
☆ファイルを開いてアプリを起動する *netrw-gx* *:Open* *:Launch* {{{2
14971505

14981506
Netrw は、次の方法で特殊ハンドラを決定します:
14991507

@@ -1507,26 +1515,26 @@ Netrw は、次の方法で特殊ハンドラを決定します:
15071515
* Mac OS X では : open が使用されます
15081516
* Linux では : xdg-open が使用されます
15091517

1510-
適切なハンドラでファイル <filepath> を開くには、以下を入力します
1511-
1512-
:Open <filepath>
1518+
適切なハンドラでパス (または URL) <path> を開くには、以下を入力します。 >
15131519
1520+
:Open <path>
1521+
<
15141522
シェルでも Vim のコマンドラインでもエスケープは必要ありません。
15151523

15161524
特定のアプリケーションを起動するには、<app> <args>、多くの場合、<args>
1517-
<filepath> です
1525+
<path> です >
15181526
1519-
:Launch <app> <args>.
1527+
:Launch <app> <args>.
15201528
1521-
<args> は作為的に複雑になる可能性があり、特に多くのファイルパスが含まれる場合、
1522-
エスケープはユーザーに任されます。
1529+
<<args> は作為的に複雑になる可能性があり、特に多くのファイルパスが含まれる場
1530+
合、エスケープはユーザーに任されます。
15231531

1524-
関連設定:
1525-
|g:netrw_gx| gx がどのようにカーソル位置のテキストを取得するか制御
1526-
する
1527-
|g:netrw_nogx| 編集中 gx マップを無効にする
1528-
|g:netrw_suppress_gx_mesg| gx がブラウザーの出力を抑制するか制御する
1532+
g:loaded_netrwPlugin を設定して netrw プラグインを無効にした場合
1533+
(|netrw-noload| を参照) は、以下が使用できます >
15291534
1535+
:call netrw#Launch('<app> <args>')
1536+
:call netrw#Open('<path>')
1537+
<
15301538
*netrw-curdir*
15311539
☆ブックマークを削除する *netrw-mB* {{{2
15321540

en/pi_netrw.txt

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Oct 27
1+
*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 01
22

33
------------------------------------------------
44
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -54,9 +54,10 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright*
5454
Browsing With A Horizontally Split Window...........|netrw-o|
5555
Browsing With A New Tab.............................|netrw-t|
5656
Browsing With A Vertically Split Window.............|netrw-v|
57-
Change File Permission..............................|netrw-gp|
58-
Change Listing Style.(thin wide long tree)..........|netrw-i|
57+
Change Listing Style (thin wide long tree)..........|netrw-i|
5958
Changing To A Bookmarked Directory..................|netrw-gb|
59+
Quick hide/unhide of dot-files......................|netrw-gh|
60+
Changing local-only File Permission.................|netrw-gp|
6061
Changing To A Predecessor Directory.................|netrw-u|
6162
Changing To A Successor Directory...................|netrw-U|
6263
Customizing Browsing With A Special Handler.........|netrw-x|
@@ -1469,7 +1470,6 @@ With either form of the command, netrw will first ask for confirmation
14691470
that the removal is in fact what you want to do. If netrw doesn't have
14701471
permission to remove a file, it will issue an error message.
14711472

1472-
*netrw-gx* *Open* *Launch*
14731473
CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2
14741474

14751475
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
@@ -1479,7 +1479,7 @@ operating system). Netrw allows one to invoke such special handlers by:
14791479
* hitting gx with the cursor atop the file path or alternatively x
14801480
in a netrw buffer; the former can be disabled by defining the
14811481
|g:netrw_nogx| variable
1482-
* when in command line, typing :Open <path>
1482+
* when in command line, typing :Open <path>, see |:Open| below.
14831483

14841484
One may also use visual mode (see |visual-start|) to select the text that the
14851485
special handler will use. Normally gx checks for a close-by URL or file name
@@ -1490,47 +1490,54 @@ select the text to be used by gx by making a visual selection (see
14901490
|visual-block|) and then pressing gx.
14911491

14921492
The selection function can be adapted for each filetype by adding a function
1493-
Netrw_get_URL_<filetype>, where <filetype> is given by &filetype.
1493+
`Netrw_get_URL_<filetype>`, where <filetype> is given by the 'filetype'.
14941494
The function should return the URL or file name to be used by gx, and will
14951495
fall back to the default behavior if it returns an empty string.
14961496
For example, special handlers for links Markdown and HTML are
1497-
>
1498-
" make gx work on concealed links regardless of exact cursor position
1499-
function Netrw_get_URL_markdown()
1500-
" markdown URL such as [link text](http://ya.ru 'yandex search')
1501-
try
1502-
let save_view = winsaveview()
1503-
if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
1504-
return matchstr(getline('.')[col('.')-1:], '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)')
1505-
endif
1506-
finally
1507-
call winrestview(save_view)
1508-
return ''
1509-
endtry
1510-
endfunction
1511-
1512-
function Netrw_get_URL_html()
1513-
" HTML URL such as <a href='http://www.python.org'>Python is here</a>
1514-
" <a href="http://www.python.org"/>
1515-
try
1516-
let save_view = winsaveview()
1517-
if searchpair('<a\s\+href=', '', '\%(</a>\|/>\)\zs', 'cbW', '', line('.')) > 0
1518-
return matchstr(getline('.')[col('.') - 1 : ],
1519-
\ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>')
1520-
endif
1521-
finally
1522-
call winrestview(save_view)
1523-
return ''
1524-
endtry
1525-
endfunction
1526-
<
15271497

1498+
" make gx work on concealed links regardless of exact cursor position: >
1499+
1500+
function Netrw_get_URL_markdown()
1501+
" markdown URL such as [link text](http://ya.ru 'yandex search')
1502+
try
1503+
let save_view = winsaveview()
1504+
if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
1505+
return matchstr(getline('.')[col('.')-1:],
1506+
\ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)')
1507+
endif
1508+
finally
1509+
call winrestview(save_view)
1510+
return ''
1511+
endtry
1512+
endfunction
1513+
1514+
function Netrw_get_URL_html()
1515+
" HTML URL such as <a href='http://www.python.org'>Python is here</a>
1516+
" <a href="http://www.python.org"/>
1517+
try
1518+
let save_view = winsaveview()
1519+
if searchpair('<a\s\+href=', '', '\%(</a>\|/>\)\zs', 'cbW', '', line('.')) > 0
1520+
return matchstr(getline('.')[col('.') - 1 : ],
1521+
\ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>')
1522+
endif
1523+
finally
1524+
call winrestview(save_view)
1525+
return ''
1526+
endtry
1527+
endfunction
1528+
<
15281529
Other than a file path, the text under the cursor may be a URL. Netrw uses
15291530
by default the following regular expression to determine if the text under the
15301531
cursor is a URL:
15311532
>
1532-
g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}'
1533+
:let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}'
15331534
<
1535+
Associated setting variables:
1536+
|g:netrw_gx| control how gx picks up the text under the cursor
1537+
|g:netrw_nogx| prevent gx map while editing
1538+
|g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages
1539+
1540+
OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2
15341541

15351542
Netrw determines which special handler by the following method:
15361543

@@ -1544,24 +1551,25 @@ Netrw determines which special handler by the following method:
15441551
* for Mac OS X : open is used.
15451552
* for Linux : xdg-open is used.
15461553

1547-
To open a file <filepath> by the appropriate handler, type
1548-
1549-
:Open <filepath>
1554+
To open a path (or URL) <path> by the appropriate handler, type >
15501555
1551-
No escaping, neither for the shell, nor for Vim's command-line is needed.
1556+
:Open <path>
1557+
<
1558+
No escaping, neither for the shell nor for Vim's command-line, is needed.
15521559

1553-
To launch a specific application <app> <args>, often <args> being <filepath>,
1560+
To launch a specific application <app> <args>, often <args> being <path> >
15541561
1555-
:Launch <app> <args>.
1562+
:Launch <app> <args>.
15561563
15571564
Since <args> can be arbitrarily complex, in particular contain many file
15581565
paths, the escaping is left to the user.
15591566

1560-
Associated setting variables:
1561-
|g:netrw_gx| control how gx picks up the text under the cursor
1562-
|g:netrw_nogx| prevent gx map while editing
1563-
|g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages
1567+
If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see
1568+
|netrw-noload|), then you can use >
15641569
1570+
:call netrw#Launch('<app> <args>')
1571+
:call netrw#Open('<path>')
1572+
<
15651573
*netrw-curdir*
15661574
DELETING BOOKMARKS *netrw-mB* {{{2
15671575

0 commit comments

Comments
 (0)