Phạm Bình An | 5a8f995 | 2025-05-19 19:34:44 +0200 | [diff] [blame] | 1 | *pi_tutor.txt* For Vim version 9.1. Last change: 2025 May 19 |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 2 | |
| 3 | INTERACTIVE TUTORIALS FOR VIM *vim-tutor-mode* |
| 4 | |
| 5 | vim-tutor-mode provides a system to follow and create interactive tutorials |
h-east | 624bb83 | 2024-11-09 18:37:32 +0100 | [diff] [blame] | 6 | for vim and third party plugins. It replaces the venerable `vimtutor` system. |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 7 | |
Phạm Bình An | 5a8f995 | 2025-05-19 19:34:44 +0200 | [diff] [blame] | 8 | Original Author: Felipe Morales <https://github.com/fmoralesc> |
| 9 | |
Christian Brabandt | ac2bb9d | 2024-11-04 19:37:24 +0100 | [diff] [blame] | 10 | ============================================================================= |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 11 | 1. Usage *vim-tutor-usage* |
| 12 | |
| 13 | vim-tutor-mode tutorials are hypertext documents, they have rich text and |
h-east | 624bb83 | 2024-11-09 18:37:32 +0100 | [diff] [blame] | 14 | contain links. To stand out from the rest of the text, links are underlined. |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 15 | You can follow them by placing the cursor over them and pressing <Enter>, or |
| 16 | by double-clicking them. |
| 17 | |
| 18 | 1.1 Commands |
| 19 | ------------ |
| 20 | *:Tutor* |
Christian Brabandt | 3f7d584 | 2024-12-16 20:11:04 +0100 | [diff] [blame] | 21 | :Tutor [tutorial] Opens a tutorial. Command-line completion for |
| 22 | [tutorial] is provided, the candidates are a list of |
| 23 | ".tutor" files found in the "tutor/<lang>/" folder in |
| 24 | the 'runtimepath'. Tutorials prefixed with "vim-" |
h-east | 624bb83 | 2024-11-09 18:37:32 +0100 | [diff] [blame] | 25 | will always be shown first. |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 26 | |
Christian Brabandt | 3f7d584 | 2024-12-16 20:11:04 +0100 | [diff] [blame] | 27 | If no [tutorial] is provided, the command starts the |
| 28 | "vim-01-beginner" tutorial, which is equivalent to |
| 29 | Vim's `vimtutor`, chapter 1. |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 30 | |
Christian Brabandt | 3f7d584 | 2024-12-16 20:11:04 +0100 | [diff] [blame] | 31 | Uses the translated tutorial for the current message |
| 32 | language if possible (|v:lang|), e.g. to open the |
| 33 | chapter 1 of the Italian tutor, use: > |
| 34 | |
Christian Brabandt | 9c3330d | 2024-12-17 20:24:24 +0100 | [diff] [blame] | 35 | :lang it_IT.UTF-8 |
Christian Brabandt | 3f7d584 | 2024-12-16 20:11:04 +0100 | [diff] [blame] | 36 | :Tutor |
| 37 | < |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 38 | ============================================================================= |
| 39 | 2. Creating tutorials *vim-tutor-create* |
| 40 | |
h-east | 624bb83 | 2024-11-09 18:37:32 +0100 | [diff] [blame] | 41 | Writing vim-tutor-mode tutorials is easy. For an overview of the format used, |
Christian Brabandt | 3f7d584 | 2024-12-16 20:11:04 +0100 | [diff] [blame] | 42 | please consult the "tutor.tutor" file: > |
Yegappan Lakshmanan | a54816b | 2024-11-03 10:49:23 +0100 | [diff] [blame] | 43 | |
| 44 | :Tutor tutor |
| 45 | < |
| 46 | New tutorials must be placed in the 'tutor/' folder in the 'runtimepath' |
| 47 | to be detected by the :Tutor command. |
| 48 | |
| 49 | It is recommended to use a less formal style when writing tutorials than in |
| 50 | regular documentation (unless the content requires it). |
| 51 | |
Christian Brabandt | ac2bb9d | 2024-11-04 19:37:24 +0100 | [diff] [blame] | 52 | ============================================================================= |
Christian Brabandt | ac2bb9d | 2024-11-04 19:37:24 +0100 | [diff] [blame] | 53 | vim:tw=78:ts=8:noet:ft=help:norl: |