neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit c58c650adf443f126c575ca7c60400c2ac15d255
parent 9272dc959729ef356a24acf4eff3c411f407ffcd
Author: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Date:   Tue, 15 Apr 2025 14:11:17 +0700

vim-patch:829eda7: runtime(new-tutor): update tutor and correct comandline completion (#33449)

Problem: Some parts of the tutor are outdated.

- For example, pressing `<Tab>` after typing `:e` does not complete the
command `:edit`, but shows a completion menu with the first entry being
`:earlier`.

closes: vim/vim#17107

https://github.com/vim/vim/commit/829eda7d381e5f635169c927103568b335cd599d
Diffstat:
Mruntime/tutor/en/vim-01-beginner.tutor | 19++++++++++++++-----
Mruntime/tutor/ja/vim-01-beginner.tutor | 22+++++++++++++++-------
Mtest/functional/plugin/tutor_spec.lua | 2+-
3 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/runtime/tutor/en/vim-01-beginner.tutor b/runtime/tutor/en/vim-01-beginner.tutor @@ -464,7 +464,7 @@ Now go on to the next lesson. # Lesson 4.1: CURSOR LOCATION AND FILE STATUS ** Type `<C-g>`{normal} to show your location in a file and the file status. - Type `G`{normal} to move to a line in the file. ** + Type `{count}G`{normal} to move to line {count} in the file. ** NOTE: Read the entire lesson before executing any of these steps!! @@ -934,11 +934,20 @@ For more information type `:help init.vim`{vim}. 3. Press `<C-d>`{normal} and Neovim will show a list of commands beginning with "e". - 4. Press `<Tab>`{normal} and Neovim will complete the command name to ":edit". + 4. Press `<Tab>`{normal} and Neovim will show a menu with possible completions + (or complete the match, if the entered command is unique, e.g. + ":ed`<Tab>`{normal}" will be completed to ":edit"). - 5. Now add a space and the start of an existing file name: `:edit FIL`{vim} + 5. Use `<Tab>`{normal} or `<C-n>`{normal} to go to the next match. Or use + `<S-Tab>`{normal} or `<C-p>`{normal} to go to the previous match. - 6. Press `<Tab>`{normal}. Neovim will complete the name ("FIL" -> "FILE", if it is unique). + 6. Choose the entry `edit`{vim}. Now you can see that the word `edit`{vim} + have been automatically inserted to the command line. + + 7. Now add a space and the start of an existing file name: `:edit FIL`{vim} + + 8. Press `<Tab>`{normal}. Vim will show a completion menu with list of file + names that start with `FIL` NOTE: Completion works for many commands. It is especially useful for `:help`{vim}. @@ -956,7 +965,7 @@ NOTE: Completion works for many commands. It is especially useful for `:help`{vi 5. Create an init.vim startup script to keep your preferred settings. 6. While in command mode, press `<C-d>`{normal} to see possible completions. - Press `<Tab>`{normal} to use one completion. + Press `<Tab>`{normal} to use the completion menu and select a match. # CONCLUSION diff --git a/runtime/tutor/ja/vim-01-beginner.tutor b/runtime/tutor/ja/vim-01-beginner.tutor @@ -31,7 +31,7 @@ NOTE: 以下の練習用コマンドにはこの文章を変更するものも また、次のようにコマンドを実行するよう求められることや、(後で詳しく説明します。) `:help`{vim} `<Enter>`{normal} - + キーシークエンスを押すこともあります。 ~~~ normal <Esc>0f<Space>d3wP$P @@ -465,8 +465,8 @@ NOTE: タイプ中の間違いはバックスペースキーを使って直す # レッスン 4.1: 位置とファイルの情報 -** ファイル内での位置とファイルの状態を表示するには `<C-g>`{normal} をタイプします。ファイ - ル内のある行に移動するには `G`{normal} をタイプします。 ** +** ファイル内での位置とファイルの状態を表示するには `<C-g>`{normal} をタイプします。 +ファイル内の{count}行に移動するには `{count}G`{normal} をタイプします。 ** NOTE: ステップを実行する前に、このレッスン全てに目を通しましょう!! @@ -875,7 +875,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい ~~~ # レッスン 7.1: ヘルプコマンド -** Use the online help system. ** +** オンラインヘルプシステムを使用する ** Neovim には広範にわたるオンラインヘルプシステムがあります。 @@ -925,11 +925,19 @@ Neovim はとても自由度の高いエディタです。あなたの好きな 3. `<C-d>`{normal} を押すと Neovim は "e" から始まるコマンドの一覧を表示します。 - 4. `<Tab>`{normal} とタイプすると Neoim は ":edit" というコマンド名を補完します。 + 4. `<Tab>`{normal} を押すと、Neovim は可能な補完候補のメニューを表示します + (または、ただの一つのマッチがあるときは、補完します。 + 例: ":ed`<Tab>`{normal}" は":edit"に補完されます)。 + + 5. 次のマッチに移動するには `<Tab>`{normal} または `<C-n>`{normal}を使用し、 + 前のマッチに移動するには `<S-Tab>`{normal} または `<C-p>`{normal}を使用します。 + + 6. `edit`{vim} を選択すると、コマンドラインに`edit` が挿入されます。 - 5. さらに空白と、既存のファイル名の始まりを加えます: `:edit FIL`{vim} + 7. さらに空白と、既存のファイル名の始まりを加えます: `:edit FIL`{vim} - 6. `<Tab>`{normal} を押すと Neovim は名前を補完します。("FIL" -> "FILE"、重複しない場合) + 8. `<Tab>`{normal}を押すと、Vim は `FIL` で始まるファイル名の候補リストを含む補完メニューを + 表示します。 NOTE: 補完は多くのコマンドで動作します。特に `:help`{vim} の際に役立ちます。 diff --git a/test/functional/plugin/tutor_spec.lua b/test/functional/plugin/tutor_spec.lua @@ -131,7 +131,7 @@ describe(':Tutor', function() {0: }University. E-mail: {2:bware@mines.colorado.edu}. | ]] - feed(':960<CR>zt') + feed(':969<CR>zt') screen:expect(expected) end) end)