forked from Shougo/vimshell.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimshell.txt
1606 lines (1297 loc) · 54.3 KB
/
vimshell.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*vimshell.txt* Powerful shell implemented by Vim script
Version: 11.1
Author : Shougo <[email protected]>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
CONTENTS *vimshell-contents*
Introduction |vimshell-introduction|
Install |vimshell-install|
Interface |vimshell-interface|
Commands |vimshell-commands|
Variables |vimshell-variables|
Functions |vimshell-functions|
Key mappings |vimshell-key-mappings|
Vimshell buffer key mappings |vimshell-buffer-key-mappings|
Interactive buffer key mappings |vimshell-interactive-buffer-key-mappings|
Options |vimshell-options|
Examples |vimshell-examples|
Internal Commands |vimshell-internal-commands|
Special Commands |vimshell-special-commands|
Alter Command |vimshell-alter-command|
Hook |vimshell-hook|
Tips |vimshell-tips|
Unite sources |vimshell-unite-sources|
Create plugin |vimshell-create-plugin|
FAQ |vimshell-faq|
==============================================================================
INTRODUCTION *vimshell-introduction*
*vimshell* is an extreme shell that doesn't depend on external shells but is
written completely in pure Vim script. To be honest the implementation is not
as mature as eshell yet. The most important characteristic of vimshell is that
it can collaborate with other Vim plugins. Additionally, for example, vimshell
also works on Windows where there are no good shells at all; note that you
cannot use full set of vimshell features on Windows though. Furthermore,
vimshell borrowed handy functionalities from other shells. Vimshell has
built-in functionalities that you had to set up to enable if it's on zsh.
Vimshell doesn't pursue being completely compatible with average shells but
aims to be a handy shell, so some behaviours like the rule of variables are a
little bit different to them.
==============================================================================
USAGE *vimshell-usage*
You can start vimshell in ":VimShell", or use helpful keymap already defined.
Because vimshell works similar with a common shell, you may operate it
intuitively. But vimshell performs the path appointment in '/'.
Vimshell fails to recognize escape sequences when you use '\' on Windows
for a path and does not work.
vimshell reads .vimshrc as initialize file.
It might be helpful to add alias configurations.
Note: vimshell has nothing to do with bash or zsh, so as to have no
compatibilities. vimshell doesn't read .bashrc or .zshrc, but environment
variables by "vimshell-internal-source".
==============================================================================
INSTALL *vimshell-install*
vimshell depends on |vimproc|
http://github.com/Shougo/vimproc
You must install and compile vimproc Ver.5.0 (or later) before using vimshell
(refer to |vimproc-install|).
==============================================================================
INTERFACE *vimshell-interface*
------------------------------------------------------------------------------
COMMANDS *vimshell-commands*
:VimShell [{options}...] [{path}] *:VimShell*
Runs vimshell. The {path} will be its current directory.
If you omit {path}, it uses Vim's current directory (or does
not change the current directory).
If another vimshell buffer exists in the current tab, switches
to the vimshell buffer and changes its current directory to
{path}.
Note: This feature is if installed unite.vim only.
{options} are options for a vimshell buffer. See
|vimshell-options|.
:VimShellCreate [{options}...] [{path}] *:VimShellCreate*
Runs vimshell as the same :VimShell, but it creates a new
vimshell buffer instead of activating other vimshells which
are up and running.
:VimShellTab [{options}...] [{path}] *:VimShellTab*
It's same as |:VimShell|, but creates a new tab.
:VimShellPop [{options}...] [{path}] *:VimShellPop*
Like as |:VimShell|, but this command popups little window.
It will be your help when you want to make vimshell a bit
help. To split it, |g:vimshell_popup_command| is suited
command.
Note: It sets |vimshell-options-toggle|. You can toggle
vimshell buffer.
:VimShellCurrentDir [{options}...] [{path}] *:VimShellCurrentDir*
Like as |:VimShell|, but move to the current directory.
:VimShellBufferDir [{options}...] [{path}] *:VimShellBufferDir*
Like as |:VimShell|, but move to buffer's directory.
:VimShellExecute [{option}] [{command}] *:VimShellExecute*
It does not run vimshell, but launches a terminal program you
Specify by {command}, and this program runs in background.
You can use vimshell like as GNU screen.
{option} is same to |vimshell-internal-bg| options.
If omit {command}, current buffer path is used.
:VimShellInteractive [{option}] [{command}] *:VimShellInteractive*
It does not run vimshell, but launches an interpreter program
you specify by {command}. It is same as Emacs's M-x
{interpreter-name}. You leave out {command}, vimshell uses
the value in |g:vimshell_interactive_interpreter_commands|.
{option} is same to |vimshell-internal-iexe| options.
Resize window example:
>
VimShellInteractive --split='split | resize 20' irb
<
:[range]VimShellSendString {string} *:VimShellSendString*
It sends selected string to the interpreter in background
buffer of vimshell, iexe. You can control interpreter as if
you are using |quickrun|.
Cf: |vimshell#interactive#send()|
Note: If interpreter is not loaded in the current tab,
|g:vimshell_interactive_interpreter_commands| is used or you
can run interpreter command.
:VimShellSendBuffer {bufname} *:VimShellSendBuffer*
Sets background buffer as {bufname}. When {bufname} isn't
showed, it will be opened automatically.
:VimShellClose [{buffer-name}] *:VimShellClose*
Closes the vimshell buffer with {buffer-name}.
Note: Closes the last vimshell buffer you used in current tab
if you skip specifying {buffer-name}.
------------------------------------------------------------------------------
VARIABLES *vimshell-variables*
g:vimshell_prompt *g:vimshell_prompt*
Sets vimshell default prompt string. Initial value is
"vimshell%".
Note: This is a fixed string. You cannot change it
dynamically (for example: current directory).
(cf: |g:vimshell_user_prompt|)
g:vimshell_prompt_expr *g:vimshell_prompt_expr*
Sets vimshell default prompt expression. Initial value is
"". This value is evaluated when vimshell redraws prompt.
Note: You cannot get multi-line prompt.
Note: If you set it, you must set prompt_pattern.
Note: You cannot change prompt color dynamically.
>
" Use current directory as vimshell prompt.
let g:vimshell_prompt_expr =
\ 'escape(fnamemodify(getcwd(), ":~").">", "\\[]()?! ")." "'
let g:vimshell_prompt_pattern = '^\%(\f\|\\.\)\+> '
<
g:vimshell_prompt_pattern *g:vimshell_prompt_pattern*
Sets the pattern which matches vimshell prompt. Initial value
is "". If it is not set, vimshell will set the pattern
automatically.
g:vimshell_secondary_prompt *g:vimshell_secondary_prompt*
Sets vimshell default secondary prompt string. Initial value
is "%%".
Note: This is fixed string. You cannot change it
dynamically (for example: current directory).
(cf: |g:vimshell_user_prompt|)
g:vimshell_user_prompt *g:vimshell_user_prompt*
You can define additional prompt to substitute a string for
this.
Note: Unlike |g:vimshell_prompt|, it can be a non-fixed
string. You can get multi-line prompt by separating "user
prompt" with "\n".
This example will be helpful to show the current directory
every time.
>
let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
<
g:vimshell_right_prompt *g:vimshell_right_prompt*
It's zsh-like right prompt. This value is a string value which
is an expression of Vim script. Similar to
|g:vimshell_user_prompt|, but this calculates the window size,
and shows the prompt on preferable position.
Initial value is an empty string.
*g:vimshell_force_overwrite_statusline*
g:vimshell_force_overwrite_statusline
If this variable is 1, vimshell will overwrite 'statusline'
automatically.
Note: If you want to change 'statusline' in vimshell buffer,
you must set it to 0.
The default value is 0.
*g:vimshell_no_default_keymappings*
g:vimshell_no_default_keymappings
Disables all default key mappings in vimshell.
You cannot use vimshell functions unless you set new
key mappings, so it is for hackers who have understood the
inner behaviors, and not recommended for newbies.
*g:vimshell_use_terminal_command*
g:vimshell_use_terminal_command
When executes |vimshell-internal-shell|, this option set
terminal program execute shell.
"ckw -e" in Windows, "gnome-terminal -e" in Linux,
become a candidate of value.
Initial value is an empty string.
g:vimshell_data_directory *g:vimshell_data_directory*
Specify directories to store vimshell configurations. And
history file is saved in this directory.
Default value is "$XDG_DATA_HOME/vimshell" or
expand("~/.local/share/vimshell"); the absolute path of it.
g:vimshell_temporary_directory *g:vimshell_temporary_directory*
Note: It is deprecated name.
g:vimshell_max_command_history *g:vimshell_max_command_history*
Maximum number of entries in history.
If it is < 0, you can use infinite histories.
Initial value is 1000.
g:vimshell_max_directory_stack *g:vimshell_max_directory_stack*
Maximum number of directory stacks saved by vimshell.
Initial value is 100.
g:vimshell_vimshrc_path *g:vimshell_vimshrc_path*
Sets a setting file read by vimshell first.
This is similar to .bashrc in bash. It is convenient when you
define aliases.
Initial Value is "expand('~/.vim/vimshrc')" or
"expand('~/.vimshrc')".
g:vimshell_escape_colors *g:vimshell_escape_colors*
A list of colors correspond to coloring in escape sequence.
0-8 as normal colors, 9-15 as highlight colors.
Initial value is written in plugin/vimshell.vim.
*g:vimshell_disable_escape_highlight*
g:vimshell_disable_escape_highlight
This value controls whether vimshell highlights escape
sequences. Disabling this function make vimshell faster
because processing this is hard task.
Note: This value is negative logic, so True means disabling.
Default value is 0.
g:vimshell_cat_command *g:vimshell_cat_command*
Sets $PAGER command path.
Note: This variable is useful for using pager commands.
For example, "git log".
Note: You *must not* set "core.pager" variable in your
.gitconfig.
Initial value is "cat".
g:vimshell_editor_command *g:vimshell_editor_command*
Sets $EDITOR command path.
Note: This variable is useful for using editor commands.
For example, "git commit" or "git rebase -i" commands.
Note: This feature required GUI Vim and supported
|+clientserver| feature.
Note: To reflect external editor changes, you must write
opened temporary buffer and execute |:bdelete| in external
editor.
Note: You *must not* set "core.editor" variable in your
.gitconfig.
Initial value "v:progname --servername=v:servername
--remote-tab-wait-silent" or same to |g:vimshell_cat_command|.
g:vimshell_environment_term *g:vimshell_environment_term*
This value is $TERM on vimshell.
Default value is "xterm".
g:vimshell_split_command *g:vimshell_split_command*
Vimshell uses this as the Ex command to split window. If you
set this "nicely", vimshell adjusts with the current window
size and splits window preferable ("nicely" depends on the
winwidth variable).
Empty means disabling window splitting on vimshell.
"tabnew" means vimshell opens new tab.
"vsplit" means vertical splitting.
Default value is "nicely".
g:vimshell_popup_command *g:vimshell_popup_command*
Vimshell uses this as the Ex command to split window in
|:VimShellPop|.
If you leave this empty, vimshell uses "split" and
|g:vimshell_popup_height|.
Default value is "".
g:vimshell_popup_height *g:vimshell_popup_height*
This value is split height of |:VimShellPop|.
This value is ratio percent against |winheight(0)|.
Note: It is not used on non vimshell buffers (for example:
interactive buffer).
Default value 30.
g:vimshell_cd_command *g:vimshell_cd_command*
This is the Ex command to change the current directory.
Default value is "lcd".
*g:vimshell_no_save_history_commands*
g:vimshell_no_save_history_commands
This is a dictionary value that has keys of the command name
that vimshell doesn't save in history.
Default value is
{'history' : 1, 'h' : 1, 'histdel' : 1, 'cd' : 1,}.
g:vimshell_scrollback_limit *g:vimshell_scrollback_limit*
This value is the maximum size of command output. Output
buffer will be trim down if output is more than this value.
Default value is 1000.
*g:vimshell_enable_transient_user_prompt*
g:vimshell_enable_transient_user_prompt
If it is non-zero, vimshell will delete user prompt and right
prompt line after executing |<Plug>(vimshell_enter)| .
Default value is 0.
*g:vimshell_enable_start_insert*
g:vimshell_enable_start_insert
If it is non-zero, vimshell will start in insert mode.
Default value is 1.
*g:vimshell_enable_stay_insert*
g:vimshell_enable_stay_insert
If it is non-zero, vimshell will stay in insert mode after
the command executed.
Default value is 1.
*g:vimshell_execute_file_list*
g:vimshell_execute_file_list
This is a dictionary value that has keys of the extensions
and values of command arguments.
This is used to define default file execution command.
Default value is {}.
*g:vimshell_interactive_no_save_history_commands*
g:vimshell_interactive_no_save_history_commands
This is a dictionary value which key is a command name that
won't be save on the history in |vimshell-internal-iexe|.
If there does not exist, it will be ignored.
Default value is {}.
*g:vimshell_interactive_update_time*
g:vimshell_interactive_update_time
When |vimshell-internal-iexe| is in Insert mode, this value
controls the timing of auto update.
Note: |vimshell-internal-iexe| changes 'updatetime' based on
this value if Vim does not support |+timers|.
If it is 0, this feature is disabled.
Default value is 200.
*g:vimshell_interactive_command_options*
g:vimshell_interactive_command_options
This is a dictionary variable with command name key. The
command |vimshell-internal-iexe| runs take this as its option.
This option is used in such situation that you want to use a
command that take some particular options or doesn't work well
interactively, like in windows environments.
Default value is too complicated, so please refer
autoload/vimshell/commands/iexe.vim.
*g:vimshell_interactive_interpreter_commands*
g:vimshell_interactive_interpreter_commands
This is a dictionary variable with filetype key and it is
assignments of an interpreter name without arguments of
|:VimShellInteractive|. It is also used in
|VimShellSendString|.
Default value is too complicated, so please refer
autoload/vimshell/commands/iexe.vim.
*g:vimshell_interactive_encodings*
g:vimshell_interactive_encodings
This is a dictionary variable with command name key and it is
assignments of an encoding for the command which vimshell
runs.
If the key contains "/", vimshell will check if command path
matches it.
Default value is complicated, so please refer
autoload/vimshell/plugin/vimshell.vim.
*g:vimshell_interactive_echoback_commands*
g:vimshell_interactive_echoback_commands
This is a dictionary variable with interpreter name key, and
if the value is 1, iexe doesn't echoback when
|vimshell-internal-iexe| is running, and otherwise
does.
This value has effect only on windows.
Default value is complicated, so please refer
plugin/vimshell.vim
g:vimshell_terminal_commands *g:vimshell_terminal_commands*
This is a dictionary variable with command name key, and when
you run a command of which value is True, automatically
|vimshell-internal-iexe| is used.
Default value is complicated, so please refer
autoload/vimshell/commands/iexe.vim.
*g:vimshell_interactive_cygwin_commands*
g:vimshell_interactive_cygwin_commands
This is a dictionary variable with command name key, and the
value is an assignment of commands which runs via fakecygpty.
It is used when you launch some application that works only on
Cygwin (like ssh) by |vimshell-internal-iexe|.
To know about fakecygpty, you should refer
|vimshell-tips-fakecygpty|.
Default value is complicated, so please refer
autoload/vimshell/commands/iexe.vim.
*g:vimshell_interactive_cygwin_path*
g:vimshell_interactive_cygwin_path
It is assigned to the pass vimshell refers when launching
programs via fakecygpty.
If the first argument of |vimshell-internal-iexe| is
fakecygpty, vimshell searches command from
|g:vimshell_interactive_cygwin_path|
instead of $PATH.
Default value is 'c:/cygwin/bin'.
*g:vimshell_interactive_cygwin_home*
g:vimshell_interactive_cygwin_home
It is assigned to $HOME of the program launched via
fakecygpty. Leavin '' means to use current $HOME.
Default value is ''.
*g:vimshell_interactive_monochrome_commands*
g:vimshell_interactive_monochrome_commands
This is a dictionary variable with command name key, and the
value is an assignment of commands which you want to disable
highlighting.
Default value is complicated, so please refer
autoload/vimshell/commands/iexe.vim.
*g:unite_source_vimshell_external_history_path*
g:unite_source_vimshell_external_history_path
It is assignment of a history file that
|vimshell/external_history| source recognizes.
Default value is set to suit for 'shell' value.
------------------------------------------------------------------------------
KEY MAPPINGS *vimshell-key-mappings*
<Plug>(vimshell_split_switch) *<Plug>(vimshell_split_switch)*
Split screen and switches vimshell buffer.
<Plug>(vimshell_split_create) *<Plug>(vimshell_split_create)*
Split screen and creates vimshell buffer.
<Plug>(vimshell_switch) *<Plug>(vimshell_switch)*
Switches to vimshell buffer.
<Plug>(vimshell_create) *<Plug>(vimshell_create)*
Create vimshell buffer.
VIMSHELL BUFFER KEY MAPPINGS *vimshell-buffer-key-mappings*
Normal mode key mappings.
<Plug>(vimshell_enter) *<Plug>(vimshell_enter)*
Execute command line.
*<Plug>(vimshell_previous_prompt)*
<Plug>(vimshell_previous_prompt)
Move to previous prompt from cursor.
<Plug>(vimshell_next_prompt) *<Plug>(vimshell_next_prompt)*
Move to next prompt from cursor.
*<Plug>(vimshell_delete_previous_output)*
<Plug>(vimshell_delete_previous_output)
Delete previous output form cursor.
<Plug>(vimshell_paste_prompt) *<Plug>(vimshell_paste_prompt)*
Paste cursor line to last prompt.
*<Plug>(vimshell_move_end_argument)*
<Plug>(vimshell_move_end_argument)
Move to command end argument.
<Plug>(vimshell_hide) *<Plug>(vimshell_hide)*
Hide vimshell buffer.
<Plug>(vimshell_exit) *<Plug>(vimshell_exit)*
Quit vimshell buffer.
<Plug>(vimshell_change_line) *<Plug>(vimshell_change_line)*
Change whole line.
<Plug>(vimshell_delete_line) *<Plug>(vimshell_delete_line)*
Delete whole line.
<Plug>(vimshell_hangup) *<Plug>(vimshell_hangup)*
Terminate command.
<Plug>(vimshell_interrupt) *<Plug>(vimshell_interrupt)*
Send interrupt.
<Plug>(vimshell_send_eof) *<Plug>(vimshell_send_eof)*
Send EOF.
<Plug>(vimshell_insert_head) *<Plug>(vimshell_insert_head)*
*<Plug>(vimshell_insert_enter)*
<Plug>(vimshell_insert_enter)
*<Plug>(vimshell_append_enter)*
<Plug>(vimshell_append_enter)
<Plug>(vimshell_append_end) *<Plug>(vimshell_append_end)*
Enter insert mode.
Note: If your cursor is on previous prompt, vimshell will copy
the prompt automatically.
<Plug>(vimshell_clear) *<Plug>(vimshell_clear)*
Redraw vimshell buffer.
<Plug>(vimshell_move_head) *<Plug>(vimshell_move_head)*
Move to head.
*<Plug>(vimshell_execute_by_background)*
<Plug>(vimshell_execute_by_background)
Execute command by iexe.
Insert mode key mappings.
*i_<Plug>(vimshell_command_complete)*
<Plug>(vimshell_command_complete)
Start completion.
<Plug>(vimshell_zsh_complete) *i_<Plug>(vimshell_zsh_complete)*
Start completion using zsh.
Note: Required zsh and unite plugin.
https://github.com/Shougo/unite.vim
Note: It does not work in Windows!
*i_<Plug>(vimshell_push_current_line)*
<Plug>(vimshell_push_current_line)
Push current line command to command line stack.
*i_<Plug>(vimshell_insert_last_word)*
<Plug>(vimshell_insert_last_word)
Insert command last word.
<Plug>(vimshell_move_head) *i_<Plug>(vimshell_move_head)*
Move to line head.
*i_<Plug>(vimshell_delete_backward_line)*
<Plug>(vimshell_delete_backward_line)
Delete backward line from cursor.
*i_<Plug>(vimshell_delete_backward_word)*
<Plug>(vimshell_delete_backward_word)
Delete backward word from cursor.
<Plug>(vimshell_enter) *i_<Plug>(vimshell_enter)*
Execute command.
<Plug>(vimshell_interrupt) *i_<Plug>(vimshell_interrupt)*
Send interrupt.
*i_<Plug>(vimshell_move_previous_window)*
<Plug>(vimshell_move_previous_window)
Move to previous window.
*i_<Plug>(vimshell_delete_backward_char)*
<Plug>(vimshell_delete_backward_char)
*i_<Plug>(vimshell_another_delete_backward_char)*
<Plug>(vimshell_another_delete_backward_char)
Delete backward char from cursor.
*i_<Plug>(vimshell_delete_forward_line)*
<Plug>(vimshell_delete_forward_line)
Delete forward line from cursor.
<Plug>(vimshell_clear) *i_<Plug>(vimshell_clear)*
Redraw vimshell buffer.
*i_<Plug>(vimshell_execute_by_background)*
<Plug>(vimshell_execute_by_background)
Execute command by iexe.
<Plug>(vimshell_hide) *i_<Plug>(vimshell_hide)*
Hide vimshell buffer.
<Plug>(vimshell_exit) *i_<Plug>(vimshell_exit)*
Quit vimshell buffer.
<Plug>(vimshell_history_unite) *i_<Plug>(vimshell_history_unite)*
Execute vimshell history by unite interface.
Note: To use it, you must install |unite.vim| plugin.
*i_<Plug>(vimshell_history_complete)*
<Plug>(vimshell_history_complete)
Execute vimshell history by the completion interface.
Note: To use it, you must install |neocomplete| or |deoplete|
plugin.
*vimshell_default_key_mappings*
Normal mode default key mappings.
{lhs} {rhs}
-------- -----------------------------
<CR> <Plug>(vimshell_enter)
q <Plug>(vimshell_hide)
Q <Plug>(vimshell_exit)
<C-p> <Plug>(vimshell_previous_prompt)
<C-n> <Plug>(vimshell_next_prompt)
<C-y> <Plug>(vimshell_paste_prompt)
E <Plug>(vimshell_move_end_argument)
cc <Plug>(vimshell_change_line)
dd <Plug>(vimshell_delete_line)
I <Plug>(vimshell_insert_head)
A <Plug>(vimshell_append_end)
i <Plug>(vimshell_insert_enter)
a <Plug>(vimshell_append_enter)
^ <Plug>(vimshell_move_head)
<C-c> <Plug>(vimshell_interrupt)
<C-k> <Plug>(vimshell_hangup)
<C-l> <Plug>(vimshell_clear)
<C-z> <Plug>(vimshell_execute_by_background)
*v_vimshell_default_key_mappings*
Visual mode default key mappings.
{lhs} {rhs}
-------- -----------------------------
*i_vimshell_default_key_mappings*
Insert mode default key mappings.
{lhs} {rhs}
-------- -----------------------------
<CR> <Plug>(vimshell_enter)
<C-l> <Plug>(vimshell_history_unite)
<C-p>/<Up> <Plug>(vimshell_history_complete)
<C-n>/<Down> <Plug>(vimshell_history_complete)
<TAB> <Plug>(vimshell_command_complete)
<C-a> <Plug>(vimshell_move_head)
<C-u> <Plug>(vimshell_delete_backward_line)
<C-w> <Plug>(vimshell_delete_backward_word)
<C-z> (while execute) <Plug>(vimshell_execute_by_background)
(other) <Plug>(vimshell_push_current_line)
<C-t> <Plug>(vimshell_insert_last_word)
<C-c> <Plug>(vimshell_interrupt)
<C-d> <Plug>(vimshell_send_eof)
<C-h> <Plug>(vimshell_delete_backward_char)
<BS> <Plug>(vimshell_delete_backward_char)
<C-k> <Plug>(vimshell_delete_forward_line)
VIMSHELL INTERACTIVE BUFFER KEY MAPPINGS
*vimshell-interactive-buffer-key-mappings*
Normal mode key mappings.
*<Plug>(vimshell_int_execute_line)*
<Plug>(vimshell_int_execute_line)
Execute cursor line.
*<Plug>(vimshell_int_previous_prompt)*
<Plug>(vimshell_int_previous_prompt)
Move to previous prompt from cursor.
*<Plug>(vimshell_int_next_prompt)*
<Plug>(vimshell_int_next_prompt)
Move to next prompt from cursor.
*<Plug>(vimshell_int_paste_prompt)*
<Plug>(vimshell_int_paste_prompt)
Paste cursor line to last prompt.
<Plug>(vimshell_int_hangup) *<Plug>(vimshell_int_hangup)*
Exit executing command.
<Plug>(vimshell_int_exit) *<Plug>(vimshell_int_exit)*
Exit interactive buffer.
*<Plug>(vimshell_int_restart_command)*
<Plug>(vimshell_int_restart_command)
Restart command.
*<Plug>(vimshell_int_change_line)*
<Plug>(vimshell_int_change_line)
Change whole line.
*<Plug>(vimshell_int_delete_line)*
<Plug>(vimshell_int_delete_line)
Delete whole line.
*<Plug>(vimshell_int_insert_enter)*
<Plug>(vimshell_int_insert_enter)
*<Plug>(vimshell_int_insert_head)*
<Plug>(vimshell_int_insert_head)
*<Plug>(vimshell_int_append_enter)*
<Plug>(vimshell_int_append_enter)
*<Plug>(vimshell_int_append_end)*
<Plug>(vimshell_int_append_end)
Enter insert mode.
<Plug>(vimshell_int_clear) *<Plug>(vimshell_int_clear)*
Redraw interactive buffer.
Insert mode key mappings.
*i_<Plug>(vimshell_int_move_head)*
<Plug>(vimshell_int_move_head)
Move to line head.
*i_<Plug>(vimshell_int_delete_backward_line)*
<Plug>(vimshell_int_delete_backward_line)
Delete backward line from cursor.
*i_<Plug>(vimshell_int_delete_backward_word)*
<Plug>(vimshell_int_delete_backward_word)
Delete backward word from cursor.
*i_<Plug>(vimshell_int_execute_line)*
<Plug>(vimshell_int_execute_line)
Execute current line.
*i_<Plug>(vimshell_int_delete_backward_char)*
<Plug>(vimshell_int_delete_backward_char)
*i_<Plug>(vimshell_int_another_delete_backward_char)*
<Plug>(vimshell_int_another_delete_backward_char)
Delete backward character from cursor.
*i_<Plug>(vimshell_int_send_input)*
<Plug>(vimshell_int_send_input)
Send user input.
*i_<Plug>(vimshell_int_interrupt)*
<Plug>(vimshell_int_interrupt)
Send interrupt to command.
*i_<Plug>(vimshell_int_command_complete)*
<Plug>(vimshell_int_command_complete)
Start completion.
*i_<Plug>(vimshell_int_delete_forward_line)*
<Plug>(vimshell_int_delete_forward_line)
Delete forward line from cursor.
*i_<Plug>(vimshell_int_history_unite)*
<Plug>(vimshell_int_history_unite)
Execute vimshell history by unite interface.
Note: To use it, you must install |unite.vim| plugin.
*vimshell_int_default_key_mappings*
Normal mode default key mappings.
{lhs} {rhs}
-------- -----------------------------
<C-p> <Plug>(vimshell_int_previous_prompt)
<C-n> <Plug>(vimshell_int_next_prompt)
<CR> <Plug>(vimshell_int_execute_line)
<C-y> <Plug>(vimshell_int_paste_prompt)
<C-z> <Plug>(vimshell_int_restart_command)
<C-c> <Plug>(vimshell_int_interrupt)
q <Plug>(vimshell_int_exit)
cc <Plug>(vimshell_int_change_line)
dd <Plug>(vimshell_int_delete_line)
I <Plug>(vimshell_int_insert_head)
A <Plug>(vimshell_int_append_end)
i <Plug>(vimshell_int_insert_enter)
a <Plug>(vimshell_int_append_enter)
<C-l> <Plug>(vimshell_int_clear)
*i_vimshell_int_default_key_mappings*
Insert mode default key mappings.
{lhs} {rhs}
-------- -----------------------------
<C-h> <Plug>(vimshell_int_delete_backward_char)
<BS> <Plug>(vimshell_int_delete_backward_char)
<C-a> <Plug>(vimshell_int_move_head)
<C-u> <Plug>(vimshell_int_delete_backward_line)
<C-w> <Plug>(vimshell_int_delete_backward_word)
<C-k> <Plug>(vimshell_int_delete_forward_line)
<CR> <Plug>(vimshell_int_execute_line)
<C-c> <Plug>(vimshell_int_interrupt)
<C-l> <Plug>(vimshell_int_history_unite)
<C-v> <Plug>(vimshell_int_send_input)
<C-n> <C-n>
<TAB> Select candidate or start completion
------------------------------------------------------------------------------
FUNCTIONS *vimshell-functions*
vimshell#get_status_string() *vimshell#get_status_string()*
Returns vimshell status string. It is useful to custom
statusline.
vimshell#set_execute_file({exts}, {command}) *vimshell#set_execute_file()*
Defines file execution command when it has {exts}.
{exts} is comma separated file extensions.
{command} is command arguments.
(See: |g:vimshell_execute_file_list|)
*vimshell#interactive#send()*
vimshell#interactive#send({expr})
It sends {expr} to the interpreter in background buffer of
vimshell, iexe. You can control interpreter as if you are
using |quickrun|.
{expr} is string or list.
Note: If interpreter is not loaded in current tab, you can run
interpreter command.
*vimshell#interactive#send_string()*
vimshell#interactive#send_string({expr})
Deprecated. Use |vimshell#interactive#send()| instead; they
are equivalent.
vimshell#hook#set({hook-point}, {func-list}) *vimshell#hook#set()*
Defines hook functions {func-list} in {hook-point}. The old
hook points are overwrite. Vimshell call {func-list} by list
order.
vimshell#hook#get({hook-point}) *vimshell#hook#get()*
Returns {hook-point} hook as dictionary.
*vimshell#hook#add()*
vimshell#hook#add({hook-point}, {hook-name}, {func})
Adds {hook-name} hook {func} in {hook-point}. If {hook-name}
already exists, overwrite it.
*vimshell#hook#remove()*
vimshell#hook#remove({hook-point}, {hook-name})
Deletes {hook-name} function in {hook-point}.
------------------------------------------------------------------------------
OPTIONS *vimshell-options*
{options} are options for a vimshell buffer. You may give the
following parameters for an option; you must escape with "\"
when it contains spaces.
*vimshell-options-buffer-name*
-buffer-name={buffer-name}
Specifies a buffer name. The default buffer name is 'default'.
Note: Buffer name must not contain spaces.
*vimshell-options-toggle*
-toggle
Close vimshell buffer window if this vimshell buffer name
window is exists.
*vimshell-options-create*
-create
Create new vimshell buffer.
*vimshell-options-split*
-split
Split vimshell buffer window. And
|vimshell-options-split-command| is used.
*vimshell-options-popup*
-popup
Popup split vimshell buffer window.
|vimshell-options-split-command| is used.
*vimshell-options-split-command*
-split-command={command-name}
Specify split command.
*vimshell-options-prompt*
-prompt={prompt}
Specify prompt string. If omit it, |g:vimshell_prompt| is
used.
*vimshell-options-prompt_expr*
-prompt_expr={expr}
Specify prompt expression. If omit it,
|g:vimshell_prompt_expr| is used.
*vimshell-options-prompt_pattern*
-prompt_pattern={expr}
Specify prompt pattern. If omit it,
|g:vimshell_prompt_pattern| is used.
*vimshell-options-secondary-prompt*
-secondary-prompt={secondary-prompt}
Specify secondary prompt string. If omit it,
|g:vimshell_secondary_prompt| is used.
*vimshell-options-user-prompt*
-user-prompt={user-prompt}
Specify secondary prompt string. If omit it,
|g:vimshell_user_prompt| is used.
*vimshell-options-right-prompt*
-right-prompt={right-prompt}
Specify right prompt string. If omit it,
|g:vimshell_right_prompt| is used.
*vimshell-options-project*
-project
Move to project directory.
*vimshell-options-quit*
-quit
Quit buffer after command finished.
If |vimshell-options-popup| is enabled, switch to previous
window.
==============================================================================
EXAMPLES *vimshell-examples*
>
let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
"let g:vimshell_right_prompt = 'vcs#info("(%s)-[%b]", "(%s)-[%b|%a]")'
if has('win32') || has('win64')
" Display user name on Windows.
let g:vimshell_prompt = $USERNAME."% "
else
" Display user name on Linux.
let g:vimshell_prompt = $USER."% "
endif
" Initialize execute file list.
let g:vimshell_execute_file_list = {}
call vimshell#set_execute_file('txt,vim,c,h,cpp,d,xml,java', 'vim')
let g:vimshell_execute_file_list['rb'] = 'ruby'
let g:vimshell_execute_file_list['pl'] = 'perl'
let g:vimshell_execute_file_list['py'] = 'python'
call vimshell#set_execute_file('html,xhtml', 'gexe firefox')
autocmd FileType vimshell
\ call vimshell#altercmd#define('g', 'git')
\| call vimshell#altercmd#define('i', 'iexe')
\| call vimshell#altercmd#define('l', 'll')
\| call vimshell#altercmd#define('ll', 'ls -l')
\| call vimshell#hook#add('chpwd', 'my_chpwd', 'MyChpwd')
function! MyChpwd(args, context)
call vimshell#execute('ls')
endfunction
autocmd FileType int-* call s:interactive_settings()
function! s:interactive_settings()
endfunction
<
==============================================================================
INTERNAL COMMANDS *vimshell-internal-commands*