diff --git a/doc/insert.jax b/doc/insert.jax index 15ad50886..5dea41e71 100644 --- a/doc/insert.jax +++ b/doc/insert.jax @@ -1,4 +1,4 @@ -*insert.txt* For Vim バージョン 9.1. Last change: 2025 Sep 16 +*insert.txt* For Vim バージョン 9.1. Last change: 2025 Oct 17 VIMリファレンスマニュアル by Bram Moolenaar @@ -78,9 +78,10 @@ CTRL-W カーソルの前にある単語を削除する(行同士の連結に |i_backspacing|参照)。単語の定義については "word motions" の節 |word-motions|を参照。 *i_CTRL-U* -CTRL-U 現在の行のカーソルの前に入力された文字を全部削除する。新しく入 - 力した文字が無く 'backspace' が空ではない時は、カーソル前の全 - ての文字を削除する。 +CTRL-U 挿入モードを開始した後に入力された文字と現在の行のカーソルの前 + にある文字をすべて削除する。新しく入力した文字が無く + 'backspace' が空ではない時は、カーソル前の全ての文字を削除す + る。 Cソースコードのインデントが有効な場合で行が空白になるとき、イ ンデントは調整される。 行同士の連結については |i_backspacing| を参照。 @@ -1218,27 +1219,9 @@ Note 最初の呼び出し以降にカーソルが移動した可能性があり る。 *complete-popup* -"popup" が 'completeopt' にある場合、ポップアップウィンドウを使用して "info" -が表示される。 -次に、'completepopup' オプションはポップアップのプロパティを指定する。これは、 -情報ポップアップが作成されるときに使用される。オプションは、コンマで区切られた -値のリストである: - height ポップアップの最大高さ - width ポップアップの最大幅 - highlight ポップアップのハイライトグループ(デフォルトは PmenuSel) - align "item" (デフォルト) または "menu" - border "on" (デフォルト) または "off" -例: > - :set completepopup=height:10,width:60,highlight:InfoPopup - -`"align"` を `"item"` に設定すると、ポップアップは選択された項目の近くに配置さ -れ、選択内容の変更に応じて移動する。 -`"menu"` に設定すると、ポップアップはメニューの上端 (メニューがテキストの下に -表示される場合) または下端 (メニューがテキストの上に表示される場合) に揃えられ -る。 - -'mouse' が有効になっている場合、ポップアップの境界に閉じるボタンとサイズ変更ハ -ンドルが表示される。 +'completeopt' に "popup" が含まれている場合、補完の "info" テキストを表示する +ためにポップアップウィンドウが使用される。このポップアップの外観と動作は、ポッ +プアップ作成時の 'completepopup' オプションによって制御される。 作成後、情報ポップアップは |popup_findinfo()| で見つけることができ、 |popup_setoptions()| で変更できる。 @@ -1638,6 +1621,34 @@ Note: let g:rubycomplete_rails = 1 < +VIM *ft-vim-omni* + +Vim script および Vim9 script 言語の簡単な補完。 + +補完: + +- set および & オプション +- コマンドとコマンド引数 +- -> の後の関数名 +- 式 +- l:、v:、g:、s: および b: 変数 +- 候補を取得するためにコマンドライン補完にフォールバックする + +Notes + +- 候補の収集が一般的に遅いため、Windows および WSL の 'shellcmd' 補完タイプに + 依存するコマンド引数は補完されない。例: +> + terminal dir + !dir +< + これらの補完では、候補を収集するのに数秒かかる場合がある。 + +- 'autocomplete' は "no" オプションを補完できない: +> + set noautoindent + set nobuflisted +< SYNTAX *ft-syntax-omni* diff --git a/en/insert.txt b/en/insert.txt index 914e9fc83..b0bd39a28 100644 --- a/en/insert.txt +++ b/en/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 9.1. Last change: 2025 Sep 16 +*insert.txt* For Vim version 9.1. Last change: 2025 Oct 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -80,10 +80,11 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about joining lines). See the section "word motions", |word-motions|, for the definition of a word. *i_CTRL-U* -CTRL-U Delete all entered characters before the cursor in the current - line. If there are no newly entered characters and - 'backspace' is not empty, delete all characters before the - cursor in the current line. +CTRL-U Delete all characters that were entered after starting Insert + mode and before the cursor in the current line. + If there are no newly entered characters and 'backspace' is + not empty, delete all characters before the cursor in the + current line. If C-indenting is enabled the indent will be adjusted if the line becomes blank. See |i_backspacing| about joining lines. @@ -129,7 +130,7 @@ CTRL-R {register} *i_CTRL-R* '.' the last inserted text *i_CTRL-R_-* '-' the last small (less than a line) delete - register. This is repeatable using |.| since + register. This is repeatable using |.| since it remembers the register to put instead of the literal text to insert. *i_CTRL-R_=* @@ -166,12 +167,12 @@ CTRL-R CTRL-R {register} *i_CTRL-R_CTRL-R* CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O* Insert the contents of a register literally and don't auto-indent. Does the same as pasting with the mouse - ||. When the register is linewise this will + ||. When the register is linewise this will insert the text above the current line, like with `P`. The '.' register (last inserted text) is still inserted as typed. After this command, the '.' register contains the command - typed and not the text. I.e., the literals "^R^O" and not the + typed and not the text. I.e., the literals "^R^O" and not the text from the register. Does not replace characters in |Replace-mode|! @@ -181,7 +182,7 @@ CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P* The '.' register (last inserted text) is still inserted as typed. After this command, the '.' register contains the command - typed and not the text. I.e., the literals "^R^P" and not the + typed and not the text. I.e., the literals "^R^P" and not the text from the register. Does not replace characters in |Replace-mode|! @@ -558,10 +559,10 @@ extra spaces to get where you want to be. *ins-smarttab* When the 'smarttab' option is on, the key indents by 'shiftwidth' if the -cursor is in leading whitespace. The key has the opposite effect. This -behaves as if 'softtabstop' were set to the value of 'shiftwidth'. This option -allows the user to set 'softtabstop' to a value other than 'shiftwidth' and -still use the key for indentation. +cursor is in leading whitespace. The key has the opposite effect. This +behaves as if 'softtabstop' were set to the value of 'shiftwidth'. This +option allows the user to set 'softtabstop' to a value other than 'shiftwidth' +and still use the key for indentation. ============================================================================== 5. Replace mode *Replace* *Replace-mode* *mode-replace* @@ -662,7 +663,8 @@ not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next), and CTRL-P (previous). By default, the possible completions are showed in a menu and the first -completion is inserted into the text. This can be adjusted with 'completeopt'. +completion is inserted into the text. This can be adjusted with +'completeopt'. To get the current completion information, |complete_info()| can be used. Also see the 'infercase' option if you want to adjust the case of the match. @@ -888,7 +890,7 @@ Completing keywords with 'thesaurusfunc' *compl-thesaurusfunc* If the 'thesaurusfunc' option is set, then the user specified function is invoked to get the list of completion matches and the 'thesaurus' option is -not used. See |complete-functions| for an explanation of how the function is +not used. See |complete-functions| for an explanation of how the function is invoked and what it should return. Here is an example that uses the "aiksaurus" command (provided by Magnus @@ -1138,8 +1140,8 @@ CTRL-X CTRL-Z Stop completion without changing the text. AUTOCOMPLETION *ins-autocompletion* Vim can display a completion menu as you type, similar to using |i_CTRL-N|, -but triggered automatically. See 'autocomplete'. The menu items are collected -from the sources listed in the 'complete' option, in order. +but triggered automatically. See 'autocomplete'. The menu items are +collected from the sources listed in the 'complete' option, in order. A decaying timeout keeps Vim responsive. Sources earlier in the 'complete' list get more time (higher priority), but all sources receive at least a small @@ -1247,7 +1249,7 @@ items: items to be equal; when omitted zero is used, thus items that only differ in case are added equal when non-zero, always treat this item to be equal when - comparing. Which means, "equal=1" disables filtering + comparing. Which means, "equal=1" disables filtering of this item. dup when non-zero this match will be added even when an item with the same word is already present. @@ -1263,7 +1265,7 @@ items: properties (with higher priority) like strikethrough to the completion items abbreviation kind_hlgroup an additional highlight group specifically for setting - the highlight attributes of the completion kind. When + the highlight attributes of the completion kind. When this field is present, it will override the |hl-PmenuKind| highlight group, allowing for the customization of ctermfg and guifg properties for the @@ -1285,26 +1287,9 @@ remove existing text in the preview window. The size of the preview window is three lines, but 'previewheight' is used when it has a value of 1 or 2. *complete-popup* -When "popup" is in 'completeopt' a popup window is used to display the "info". -Then the 'completepopup' option specifies the properties of the popup. This -is used when the info popup is created. The option is a comma-separated list -of values: - height maximum height of the popup - width maximum width of the popup - highlight highlight group of the popup (default is PmenuSel) - align "item" (default) or "menu" - border "on" (default) or "off" -Example: > - :set completepopup=height:10,width:60,highlight:InfoPopup - -When `"align"` is set to `"item"`, the popup is positioned near the selected -item, and moves as the selection changes. -When set to `"menu"`, the popup aligns with the top of the menu (if the menu -appears below the text), or with the bottom (if the menu appears above). - -If the 'mouse' is enabled, a close button and resize handle will appear on the -popup border. - +When "popup" is included in 'completeopt', a popup window is used to display +the completion "info" text. The appearance and behavior of this popup are +controlled by the 'completepopup' option when the popup is created. After creation, the info popup can be located with |popup_findinfo()| and modified using |popup_setoptions()|. @@ -1454,7 +1439,8 @@ any printable, non-white character: Add this character and reduce the number of matches. In all three states these can be used: -CTRL-Y Yes: Accept the currently selected match and stop completion. +CTRL-Y Yes: Accept the currently selected match and stop + completion. CTRL-E End completion, go back to what was there before selecting a match (what was typed or longest common string). Select a match several entries back, but don't insert it. @@ -1558,7 +1544,7 @@ XHTML *ft-xhtml-omni* CTRL-X CTRL-O provides completion of various elements of (X)HTML files. It is designed to support writing of XHTML 1.0 Strict files but will also work for -other versions of HTML. Features: +other versions of HTML. Features: - after "<" complete tag name depending on context (no div suggestion inside of an a tag); '/>' indicates empty tags @@ -1576,7 +1562,7 @@ other versions of HTML. Features: Note: When used first time completion menu will be shown with little delay - this is time needed for loading of data file. -Note: Completion may fail in badly formatted documents. In such case try to +Note: Completion may fail in badly formatted documents. In such case try to run |:make| command to detect formatting problems. @@ -1590,7 +1576,7 @@ When doing completion outside of any other tag you will have possibility to choose DOCTYPE and the appropriate data file will be loaded and used for all next completions. -More about format of data file in |xml-omni-datafile|. Some of the data files +More about format of data file in |xml-omni-datafile|. Some of the data files may be found on the Vim website (|www|). Note that b:html_omni_flavor may point to a file with any XML data. This @@ -1619,8 +1605,8 @@ of external files). DOM compatibility At the moment (beginning of 2006) there are two main browsers - MS Internet -Explorer and Mozilla Firefox. These two applications are covering over 90% of -market. Theoretically standards are created by W3C organisation +Explorer and Mozilla Firefox. These two applications are covering over 90% of +market. Theoretically standards are created by W3C organisation (http://www.w3c.org) but they are not always followed/implemented. IE FF W3C Omni completion ~ @@ -1630,16 +1616,16 @@ market. Theoretically standards are created by W3C organisation - + - - ~ Regardless from state of implementation in browsers but if element is defined -in standards, completion plugin will place element in suggestion list. When +in standards, completion plugin will place element in suggestion list. When both major engines implemented element, even if this is not in standards it -will be suggested. All other elements are not placed in suggestion list. +will be suggested. All other elements are not placed in suggestion list. PHP *ft-php-omni* Completion of PHP code requires a tags file for completion of data from -external files and for class aware completion. You should use Universal/ -Exuberant ctags version 5.5.4 or newer. You can find it here: +external files and for class aware completion. You should use Universal/ +Exuberant ctags version 5.5.4 or newer. You can find it here: Universal Ctags: https://ctags.io Exuberant Ctags: http://ctags.sourceforge.net @@ -1647,11 +1633,12 @@ Exuberant ctags version 5.5.4 or newer. You can find it here: Script completes: - after $ variables name - - if variable was declared as object add "->", if tags file is available show - name of class + - if variable was declared as object add "->", if tags file is available + show name of class - after "->" complete only function and variable names specific for given - class. To find class location and contents tags file is required. Because - PHP isn't strongly typed language user can use @var tag to declare class: > + class. To find class location and contents tags file is required. + Because PHP isn't strongly typed language user can use @var tag to declare + class: > /* @var $myVar myClass */ $myVar-> @@ -1669,11 +1656,11 @@ Script completes: Note: when doing completion first time Vim will load all necessary data into -memory. It may take several seconds. After next use of completion delay +memory. It may take several seconds. After next use of completion delay should not be noticeable. -Script detects if cursor is inside tags. If it is outside it will -automatically switch to HTML/CSS/JavaScript completion. Note: contrary to +Script detects if cursor is inside tags. If it is outside it will +automatically switch to HTML/CSS/JavaScript completion. Note: contrary to original HTML files completion of tags (and only tags) isn't context aware. @@ -1700,11 +1687,11 @@ The completions provided by CTRL-X CTRL-O are sensitive to the context: Notes: - Vim will load/evaluate code in order to provide completions. This may - cause some code execution, which may be a concern. This is no longer + cause some code execution, which may be a concern. This is no longer enabled by default, to enable this feature add > let g:rubycomplete_buffer_loading = 1 <- In context 1 above, Vim can parse the entire buffer to add a list of - classes to the completion results. This feature is turned off by default, + classes to the completion results. This feature is turned off by default, to enable it add > let g:rubycomplete_classes_in_global = 1 < to your vimrc @@ -1712,11 +1699,41 @@ Notes: - In context 3 above, Vim will attempt to determine the methods supported by the object. - Vim can detect and load the Rails environment for files within a rails - project. The feature is disabled by default, to enable it add > + project. The feature is disabled by default, to enable it add > let g:rubycomplete_rails = 1 < to your vimrc +VIM *ft-vim-omni* + +Simple completion of Vim script and Vim9 script languages. + +Complete: + +- set and & options +- commands and command arguments +- function names after -> +- expressions +- l:, v:, g:, s: and b: variables +- fallback to command line completion to get candidates + +Notes + +- It doesn't complete command arguments that rely on 'shellcmd' completion + type in Windows and WSL due to general slowness of canditate gathering, + e.g. +> + terminal dir + !dir +< + These completions might take several seconds to gather candidates. + +- 'autocomplete' can't complete "no" options: +> + set noautoindent + set nobuflisted +< + SYNTAX *ft-syntax-omni* Vim has the ability to color syntax highlight nearly 500 languages. Part of @@ -1749,11 +1766,11 @@ a look at the PHP filetype to see how this works. If you edit a file called, index.php, run the following command: > syntax list -The first thing you will notice is that there are many different syntax groups. -The PHP language can include elements from different languages like HTML, -JavaScript and many more. The syntax plugin will only include syntax groups -that begin with the filetype, "php", in this case. For example these syntax -groups are included by default with the PHP: phpEnvVar, phpIntVar, +The first thing you will notice is that there are many different syntax +groups. The PHP language can include elements from different languages like +HTML, JavaScript and many more. The syntax plugin will only include syntax +groups that begin with the filetype, "php", in this case. For example these +syntax groups are included by default with the PHP: phpEnvVar, phpIntVar, phpFunctions. If you wish non-filetype syntax items to also be included, you can use a @@ -1872,7 +1889,7 @@ be used in commands. It should be a unique name which will not create conflicts. For example, the name xhtml10s.vim means it is the data file for XHTML 1.0 Strict. -Each file contains a variable with a name like g:xmldata_xhtml10s . It is +Each file contains a variable with a name like g:xmldata_xhtml10s . It is a compound from two parts: 1. "g:xmldata_" general prefix, constant for all data files @@ -2089,7 +2106,7 @@ These two commands will keep on asking for lines, until you type a line containing only a ".". Watch out for lines starting with a backslash, see |line-continuation|. -Text typed after a "|" command separator is used first. So the following +Text typed after a "|" command separator is used first. So the following command in ex mode: > :a|one two