Skip to content

Commit 43b56fb

Browse files
authored
Merge pull request #246 from mnishz/insert_for_Vim_8.1
Update insert from Vim 8.0 to 8.1
2 parents eb62f4c + ba6a7e4 commit 43b56fb

File tree

2 files changed

+54
-45
lines changed

2 files changed

+54
-45
lines changed

doc/insert.jax

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*insert.txt* For Vim バージョン 8.0. Last change: 2017 May 30
1+
*insert.txt* For Vim バージョン 8.1. Last change: 2018 Feb 10
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -425,10 +425,10 @@ CTRL-G U の使用例: >
425425

426426
Lorem ipsum (dolor)
427427

428-
CTRL-O は undo 位置を分割する。つまり、その前後に入力したテキストが別々にundo
428+
CTRL-O は undo 位置を分割する。つまり、その前後に入力したテキストが別々にundo
429429
されるようになる。これを避けたい場合(マッピングの中などで)は CTRL-R =
430430
|i_CTRL-R| が使えるだろう。例: 関数を呼ぶ: >
431-
:imap <F2> <C-R>=MyFunc()<CR>
431+
:imap <F2> <C-R>=MyFunc()<CR>
432432
433433
'whichwrap' オプションが適切に設定されているならば、行の先頭/末尾での<Left>
434434
<Right>キーは、カーソルを上の行や下の行へ移動させる。
@@ -1037,6 +1037,8 @@ CTRL-P カーソルの直前と同じキーワードで始まる単語を、
10371037
dup 0 でないならば、すでに同じ候補があってもこの候補を追加
10381038
する。
10391039
empty 0 でないならば、空文字であってもこの候補を追加する。
1040+
user_data この要素に関連付けられた |v:completed_item| で使用可能
1041+
なカスタムデータ
10401042

10411043
これらのうち "icase"、"dup"、"empty" 以外は文字列でなければならない。これらの
10421044
要件が満たされない場合はエラーメッセージが表示され、リスト中のそれ以降の要素は
@@ -1129,6 +1131,8 @@ CTRL-P カーソルの直前と同じキーワードで始まる単語を、
11291131

11301132
ポップアップメニューの高さの最大値はオプション 'pumheight' で設定できる。既
11311133
定値は利用可能なスペースをすべて使うようになっている。
1134+
ポップアップメニューの幅の最小値はオプション 'pumwidth' で設定できる。既定値は
1135+
15 文字である。
11321136

11331137
ポップアップメニューには 3 つの状態がある:
11341138
1. 候補が挿入された状態。例えば CTRL-NCTRL-P の後。
@@ -1161,7 +1165,7 @@ CTRL-L 現在の候補から1文字を挿入する。候補の数は少なく
11611165
印字可能で空白文字でない任意の文字:
11621166
その文字を挿入する。候補の数は少なくなる。
11631167

1164-
以上すべての状態で以下のキーが使える:
1168+
以上すべての状態で以下のキーが使える:
11651169
CTRL-Y Yes: 現在選択されている候補に決定し、補完を終了する。
11661170
CTRL-E 補完を終了し、候補を選択する前の状態(タイプした状態または最
11671171
長共通文字列)へ戻る。
@@ -1222,15 +1226,16 @@ ctags はこのサイトからダウンロードできる: http://ctags.sourcefo
12221226
ること:
12231227
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
12241228
MS-Windows 用の exe ファイルは次のサイトからダウンロードできる:
1225-
http://georgevreilly.com/vim/ctags.html
1229+
http://ctags.sourceforge.net/
1230+
https://github.com/universal-ctags/ctags-win32
12261231

12271232
システム関数を補完するには、次のような方法がある。ctags を使って全システムヘッ
12281233
ダーファイルの tags ファイルを作る: >
12291234
% ctags -R -f ~/.vim/systags /usr/include /usr/local/include
12301235
そして .vimrc で 'tags' オプションにこの tags ファイルを追加する: >
12311236
set tags+=~/.vim/systags
12321237
1233-
カーソル前の単語が "." や "->" を含まないとき、CTRL-X CTRL-O を押すと tags
1238+
カーソル前の単語が "." や "->" を含まないとき、CTRL-X CTRL-O を押すと tags
12341239
ファイルから直接補完される。これはすべての識別子、関数名に対して有効である。
12351240
tags ファイルに含まれないローカル変数名を補完するには CTRL-P を使うしかない。
12361241

@@ -1366,7 +1371,7 @@ Note: 最初に補完を行うとき、必要なデータがすべてメモリ
13661371
秒かかる場合があるが、次回からの補完は気になるほどではなくなるだろう。
13671372

