Skip to content

Commit ff54911

Browse files
committed
Update docs
1 parent 403914a commit ff54911

File tree

2 files changed

+78
-24
lines changed

2 files changed

+78
-24
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ nnoremap <silent> <leader>hrm :ExecutionerHorizontal makefile<Return>
119119
nnoremap <silent> <leader>vrm :ExecutionerVertical makefile<Return>
120120
```
121121

122-
Due to the complexity of many projects that span a large number of files, I use
123-
makefiles and `run.sh` to compile and run code without needing to worry about
124-
what file I'm currently editing.
122+
Due to the complexity of many projects that span a large number of files,
123+
I use makefiles and `run.sh` to compile and run code without needing to worry
124+
about what file I'm currently editing.
125125

126126
## Configure Executable Files
127127

128128
#### Full and base name symbols
129129

130130
You may want to refer to the full file name or base name in in your commands.
131-
The full file name, which is the base name with file extension, can be referred
132-
to by `g:executioner#full_name`, while the base name can be referred to by
133-
`g:executioner#base_name`, both which you can set in your `vimrc`. By default
134-
they are defined as:
131+
The full file name, which is the base name with file extension, can be
132+
referred to by `g:executioner#full_name`, while the base name can be referred
133+
to by `g:executioner#base_name`, both which you can set in your `vimrc`. By
134+
default they are defined as:
135135

136136
```vim
137137
let g:executioner#full_name = '%'

doc/executioner.txt

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*executioner.txt* For Vim version 8.1 Last change: 2018 December 23
1+
*executioner.txt* For Vim version 8.1 Last change: 2018 December 25
22

33
_____ _ _ ~
44
| ___| | | (_) ~
@@ -22,7 +22,6 @@ CONTENTS *executioner-contents*
2222
2.1 Commands............................|executioner-commands|
2323
2.2 Variables...........................|executioner-variables|
2424
3. Mappings.................................|executioner-mappings|
25-
4. About....................................|executioner-about|
2625

2726
==============================================================================
2827
1. Intro *executioner-intro*
@@ -36,22 +35,39 @@ version of the plugin from:
3635
==============================================================================
3736
2. Functionality *executioner-functionality*
3837

39-
TODO
38+
There are two aspects to this plugin: configuring files to be ran, and running
39+
them. The commands let you run files in a Vim session, while the variables let
40+
you configure how certain files are to be ran.
4041

4142
------------------------------------------------------------------------------
4243
2.1 Commands *executioner-commands*
4344

4445
:Executioner [file] [args] *:Executioner*
4546

46-
TODO
47+
The file will be executed in in a |shell|, where any output will be printed
48+
there.
4749

4850
:ExecutionerHorizontal [file] [args] *:ExecutionerHorizontal*
4951

50-
TODO
52+
If Vim has |terminal| window support, then the file will be executed in
53+
a horizontally-split terminal window. Once the program is completed, the
54+
output will be saved in a 'readonly' buffer.
55+
56+
Otherwise, the file will be executed in a shell and its output will be saved
57+
in a horizontally-split 'readonly' buffer. The difference is that without
58+
|terminal| support, no input from the user can be made during the program's
59+
runtime.
5160

5261
:ExecutionerVertical [file] [args] *:ExecutionerVertical*
5362

54-
TODO
63+
If Vim has |terminal| window support, then the file will be executed in
64+
a vertically-split terminal window. Once the program is completed, the
65+
output will be saved in a 'readonly' buffer.
66+
67+
Otherwise, the file will be executed in a shell and its output will be saved
68+
in a vertically-split 'readonly' buffer. The difference is that without
69+
|terminal| support, no input from the user can be made during the program's
70+
runtime.
5571

5672
------------------------------------------------------------------------------
5773
2.2 Variables *executioner-variables*
@@ -128,7 +144,15 @@ Type: |Dictionary|
128144
'swift' : 'swiftc % -o @.out;./@.out',
129145
}
130146
<
131-
TODO
147+
This determines commands by file extension. For example, if you want to
148+
execute files with the `py` extension, such as `hello_world.py`, with the
149+
`python` command, (i.e. executing `python hello_world.py` in the terminal),
150+
then include: >
151+
152+
let g:executioner#extensions['py'] = 'python %'
153+
<
154+
in your |vimrc|.
155+
132156

133157
g:executioner#names *g:executioner#names*
134158

@@ -137,27 +161,57 @@ Type: |Dictionary|
137161
Value: |String|
138162
Default: `{'makefile' : 'make'}`
139163

140-
TODO
164+
This determines commands by file name. For example, if you want to execute
165+
files with the name `makefile` with the command `make`, then include: >
166+
167+
let g:executioner#names['makefile'] = 'make'
168+
<
169+
in your |vimrc|.
170+
141171

142172
g:executioner#load_defaults *g:executioner#load_defaults*
143173

144174
Type: |Number|
145175
Default: `1`
146176

147-
TODO
177+
If you wish to disable the default values of |g:executioner#extensions| and
178+
|g:executioner#names| entirely, then include: >
179+
180+
let g:executioner#load_defaults = 0
181+
<
182+
in your |vimrc|.
148183

149184
==============================================================================
150185
3. Mappings *executioner-mappings*
151186

152-
TODO
153-
154-
==============================================================================
155-
4. About *executioner-about*
187+
By default, Executioner does not provide any key mappings as to not override
188+
mappings defined in your |vimrc|. You can map these commands to however you
189+
like to make them easier to use.
190+
191+
For example, I personally use: >
192+
193+
" Run current buffer
194+
"
195+
nnoremap <silent> <leader>rf :Executioner<Return>
196+
nnoremap <silent> <leader>hrf :ExecutionerHorizontal<Return>
197+
nnoremap <silent> <leader>vrf :ExecutionerVertical<Return>
198+
199+
" run.sh
200+
"
201+
nnoremap <silent> <leader>rr :Executioner run.sh<Return>
202+
nnoremap <silent> <leader>hrr :ExecutionerHorizontal run.sh<Return>
203+
nnoremap <silent> <leader>vrr :ExecutionerVertical run.sh<Return>
204+
205+
" Makefile
206+
"
207+
nnoremap <silent> <leader>rm :Executioner makefile<Return>
208+
nnoremap <silent> <leader>hrm :ExecutionerHorizontal makefile<Return>
209+
nnoremap <silent> <leader>vrm :ExecutionerVertical makefile<Return>
210+
<
156211

157-
Executioner is authored by a poor Computer Science student studing at the
158-
University of Calgary, named Evan Quan (https://github.com/EvanQuan/).
159-
Aftering being exposed to a fair number of languages across his degree, Evan
160-
was often frustrated by a lack of unified means to execute his code in Vim.
212+
Due to the complexity of many projects that span a large number of files,
213+
I use makefiles and `run.sh` to compile and run large projects without needing
214+
to worry about what file I'm currently editing.
161215

162216
------------------------------------------------------------------------------
163217
vim:tw=78:ts=8:ft=help:noet:expandtab

0 commit comments

Comments
 (0)