-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
293 lines (227 loc) · 8.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
This is a mirror of http://www.vim.org/scripts/script.php?script_id=3115
Homepage: http://singlecompile.topbug.net
This plugin is aimed at making it more convenient to compile or run a single
source file without leaving vim.
A short introduction is available here: http://www.topbug.net/blog/2012/03/07/use-singlecompile-to-compile-and-run-a-single-source-file-easily-in-vim/
Consider this situation: you have just written a small c source file for a
small test, but you have to write a Makefile to compile it or exit vim to
compile it or compile it using "!gcc" without quickfix feature because vim's
make command only use the "make" command? This plugin will help you out.
Add these key-mappings to your vimrc:
nmap <F9> :SCCompile<cr>
nmap <F10> :SCCompileRun<cr>
Note that the two lines here should not have any trailing space. If your file
type is supported, then press F9 to compile your source file, and press F10 to
compile and run your source file. If there is a compilation error, and the
|quickfix| feature is enabled, then you could use |:cope| command to see the
error list. You may also use ":SCChooseCompiler" command to choose a compiler
if you have more than one kind of compiler available on you system.
":SCViewResult" will show you the last run result.
Features:
1. Compile or run the source file quickly using quickfix feature and compiler feature of vim;
2. Compilers and interpreters auto detecting;
3. Fast switch between several installed compilers or interpreters;
4. Multi-language support;
5. Custom your own compiler/interpreter template;
6. View the result of last run command at any time(requires "tee" command);
7. Run the compiled program asynchronously and view the result at any time
(see :SCCompileRunAsync in the help file).
Here is a list of built-in supported compilers or interpreter(For some
compilers, you need to set the environment varibles correctly to make them
available for SingleCompile):
Ada:
gnat (GNAT)
bash:
bash (Bourne-Again Shell)
C:
bcc (Borland C++ Builder), Windows only
cc (UNIX C Compiler), UNIX only
ch (SoftIntegration Ch)
clang (the Clang C and Objective-C compiler)
gcc (GNU C Compiler)
icc (Intel C++ Compiler)
lcc (Little C Compiler)
msvc (Microsoft Visual C++ (In PATH)), Windows only
msvc80 (Microsoft Visual C++ 2005), Windows only
msvc90 (Microsoft Visual C++ 2008), Windows only
msvc100 (Microsoft Visual C++ 2010), Windows only
msvc110 (Microsoft Visual C++ 2012), Windows only
open-watcom (Open Watcom C/C++32 Compiler)
open64 (Open64 C Compiler), UNIX only
pcc (Portable C Compiler)
sol-studio (Sun C Compiler(Sun Solaris Studio)), UNIX only
tcc (Tiny C Compiler)
tcc-run (Tiny C Compiler with "-run" Flag)
C++:
bcc (Borland C++ Builder), Windows Only
ch (SoftIntegration Ch)
clang (the Clang C and Objective-C compiler)
g++ (GNU C++ Compiler)
icc (Intel C++ Compiler)
msvc (Microsoft Visual C++ (In PATH)), Windows only
msvc80 (Microsoft Visual C++ 2005), Windows only
msvc90 (Microsoft Visual C++ 2008), Windows only
msvc100 (Microsoft Visual C++ 2010), Windows only
msvc110 (Microsoft Visual C++ 2012), Windows only
open-watcom (Open Watcom C/C++32 Compiler)
open64 (Open64 C++ Compiler), UNIX only
sol-studio (Sun C++ Compiler(Sun Solaris Studio)), UNIX only
C#:
msvcs(Microsoft Visual C#), Windows Only
mono (Mono C# compiler)
cmake:
cmake (cmake)
CoffeeScript:
coffee (CoffeeScript)
csh:
csh (C Shell)
tcsh (TENEX C Shell)
D:
dmd (DMD Compiler)
dos batch:
dosbatch (DOS Batch)
erlang:
escript (Erlang Scripting Support)
Fortran:
ftn95 (Silverfrost FTN95), Windows only
g77 (GNU Fortran 77 Compiler)
g95 (G95)
gfortran (GNU Fortran Compiler)
ifort (Intel Fortran Compiler)
open-watcom (Open Watcom Fortran 77/32 Compiler)
open64-f90 (Open64 Fortran 90 Compiler), UNIX only
open64-f95 (Open64 Fortran 95 Compiler), UNIX only
sol-studio-f77 (Sun Fortran 77 Compiler(Sun Solaris Studio)), UNIX only
sol-studio-f90 (Sun Fortran 90 Compiler(Sun Solaris Studio)), UNIX only
sol-studio-f95 (Sun Fortran 95 Compiler(Sun Solaris Studio)), UNIX only
Go:
go (Go)
Haskell:
ghc (Glasgow Haskell Compiler)
runhaskell (runhaskell)
html:
arora (Arora)
chrome (Google Chrome)
chromium (Chromium)
epiphany (Epiphany)
firefox (Mozilla Firefox)
ie (Microsoft Internet Explorer)
konqueror (Konqueror)
opera (Opera)
IDL(Interactive Data Language):
idl (ITT Visual Information Solutions Interactive Data Language)
gdl (GNU Data Language incremental compiler)
Java:
gcj (GNU Java Compiler)
sunjdk (Sun Java Development Kit)
JavaScript:
gjs (Javascript Bindings for GNOME)
js (SpiderMonkey, a JavaScript engine written in C)
node.js (node.js)
rhino (Rhino, a JavaScript engine written in Java)
ksh:
ksh (Korn Shell)
LaTeX:
latex (LaTeX)
pdflatex (pdfLaTeX)
latexmk (Automatic LaTeX document generation routine)
LISP:
clisp (GNU CLISP)
ecl (Embeddable Common-Lisp)
gcl (GNU Common Lisp)
LiveScript:
lsc (LiveScript)
lua:
lua (Lua Interpreter)
Makefile:
gmake (GNU Make)
nmake (Microsoft Program Maintenance Utility)
mingw32-make (MinGW32 Make)
Markdown:
markdown (text-to-HTML conversion tool)
rdiscount (Discount Markdown Processor for Ruby)
Markdown (Python implementation of the Markdown language)
Matlab:
matlab (MathWorks MATLAB)
Note: For Matlab, I highly recommend you to try out vim-matlab-behave plugin: https://github.com/elmanuelito/vim-matlab-behave
octave (GNU Octave)
Object-C:
clang (the Clang C and Objective-C compiler)
gcc (GNU Object-C Compiler)
Pascal:
fpc (Free Pascal Compiler)
gpc (GNU Pascal Compiler)
perl:
perl (Perl Interpreter)
PHP:
php (PHP Command Line Interface 'CLI')
python:
ironpython (IronPython)
jython (Jython)
pypy (PyPy)
python (Python Interpreter, usually the system default Python, no matter it is Python 2 or 3.)
python2 (Python 2 Interpreter)
python3 (Python 3 Interpreter)
QML:
qmlscene (QML Scene, for viewing QML based on QtQuick 2)
qmlviewer (QML Viewer, for viewing QML based on QtQuick 1)
Note: vim does not detect qml files out of the box.
See https://github.com/peterhoeg/vim-qml
R:
R (R)
reStructuredText:
rst2html (reST to HTML)
ruby:
ruby (Ruby Interpreter)
jruby (Ruby on top of Java JVM, default mode)
jruby1.8 (Ruby on top of Java JVM, Ruby 1.8 mode)
jruby1.9 (Ruby on top of Java JVM, Ruby 1.9 mode)
jruby2.0 (Ruby on top of Java JVM, Ruby 2.0 mode, requires JRuby 1.7.4 or
later)
rust:
rustc (Rust compiler)
scala:
scala (Scala compiler)
Note: vim does not detect scala files out the box.
See https://github.com/bjartek/scala-vim-support
sh:
ash (Almquist Shell)
bash (Bourne-Again Shell)
dash (Debian Almquist Shell)
ksh (Korn Shell)
sh (Bourne Shell)
zsh (Z Shell)
tcl:
tclsh (Simple shell containing Tcl interpreter)
tcsh:
tcsh (TENEX C Shell)
vb script:
vb (VB Script Interpreter)
xhtml:
arora (Arora)
chrome (Google Chrome)
epiphany (Epiphany)
firefox (Mozilla Firefox)
ie (Microsoft Internet Explorer)
konqueror (Konqueror)
opera (Opera)
zsh:
zsh (Z Shell)
You can add your compiler or interpreter support if the compiler or
interpreter you want is not in the list. See details in the help file
SingleCompile.txt
There are some supporting code in this plugin for Marc Weber's
vim-addon-actions:
http://github.com/MarcWeber/vim-addon-actions
Feedback is welcome. If you find any bug or have some good ideas to
improve this plugin, please feel free to report it to [email protected]
or submit it on the issue tracker:
https://github.com/xuhdev/SingleCompile/issues
If you've written some templates for some compilers or interpreters which are
not included as built-in template, and you think they are useful for other
people, you could send me an email to inform me, and I'll put them in the
built-in templates.
Git Repository: https://github.com/xuhdev/SingleCompile
Check the wiki pages for some tips: https://github.com/xuhdev/SingleCompile/wiki/_pages
Follow xuhdev on twitter if you are interested in my development:
http://twitter.com/xuhdev