13681373
補完スクリプトは、カーソルが<?php ?>の中にあるかどうかを検出する。もしカーソル
1369-
がこのタグの外側にあれば、自動的に HMTL/CSS/JavaScript 補完に切り替わる。Note:
1374+
がこのタグの外側にあれば、自動的に HMTL/CSS/JavaScript 補完に切り替わる。Note:
13701375
元の HTML とは異なり、タグの補完が文脈依存ではなくなる。
13711376

13721377
RUBY *ft-ruby-omni*
@@ -1491,17 +1496,17 @@ syntaxcomplete プラグインは単語文字の区切りを使わなくなる:
14911496
イテムのリストを得るために使うことができる。例えば SQL ファイルを開いていると
14921497
きに (:e syntax.sql) ":syntax list" コマンドを実行してグループと構文アイテムを
14931498
確認してみる。例: >
1494-
syntax list
1495-
1496-
次のような出力が表示される: >
1497-
sqlOperator xxx some prior all like and any escape exists in is not
1498-
or intersect minus between distinct
1499-
links to Operator
1500-
sqlType xxx varbit varchar nvarchar bigint int uniqueidentifier
1501-
date money long tinyint unsigned xml text smalldate
1502-
double datetime nchar smallint numeric time bit char
1503-
varbinary binary smallmoney
1504-
image float integer timestamp real decimal
1499+
syntax list
1500+
1501+
次のような出力が表示される:
1502+
sqlOperator xxx some prior all like and any escape exists in is not ~
1503+
or intersect minus between distinct ~
1504+
links to Operator ~
1505+
sqlType xxx varbit varchar nvarchar bigint int uniqueidentifier ~
1506+
date money long tinyint unsigned xml text smalldate ~
1507+
double datetime nchar smallint numeric time bit char ~
1508+
varbinary binary smallmoney ~
1509+
image float integer timestamp real decimal ~
15051510

15061511
二つの構文グループ sqlOperator と sqlType がある。構文アイテムのリストを得るた
15071512
めに OmniSyntaxList をいくつかの方法で呼び出すことができる。構文グループを限定

