(Change to TipImported template + severe manual clean) |
(Change <tt> to <code>, perhaps also minor tweak.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{{TipImported |
{{TipImported |
||
|id=1388 |
|id=1388 |
||
− | |previous= |
+ | |previous=1386 |
|next=1389 |
|next=1389 |
||
− | |created= |
+ | |created=2006 |
|complexity=basic |
|complexity=basic |
||
|author=setog |
|author=setog |
||
|version=n/a |
|version=n/a |
||
|rating=2/4 |
|rating=2/4 |
||
+ | |category1= |
||
+ | |category2= |
||
}} |
}} |
||
I try to learn ocaml, and I add this lines in my vimrc to run the code in the ocaml interpreter: |
I try to learn ocaml, and I add this lines in my vimrc to run the code in the ocaml interpreter: |
||
Line 14: | Line 16: | ||
<pre> |
<pre> |
||
set sb |
set sb |
||
− | map |
+ | map <F11> :split /tmp/ocaml \| %d \|setlocal ft=omlet \| setlocal autowrite \| r!ocaml < # <CR> |
− | map |
+ | map <F12> :dr /tmp/ocaml \| %d \|setlocal ft=omlet \|setlocal autowrite \| r!ocaml < # <CR> |
</pre> |
</pre> |
||
− | The first map |
+ | The first map (F11) open a temp file in a split and write the output in it (with omlet syntax). |
− | I use the second ( |
+ | I use the second (F12) to do it if I have already a split with the result. |
− | I do a set autowrite, but I am sure we can use the same property of < |
+ | I do a set autowrite, but I am sure we can use the same property of <code>:he</code> command (a buffer in read only without needing to save it). |
==Comments== |
==Comments== |
||
− | |||
− | ---- |
Latest revision as of 06:25, 13 July 2012
Tip 1388 Printable Monobook Previous Next
created 2006 · complexity basic · author setog · version n/a
I try to learn ocaml, and I add this lines in my vimrc to run the code in the ocaml interpreter:
set sb map <F11> :split /tmp/ocaml \| %d \|setlocal ft=omlet \| setlocal autowrite \| r!ocaml < # <CR> map <F12> :dr /tmp/ocaml \| %d \|setlocal ft=omlet \|setlocal autowrite \| r!ocaml < # <CR>
The first map (F11) open a temp file in a split and write the output in it (with omlet syntax).
I use the second (F12) to do it if I have already a split with the result.
I do a set autowrite, but I am sure we can use the same property of :he
command (a buffer in read only without needing to save it).