@@ -114,6 +114,9 @@ break: >
114
114
tnoremap <Esc> <C-W>N
115
115
set notimeout ttimeout timeoutlen=100
116
116
117
+ You can also create menus similar to terminal mode mappings, but you have to
118
+ use | :tlmenu | instead of | :tmenu | .
119
+
117
120
< *options-in-terminal*
118
121
After opening the terminal window and setting 'buftype' to "terminal" the
119
122
TerminalOpen autocommand event is triggered. This makes it possible to set
@@ -228,6 +231,10 @@ Syntax ~
228
231
229
232
If you want to use more options use the | term_start() |
230
233
function.
234
+ If you want to split the window vertically, use: >
235
+ :vertical terminal
236
+ < Or short: >
237
+ :vert ter
231
238
232
239
When the buffer associated with the terminal is forcibly unloaded or wiped out
233
240
the job is killed, similar to calling `job_stop(job, "kill")` .
@@ -523,9 +530,9 @@ inspects the resulting screen state.
523
530
524
531
Functions ~
525
532
526
- term_sendkeys() send keystrokes to a terminal (not subject to tmap)
527
- term_wait() wait for screen to be updated
528
- term_scrape() inspect terminal screen
533
+ | term_sendkeys() | send keystrokes to a terminal (not subject to tmap)
534
+ | term_wait() | wait for screen to be updated
535
+ | term_scrape() | inspect terminal screen
529
536
530
537
531
538
==============================================================================
@@ -552,7 +559,7 @@ src/testdir/test_syntax.vim. The main parts are:
552
559
characters. This makes sure the dump is always this size. The function
553
560
RunVimInTerminal() takes care of this. Pass it the arguments for the Vim
554
561
command.
555
- - Send any commands to Vim using term_sendkeys(). For example: >
562
+ - Send any commands to Vim using | term_sendkeys() | . For example: >
556
563
call term_sendkeys(buf, ":echo &lines &columns\<CR>")
557
564
- Check that the screen is now in the expected state, using
558
565
VerifyScreenDump(). This expects the reference screen dump to be in the
@@ -580,21 +587,21 @@ Creating a screen dump ~
580
587
*terminal-screendump*
581
588
582
589
To create the screen dump, run Vim (or any other program) in a terminal and
583
- make it show the desired state. Then use the term_dumpwrite() function to
590
+ make it show the desired state. Then use the | term_dumpwrite() | function to
584
591
create a screen dump file. For example: >
585
592
:call term_dumpwrite(77, "mysyntax.dump")
586
593
587
594
Here "77" is the buffer number of the terminal. Use `:ls ! ` to see it.
588
595
589
- You can view the screen dump with term_dumpload(): >
596
+ You can view the screen dump with | term_dumpload() | : >
590
597
:call term_dumpload("mysyntax.dump")
591
598
592
599
To verify that Vim still shows exactly the same screen, run Vim again with
593
600
exactly the same way to show the desired state. Then create a screen dump
594
601
again, using a different file name: >
595
602
:call term_dumpwrite(88, "test.dump")
596
603
597
- To assert that the files are exactly the same use assert_equalfile(): >
604
+ To assert that the files are exactly the same use | assert_equalfile() | : >
598
605
call assert_equalfile("mysyntax.dump", "test.dump")
599
606
600
607
If there are differences then v:errors will contain the error message.
@@ -603,8 +610,8 @@ If there are differences then v:errors will contain the error message.
603
610
Comparing screen dumps ~
604
611
*terminal-diffscreendump*
605
612
606
- assert_equalfile() does not make it easy to see what is different.
607
- To spot the problem use term_dumpdiff(): >
613
+ | assert_equalfile() | does not make it easy to see what is different.
614
+ To spot the problem use | term_dumpdiff() | : >
608
615
call term_dumpdiff("mysyntax.dump", "test.dump")
609
616
610
617
This will open a window consisting of three parts:
@@ -613,7 +620,18 @@ This will open a window consisting of three parts:
613
620
3. The contents of the second dump
614
621
615
622
You can usually see what differs in the second part. Use the 'ruler' to
616
- relate it to the position in the first or second dump.
623
+ relate it to the position in the first or second dump. Letters indicate the
624
+ kind of difference:
625
+ X different character
626
+ > cursor in first but not in second
627
+ < cursor in second but not in first
628
+ w character width differs (single vs double width)
629
+ f foreground color differs
630
+ b background color differs
631
+ a attribute differs (bold, underline, reverse, etc.)
632
+ ? character missing in both
633
+ + character missing in first
634
+ - character missing in second
617
635
618
636
Alternatively, press "s" to swap the first and second dump. Do this several
619
637
times so that you can spot the difference in the context of the text.
@@ -635,7 +653,7 @@ Starting ~
635
653
Load the plugin with this command: >
636
654
packadd termdebug
637
655
< *:Termdebug*
638
- To start debugging use `:Termdebug ` or `:TermdebugCommand ` ` followed by the
656
+ To start debugging use `:Termdebug ` or `:TermdebugCommand ` followed by the
639
657
command name, for example: >
640
658
:Termdebug vim
641
659
@@ -900,7 +918,7 @@ Vim window width *termdebug_wide*
900
918
To change the width of the Vim window when debugging starts, and use a
901
919
vertical split: >
902
920
let g:termdebug_wide = 163
903
- This will set &columns to 163 when :Termdebug is used. The value is restored
921
+ This will set &columns to 163 when ` :Termdebug ` is used. The value is restored
904
922
when quitting the debugger.
905
923
If g:termdebug_wide is set and &columns is already larger than
906
924
g:termdebug_wide then a vertical split will be used without changing &columns.
0 commit comments