3
3
This plugin allows you to easily execute files in the terminal or a separate
4
4
buffer.
5
5
6
- ** NOTE: This plugin is currently in a pre-release state. It works at a basic level, but I don't feel like it is ready for its first "real" release. Functionality is currently being added and bugs are getting ironed out.**
6
+ ** NOTE: This plugin is currently in a pre-release state. It works at a basic
7
+ level, but I don't feel like it is ready for its first "real" release.
8
+ Functionality is currently being added and bugs are getting ironed out.**
7
9
8
10
![ ] ( https://raw.githubusercontent.com/wiki/EvanQuan/vim-executioner/executioner.PNG )
9
11
@@ -12,12 +14,10 @@ Table of Contents
12
14
1 . [ Installation] ( #installation )
13
15
2 . [ Usage] ( #usage )
14
16
- [ Commands] ( #commands )
15
- - [ Command line arguments] ( #command-line-arguments )
16
17
- [ Key mappings] ( #key-mappings )
17
18
3 . [ Configure Executable Files] ( #configure-executable-files )
18
19
- [ Full and base name symbols] ( #full-and-base-name-symbols )
19
20
- [ Commands] ( #commands-1 )
20
- 4 . [ Frequently Asked Questions]
21
21
22
22
## Installation
23
23
@@ -65,35 +65,34 @@ This package comes with 3 commands:
65
65
- ` :ExecutionerHorizontal `
66
66
- ` :ExecutionerVertical `
67
67
68
- Each command takes the name of a file as an 1 optional argument. Without any
69
- arguments, the current buffer that is executing the command will be ran.
68
+ Each command takes the name of a file as an 1 optional argument, optionally
69
+ followed by any command-line arguments. Without any arguments, the current
70
+ buffer that is executing the command will be ran with no arguments.
70
71
71
72
For example:
72
73
```
74
+ :Executioner
75
+ ```
76
+ will attempt to execute the current buffer.
77
+ ```
73
78
:Executioner test.py
74
79
```
75
- will attempt to execute ` test.py ` in the current working directory, while
80
+ will attempt to execute ` test.py ` in the current working directory.
76
81
```
77
- :Executioner
82
+ :Executioner test.py foo bar 4
78
83
```
79
- will attempt to execute the current buffer.
84
+ will attempt to execute ` test.py ` in the current working directory, with the
85
+ arguments ` foo ` , ` bar ` and ` 4 ` .
80
86
81
87
If you running a version of Vim that has the integrated terminal feature (i.e.
82
88
` :echo has("terminal") ` returns 1), then the horizontal and vertical commands
83
89
open a terminal buffer to output the command, allowing for potential user
84
90
input.
85
91
86
92
Without the terminal feature available, the horizontal and vertical commands
87
- stores the output of the executed program in a readonly buffer. Due to this
93
+ stores the output of the executed program in a read-only buffer. Due to this
88
94
reason, it will not work for programs that require user input.
89
95
90
- #### Command line arguments
91
-
92
- You can pass in command line arguments for Executioner to use.
93
-
94
- For example, ` :Executioner test.js arg1 arg2 arg3 ` will pass ` arg1 ` , ` arg2 ` ,
95
- and ` arg3 ` as arguments for the execution command on the file ` test.js ` .
96
-
97
96
#### Key mappings
98
97
99
98
By default, Executioner does not provide any key mappings as to not override
@@ -122,6 +121,9 @@ nnoremap <silent> <leader>hrm :ExecutionerHorizontal makefile<CR>
122
121
nnoremap <silent> <leader>vrm :ExecutionerVertical makefile<CR>
123
122
```
124
123
124
+ Due to the complexity of many projects that span a large number of files, I use
125
+ makefiles and ` run.sh ` to compile and run code without needing to worry about
126
+ what file I'm currently editing.
125
127
126
128
## Configure Executable Files
127
129
@@ -140,7 +142,7 @@ let g:executioner#base_name = '@'
140
142
141
143
For example, if you want to run a C file by compiling it first, you can define
142
144
its command as ` 'c' : 'gcc % -o @.out; ./@.out' ` in ` g:executioner#commands ` ,
143
- which will compile a ` .out ` fie with the same base name as the source file,
145
+ which will compile a ` .out ` file with the same base name as the source file,
144
146
and then execute it.
145
147
146
148
#### Commands
@@ -149,8 +151,8 @@ There are 2 dictionaries that define what types of files can be executed:
149
151
150
152
With ` g:executioner#extensions ` , Executioner can execute a command based on the
151
153
extension of a file name. With ` g:executioner#names ` , Executioner can execute
152
- a command based on a file name. If not defined in your ` .vimrc ` , they are
153
- by default defined as:
154
+ a command based on a file name. If not defined in your ` .vimrc ` , they are by
155
+ default defined as:
154
156
155
157
``` vim
156
158
" extension : command
@@ -198,9 +200,3 @@ to use. For example: if `g:executioner#extensions` dictates that `py` files are
198
200
to be executed with ` python3 ` and ` g:executioner#names ` dictates that ` foo.py `
199
201
is to be executed with ` python2 ` , then ` foo.py ` will be executed with
200
202
` python2 ` .
201
-
202
- ## Frequently Asked Questions
203
-
204
- How to run more complicated projects?
205
- - make
206
- - bash run.sh
0 commit comments