Skip to content

Commit 7321796

Browse files
committed
Change extensions and names formatting
1 parent 03831c9 commit 7321796

File tree

1 file changed

+48
-51
lines changed

1 file changed

+48
-51
lines changed

README.md

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,21 @@ For example, I personally use:
102102
```vim
103103
" Run current buffer
104104
"
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>
108108
109109
" run.sh
110110
"
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>
114114
115115
" Makefile
116116
"
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>
120120
```
121121

122122
Due to the complexity of many projects that span a large number of files, I use
@@ -148,65 +148,62 @@ and then execute it.
148148
There are 2 dictionaries that define what types of files can be executed:
149149

150150
`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:
154154
```vim
155-
let g:executioner#extensions['foo'] = 'bar %'
155+
let g:executioner#extensions['py'] = 'python %'
156156
```
157157
in your `vimrc`.
158158

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:
162162
```vim
163-
let g:executioner#names['echo_me.txt'] = 'echo echo_me.txt'
163+
let g:executioner#names['makefile'] = 'make'
164164
```
165165
in your `vimrc`.
166166

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
169169
```vim
170170
let g:executioner#extensions['py'] = 'python3 %'
171171
```
172-
dictates that `.py` files are to be executed with `python3` and
172+
dictates that `py` files are to be executed with `python3` and
173173
```vim
174174
let g:executioner#names['foo.py'] = 'python2 foo.py'
175175
```
176176
dictates that `foo.py` is to be executed with `python2`, then `foo.py` will be
177177
executed with `python2`.
178178

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 |
210207

211208
As expected, if any of these extensions or file names are defined in your
212209
`vimrc`, they will take precedence over the defaults.

0 commit comments

Comments
 (0)