You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each command takes the name of a file as an 1 optional argument, optionally
60
+
Each command takes the name of a file as an optional argument, optionally
65
61
followed by any command-line arguments. Without any arguments, the current
66
62
buffer that is executing the command will be ran with no arguments.
67
63
64
+
##### :Executioner
65
+
66
+
The file will be executed in a shell, where any output will be printed there.
68
67
For example:
69
68
```
70
69
:Executioner
71
70
```
72
-
will attempt to execute the current buffer.
71
+
will attempt to execute the current buffer with no command-line arguments.
73
72
```
74
73
:Executioner test.py
75
74
```
76
-
will attempt to execute `test.py` in the current working directory.
75
+
will attempt to execute `test.py` in the current working directory with no
76
+
command-line arguments.
77
77
```
78
78
:Executioner test.py foo bar 4
79
79
```
80
80
will attempt to execute `test.py` in the current working directory, with the
81
-
arguments `foo`, `bar` and `4`.
81
+
command-line arguments `foo`, `bar` and `4`.
82
+
83
+
##### :ExecutionerHorizontal
84
+
85
+
If Vim has `terminal` window support, then the file will be executed in
86
+
a horizontally-split terminal window. Once the program execution is completed,
87
+
the output will be saved in a 'readonly' buffer.
88
+
89
+
Otherwise, the file will be executed in a shell and its output will be saved
90
+
in a horizontally-split 'readonly' buffer. The difference is that without
91
+
|terminal| support, no input from the user can be made during the program's
92
+
runtime.
93
+
94
+
##### :ExecutionerHorizontalBuffer
95
+
96
+
Same as `:ExecutionerHorizontal` with no |terminal| window support, forcing
97
+
a shell to execute the file and save the output in a horizontally-split
98
+
'readonly' buffer.
99
+
100
+
##### :ExecutionerVertical
101
+
102
+
If Vim has `terminal` window support, then the file will be executed in
103
+
a vertically-split terminal window. Once the program execution is completed,
104
+
the output will be saved in a 'readonly' buffer.
105
+
106
+
Otherwise, the file will be executed in a shell and its output will be saved
107
+
in a vertically-split 'readonly' buffer. The difference is that without
108
+
`terminal` support, no input from the user can be made during the program's
109
+
runtime.
110
+
111
+
##### :ExecutionerVerticalBuffer
112
+
113
+
Same as `:ExecutionerVertical` with no `terminal` window support, forcing
114
+
a shell to execute the file and save the output in a vertically-split
115
+
'readonly' buffer.
82
116
83
-
If you running a version of Vim that has the integrated terminal feature (i.e.
84
-
`:echo has("terminal")` returns 1), then the horizontal and vertical commands
85
-
open a terminal buffer to output the command, allowing for potential user
86
-
input.
117
+
#### Terminal Window vs. Buffer
118
+
119
+
There are advantages and disadvantages to using either the terminal or buffer
120
+
for split window execution. Perhaps some day in the future this distinction
121
+
will no longer exist and there will be a unified solution.
122
+
123
+
|| Terminal | Buffer |
124
+
|:----:|:--------:|:------:|
125
+
| Pros | - Accepts standard input from user <br> - Prints standard output during program execution | - Can execute multiple commands directly <br> - Accepts standard input and output redirection |
126
+
| Cons | - Cannot execute multiple commands directly <br> - Does not accept standard input and output redirection | - Does not accept standard input from user <br> - Prints standard output after program execution is complete |
127
+
128
+
##### Standard Input and Standard Output
129
+
130
+
If you running a version of Vim that has terminal window support, (i.e. `:echo
131
+
has("terminal")` returns `1`), then the horizontal and vertical commands open
132
+
an interactive terminal window which updates live as the program is being
133
+
executed. This allows for user input from standard input, and displaying of
134
+
standard output as it is being printed.
87
135
88
136
Without the terminal feature available, the horizontal and vertical commands
89
-
stores the output of the executed program in a read-only buffer. Due to this
90
-
reason, it will not work for programs that require user input.
137
+
run the program until completion, and store the standard output of the
138
+
executed program in a read-only buffer. Due to this reason, it will not work
139
+
for programs that require user input and will not update the standard output
140
+
over the course of the program execution.
141
+
142
+
##### Multiple Commands
143
+
144
+
Certain file types that involve multiple commands to be executed, such as
145
+
compiling before executing, do not work with terminal windows. This is because
146
+
terminal windows treat every space-separated term after the first argument as
147
+
command-line arguments, including ones that end with `;`.
91
148
92
-
#### Key mappings
149
+
Any terminal window command that involves multiple commands will fall back to
150
+
the buffer equivalent if multiple commands are found.
151
+
152
+
##### Input and Output Redirection
153
+
154
+
For the same reason as multiple commands, terminal windows treat every
155
+
space-separated term after the first argument as a command-line argument,
156
+
including `>`, `<`, and `|` characters.
157
+
158
+
Any terminal window command that involves input redirection will fall back to
159
+
the buffer equivalent if input redirection operators are found.
160
+
161
+
#### Key Mappings
93
162
94
163
By default, Executioner does not provide any key mappings as to not override
95
164
mappings defined in your `vimrc`. You can map these commands to however you
0 commit comments