@@ -102,21 +102,21 @@ For example, I personally use:
102
102
``` vim
103
103
" Run current buffer
104
104
"
105
- nnoremap <silent> <leader>rf :Executioner<CR >
106
- nnoremap <silent> <leader>hrf :ExecutionerHorizontal<CR >
107
- nnoremap <silent> <leader>vrf :ExecutionerVertical<CR >
105
+ nnoremap <silent> <leader>rf :Executioner<Return >
106
+ nnoremap <silent> <leader>hrf :ExecutionerHorizontal<Return >
107
+ nnoremap <silent> <leader>vrf :ExecutionerVertical<Return >
108
108
109
109
" run.sh
110
110
"
111
- nnoremap <silent> <leader>rr :Executioner run.sh<CR >
112
- nnoremap <silent> <leader>hrr :ExecutionerHorizontal run.sh<CR >
113
- nnoremap <silent> <leader>vrr :ExecutionerVertical run.sh<CR >
111
+ nnoremap <silent> <leader>rr :Executioner run.sh<Return >
112
+ nnoremap <silent> <leader>hrr :ExecutionerHorizontal run.sh<Return >
113
+ nnoremap <silent> <leader>vrr :ExecutionerVertical run.sh<Return >
114
114
115
115
" Makefile
116
116
"
117
- nnoremap <silent> <leader>rm :Executioner makefile<CR >
118
- nnoremap <silent> <leader>hrm :ExecutionerHorizontal makefile<CR >
119
- nnoremap <silent> <leader>vrm :ExecutionerVertical makefile<CR >
117
+ nnoremap <silent> <leader>rm :Executioner makefile<Return >
118
+ nnoremap <silent> <leader>hrm :ExecutionerHorizontal makefile<Return >
119
+ nnoremap <silent> <leader>vrm :ExecutionerVertical makefile<Return >
120
120
```
121
121
122
122
Due to the complexity of many projects that span a large number of files, I use
@@ -148,65 +148,62 @@ and then execute it.
148
148
There are 2 dictionaries that define what types of files can be executed:
149
149
150
150
` g:executioner#extensions ` determines commands by file extension. For example,
151
- if you want to execute files with the ` .foo ` extension, such as
152
- ` hello_world.foo ` , with the ` bar ` command, (i.e. executing `bar
153
- hello_world.foo ` in the terminal), then include:
151
+ if you want to execute files with the ` py ` extension, such as
152
+ ` hello_world.py ` , with the ` python ` command, (i.e. executing `python
153
+ hello_world.py ` in the terminal), then include:
154
154
``` vim
155
- let g:executioner#extensions['foo '] = 'bar %'
155
+ let g:executioner#extensions['py '] = 'python %'
156
156
```
157
157
in your ` vimrc ` .
158
158
159
- ` g:executioner#names ` determines commands by file name. For example, if you want
160
- to execute files with the name ` echo_me.txt ` with the command `echo
161
- echo_me.txt`, then include:
159
+ ` g:executioner#names ` determines commands by file name. For example, if you
160
+ want to execute files with the name ` makefile ` with the command ` make ` , then
161
+ include:
162
162
``` vim
163
- let g:executioner#names['echo_me.txt '] = 'echo echo_me.txt '
163
+ let g:executioner#names['makefile '] = 'make '
164
164
```
165
165
in your ` vimrc ` .
166
166
167
- Executioner will prioritize names over extensions when determining what command
168
- to use. For example, if
167
+ Executioner will prioritize names over extensions when determining what
168
+ command to use. For example, if
169
169
``` vim
170
170
let g:executioner#extensions['py'] = 'python3 %'
171
171
```
172
- dictates that ` . py` files are to be executed with ` python3 ` and
172
+ dictates that ` py ` files are to be executed with ` python3 ` and
173
173
``` vim
174
174
let g:executioner#names['foo.py'] = 'python2 foo.py'
175
175
```
176
176
dictates that ` foo.py ` is to be executed with ` python2 ` , then ` foo.py ` will be
177
177
executed with ` python2 ` .
178
178
179
- These are the default commands:
180
-
181
- ``` vim
182
- " extension : command
183
- " Command is executed if file has specified extension
184
- let g:executioner#extensions = {
185
- \ 'c' : 'gcc % -o @.out;./@.out',
186
- \ 'cpp' : 'g++ % -o @.out;./@.out',
187
- \ 'hs' : 'ghci %',
188
- \ 'js' : 'node %',
189
- \ 'm' : 'matlab',
190
- \ 'ml' : 'ocaml % -o @.out;./@.out',
191
- \ 'php' : 'php %',
192
- \ 'pl' : 'perl %',
193
- \ 'prolog' : 'swipl %',
194
- \ 'py' : 'python %',
195
- \ 'py2' : 'python2 %',
196
- \ 'R' : 'Rscript %',
197
- \ 'r' : 'Rscript %',
198
- \ 'rb' : 'ruby %',
199
- \ 'rc' : 'rustc % -o @.out;./@.out',
200
- \ 'sh' : 'bash %',
201
- \ 'swift' : 'swiftc % -o @.out;./@.out',
202
- \}
203
-
204
- " file name : command
205
- " Command is executed if file has specified name
206
- let g:executioner#names = {
207
- \ 'makefile': 'make',
208
- \}
209
- ```
179
+ Luckily, many of these commands are already defined so you don't need to do so
180
+ yourself. These are the defaults:
181
+
182
+ ##### g: executioner #extensions
183
+ | Extension | Command |
184
+ | :---------:| :-------------------------:|
185
+ | c | gcc % -o @.out;./@out |
186
+ | cpp | g++ % -o @.out;./@out |
187
+ | hs | ghci % |
188
+ | js | node % |
189
+ | m | matlab |
190
+ | ml | ocaml % -o @.out;./@.out |
191
+ | php | php % |
192
+ | pl | perl % |
193
+ | prolog | swipl % |
194
+ | py | python % |
195
+ | py2 | python2 % |
196
+ | R | Rscript % |
197
+ | r | Rscript % |
198
+ | rb | ruby % |
199
+ | rc | rustc % -o @.out;./@.out |
200
+ | sh | bash % |
201
+ | swift | swiftc % -o @.out;./@.out |
202
+
203
+ ##### g: executioner #names
204
+ | Name | Command |
205
+ | :--------:| :--------:|
206
+ | makefile | make |
210
207
211
208
As expected, if any of these extensions or file names are defined in your
212
209
` vimrc ` , they will take precedence over the defaults.
0 commit comments