createHelpPages creates the help system with multiple pages
()
| 652 | |
| 653 | // createHelpPages creates the help system with multiple pages |
| 654 | func (e *Editor) createHelpPages() { |
| 655 | // Create three separate help pages |
| 656 | help1 := tview.NewTextView() |
| 657 | help1.SetDynamicColors(true) |
| 658 | navText := `[green]Navigation[white] |
| 659 | |
| 660 | [yellow]Arrow Keys[white]: Move cursor around |
| 661 | [yellow]Ctrl-A, Home[white]: Move to beginning of line |
| 662 | [yellow]Ctrl-E, End[white]: Move to end of line |
| 663 | [yellow]Ctrl-F, Page Down[white]: Move down by one page |
| 664 | [yellow]Ctrl-B, Page Up[white]: Move up by one page |
| 665 | [yellow]Alt-Up[white]: Scroll page up |
| 666 | [yellow]Alt-Down[white]: Scroll page down |
| 667 | [yellow]Alt-Left[white]: Scroll page left |
| 668 | [yellow]Alt-Right[white]: Scroll page right |
| 669 | [yellow]Alt-B, Ctrl-Left[white]: Move back by one word |
| 670 | [yellow]Alt-F, Ctrl-Right[white]: Move forward by one word` |
| 671 | |
| 672 | if e.useVim { |
| 673 | navText += ` |
| 674 | |
| 675 | [green]VIM Navigation (Normal Mode)[white] |
| 676 | [yellow]h/j/k/l or Arrow Keys[white]: Move left/down/up/right |
| 677 | [yellow]0/$ or Home/End[white]: Beginning/end of line |
| 678 | [yellow]w/b[white]: Word forward/backward |
| 679 | [yellow]gg/G[white]: Beginning/end of document |
| 680 | [yellow]Page Up/Down[white]: Page navigation |
| 681 | |
| 682 | [green]VIM Mode Switching[white] |
| 683 | [yellow]i[white]: Insert mode at cursor |
| 684 | [yellow]a[white]: Insert mode after cursor |
| 685 | [yellow]A[white]: Insert mode at end of line |
| 686 | [yellow]I[white]: Insert mode at beginning of line |
| 687 | [yellow]o[white]: New line below + insert mode |
| 688 | [yellow]O[white]: New line above + insert mode |
| 689 | |
| 690 | [green]VIM Editing[white] |
| 691 | [yellow]x/X[white]: Delete character right/left |
| 692 | [yellow]Esc[white]: Return to normal mode |
| 693 | [yellow]Alt+V[white]: Toggle VIM mode on/off |
| 694 | |
| 695 | [green]VIM Search[white] |
| 696 | [yellow]/[white]: Search for text (opens dialog) |
| 697 | [yellow]n[white]: Find next occurrence |
| 698 | [yellow]N[white]: Find previous occurrence` |
| 699 | } |
| 700 | |
| 701 | navText += ` |
| 702 | |
| 703 | [blue]Press Enter for more help, Escape to return to editor[white]` |
| 704 | |
| 705 | help1.SetText(navText) |
| 706 | help1.SetBorder(true) |
| 707 | help1.SetTitle("Help - Navigation") |
| 708 | |
| 709 | help2 := tview.NewTextView() |
| 710 | help2.SetDynamicColors(true) |
| 711 | help2.SetText(`[green]Editing[white] |