Skip to content

Commit 4d7d7f1

Browse files
authored
Merge pull request #282 from mnishz/indent_for_Vim_8.1
Update indent from Vim 8.0 to 8.1
2 parents a94d86b + f7ed226 commit 4d7d7f1

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

doc/indent.jax

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*indent.txt* For Vim バージョン 8.0. Last change: 2014 Dec 06
1+
*indent.txt* For Vim バージョン 8.1. Last change: 2018 Apr 04
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -414,9 +414,10 @@ CTRL-TやCTRL-Dを使用してインデントを変更した後では、Vimは
414414
<
415415
*cino-(*
416416
(N 閉じていない丸カッコ内では開き丸カッコのあるラインより N 文字イ
417-
ンデントする。インデント量は1つの丸カッコにつき 'shiftwidth'
418-
つ増える。N が 0 であるか、閉じていない丸カッコが行頭にある時は、
419-
インデント位置はそのカッコ後の非空白文字の位置になる。
417+
ンデントする。インデント量は 1 つの丸カッコの追加につき
418+
'shiftwidth' ずつ増える。N が 0 であるか、閉じていない丸カッコが
419+
行頭にある時は、インデント位置はそのカッコ後の非空白文字の位置に
420+
なる。
420421
(省略値 'shiftwidth' * 2)
421422

422423
cino= cino=(0 >
@@ -428,7 +429,7 @@ CTRL-TやCTRL-Dを使用してインデントを変更した後では、Vimは
428429
{ {
429430
<
430431
*cino-u*
431-
uN (N と同じだが、一段階内側の丸カッコについての設定
432+
uN (N と同じだが、一段階内側にネストしている丸カッコについての設定
432433
(省略値 'shiftwidth')
433434

434435
cino= cino=u2 >
@@ -890,6 +891,26 @@ switch() ブロック内の 'case:' と 'default:' をインデントさせる
890891
PHP では 'case/default' ブロックの中で波カッコは不要なので、余計なインデントを
891892
避けるため、'case:' と 'default:' は 'switch()' と同じレベルにインデントされ
892893
る。上記のオプションを使うことで古いインデント形式を使うことができる。
894+
-------------
895+
896+
*PHP_noArrowMatching*
897+
デフォルトでは、インデントスクリプトは複数行にまたがった関数呼び出しを '->' の
898+
位置に合わせてインデントする: >
899+
900+
$user_name_very_long->name()
901+
->age()
902+
->info();
903+
904+
このオプションを 1 に設定することによって、従来のインデント方法に戻すことがで
905+
きる: >
906+
:let g:PHP_noArrowMatching = 1
907+
908+
以下の結果を得る: >
909+
910+
$user_name_very_long->name()
911+
->age()
912+
->info();
913+
893914
894915
895916
PYTHON *ft-python-indent*

en/indent.txt

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*indent.txt* For Vim version 8.0. Last change: 2014 Dec 06
1+
*indent.txt* For Vim version 8.1. Last change: 2018 Apr 04
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -414,10 +414,10 @@ The examples below assume a 'shiftwidth' of 4.
414414
*cino-(*
415415
(N When in unclosed parentheses, indent N characters from the line
416416
with the unclosed parentheses. Add a 'shiftwidth' for every
417-
unclosed parentheses. When N is 0 or the unclosed parentheses
418-
is the first non-white character in its line, line up with the
419-
next non-white character after the unclosed parentheses.
420-
(default 'shiftwidth' * 2).
417+
extra unclosed parentheses. When N is 0 or the unclosed
418+
parentheses is the first non-white character in its line, line
419+
up with the next non-white character after the unclosed
420+
parentheses. (default 'shiftwidth' * 2).
421421

422422
cino= cino=(0 >
423423
if (c1 && (c2 || if (c1 && (c2 ||
@@ -428,7 +428,8 @@ The examples below assume a 'shiftwidth' of 4.
428428
{ {
429429
<
430430
*cino-u*
431-
uN Same as (N, but for one level deeper. (default 'shiftwidth').
431+
uN Same as (N, but for one nesting level deeper.
432+
(default 'shiftwidth').
432433

433434
cino= cino=u2 >
434435
if (c123456789 if (c123456789
@@ -906,6 +907,25 @@ In PHP braces are not required inside 'case/default' blocks therefore 'case:'
906907
and 'default:' are indented at the same level than the 'switch()' to avoid
907908
meaningless indentation. You can use the above option to return to the
908909
traditional way.
910+
-------------
911+
912+
*PHP_noArrowMatching*
913+
By default the indent script will indent multi-line chained calls by matching
914+
the position of the '->': >
915+
916+
$user_name_very_long->name()
917+
->age()
918+
->info();
919+
920+
You can revert to the classic way of indenting by setting this option to 1: >
921+
:let g:PHP_noArrowMatching = 1
922+
923+
You will obtain the following result: >
924+
925+
$user_name_very_long->name()
926+
->age()
927+
->info();
928+
909929
910930
911931
PYTHON *ft-python-indent*

0 commit comments

Comments
 (0)