Vim Tips Wiki
Advertisement
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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).

Comments

Advertisement