en/insert.txt

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*insert.txt* For Vim version 8.0. Last change: 2017 May 30
1+
*insert.txt* For Vim version 8.1. Last change: 2018 Feb 10
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -433,7 +433,7 @@ An example for using CTRL-G U: >
433433
inoremap ( ()<C-G>U<Left>
434434
435435
This makes it possible to use the cursor keys in Insert mode, without breaking
436-
the undo sequence and therefore using |.| (redo) will work as expected.
436+
the undo sequence and therefore using |.| (redo) will work as expected.
437437
Also entering a text like (with the "(" mapping from above): >
438438
439439
Lorem ipsum (dolor
@@ -1103,6 +1103,8 @@ items:
11031103
item with the same word is already present.
11041104
empty when non-zero this match will be added even when it is
11051105
an empty string
1106+
user_data custom data which is associated with the item and
1107+
available in |v:completed_item|
11061108

11071109
All of these except "icase", "dup" and "empty" must be a string. If an item
11081110
does not meet these requirements then an error message is given and further
@@ -1196,6 +1198,8 @@ The menu is used when:
11961198

11971199
The 'pumheight' option can be used to set a maximum height. The default is to
11981200
use all space available.
1201+
The 'pumwidth' option can be used to set a minimum width. The default is 15
1202+
characters.
11991203

12001204
There are three states:
12011205
1. A complete match has been inserted, e.g., after using CTRL-N or CTRL-P.
@@ -1296,7 +1300,8 @@ it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
12961300
For version 5.5.4 you should add a patch that adds the "typename:" field:
12971301
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
12981302
A compiled .exe for MS-Windows can be found at:
1299-
http://georgevreilly.com/vim/ctags.html
1303+
http://ctags.sourceforge.net/
1304+
https://github.com/universal-ctags/ctags-win32
13001305

13011306
If you want to complete system functions you can do something like this. Use
13021307
ctags to generate a tags file for all the system header files: >
@@ -1472,7 +1477,7 @@ The completions provided by CTRL-X CTRL-O are sensitive to the context:
14721477

14731478
Notes:
14741479
- Vim will load/evaluate code in order to provide completions. This may
1475-
cause some code execution, which may be a concern. This is no longer
1480+
cause some code execution, which may be a concern. This is no longer
14761481
enabled by default, to enable this feature add >
14771482
let g:rubycomplete_buffer_loading = 1
14781483
<- In context 1 above, Vim can parse the entire buffer to add a list of
@@ -1528,15 +1533,15 @@ that begin with the filetype, "php", in this case. For example these syntax
15281533
groups are included by default with the PHP: phpEnvVar, phpIntVar,
15291534
phpFunctions.
15301535

1531-
If you wish non-filetype syntax items to also be included, you can use a
1532-
regular expression syntax (added in version 13.0 of autoload\syntaxcomplete.vim)
1533-
to add items. Looking at the output from ":syntax list" while editing a PHP file
1534-
I can see some of these entries: >
1536+
If you wish non-filetype syntax items to also be included, you can use a
1537+
regular expression syntax (added in version 13.0 of
1538+
autoload\syntaxcomplete.vim) to add items. Looking at the output from
1539+
":syntax list" while editing a PHP file I can see some of these entries: >
15351540
htmlArg,htmlTag,htmlTagName,javaScriptStatement,javaScriptGlobalObjects
15361541
15371542
To pick up any JavaScript and HTML keyword syntax groups while editing a PHP
1538-
file, you can use 3 different regexs, one for each language. Or you can
1539-
simply restrict the include groups to a particular value, without using
1543+
file, you can use 3 different regexs, one for each language. Or you can
1544+
simply restrict the include groups to a particular value, without using
15401545
a regex string: >
15411546
let g:omni_syntax_group_include_php = 'php\w\+,javaScript\w\+,html\w\+'
15421547
let g:omni_syntax_group_include_php = 'phpFunctions,phpMethods'
@@ -1549,9 +1554,9 @@ highlight. These items will be available within the omni completion list.
15491554

15501555
Some people may find this list unwieldy or are only interested in certain
15511556
items. There are two ways to prune this list (if necessary). If you find
1552-
certain syntax groups you do not wish displayed you can use two different
1553-
methods to identify these groups. The first specifically lists the syntax
1554-
groups by name. The second uses a regular expression to identify both
1557+
certain syntax groups you do not wish displayed you can use two different
1558+
methods to identify these groups. The first specifically lists the syntax
1559+
groups by name. The second uses a regular expression to identify both
15551560
syntax groups. Simply add one the following to your vimrc: >
15561561
let g:omni_syntax_group_exclude_php = 'phpCoreConstant,phpConstant'
15571562
let g:omni_syntax_group_exclude_php = 'php\w*Constant'
@@ -1574,22 +1579,22 @@ vimrc: >
15741579
15751580
For plugin developers, the plugin exposes a public function OmniSyntaxList.
15761581
This function can be used to request a List of syntax items. When editing a
1577-
SQL file (:e syntax.sql) you can use the ":syntax list" command to see the
1582+
SQL file (:e syntax.sql) you can use the ":syntax list" command to see the
15781583
various groups and syntax items. For example: >
1579-
syntax list
1580-
1581-
Yields data similar to this: >
1582-
sqlOperator xxx some prior all like and any escape exists in is not
1583-
or intersect minus between distinct
1584-
links to Operator
1585-
sqlType xxx varbit varchar nvarchar bigint int uniqueidentifier
1586-
date money long tinyint unsigned xml text smalldate
1587-
double datetime nchar smallint numeric time bit char
1588-
varbinary binary smallmoney
1589-
image float integer timestamp real decimal
1584+
syntax list
1585+
1586+
Yields data similar to this:
1587+
sqlOperator xxx some prior all like and any escape exists in is not ~
1588+
or intersect minus between distinct ~
1589+
links to Operator ~
1590+
sqlType xxx varbit varchar nvarchar bigint int uniqueidentifier ~
1591+
date money long tinyint unsigned xml text smalldate ~
1592+
double datetime nchar smallint numeric time bit char ~
1593+
varbinary binary smallmoney ~
1594+
image float integer timestamp real decimal ~
15901595

15911596
There are two syntax groups listed here: sqlOperator and sqlType. To retrieve
1592-
a List of syntax items you can call OmniSyntaxList a number of different
1597+
a List of syntax items you can call OmniSyntaxList a number of different
15931598
ways. To retrieve all syntax items regardless of syntax group: >
15941599
echo OmniSyntaxList( [] )
15951600
@@ -1606,7 +1611,6 @@ From within a plugin, you would typically assign the output to a List: >
16061611
let myKeywords = []
16071612
let myKeywords = OmniSyntaxList( ['sqlKeyword'] )
16081613
1609-
16101614
16111615
SQL *ft-sql-omni*
16121616

0 commit comments

Comments
 (0)