Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim settings file |
| 2 | " Language: OCaml |
| 3 | " Maintainers: Mike Leary <leary@nwlink.com> |
| 4 | " Markus Mottl <markus@oefai.at> |
| 5 | " URL: http://www.ai.univie.ac.at/~markus/vim/ftplugin/ocaml.vim |
| 6 | " Last Change: 2003 May 11 |
| 7 | " 2001 Nov 01 - added local bindings for inserting |
| 8 | " type holes using 'assert false' (MM) |
| 9 | " 2001 Oct 02 - insert spaces in line comments (MM) |
| 10 | |
| 11 | " Only do these settings when not done yet for this buffer |
| 12 | if exists("b:did_ftplugin") |
| 13 | finish |
| 14 | endif |
| 15 | |
| 16 | " Don't do other file type settings for this buffer |
| 17 | let b:did_ftplugin = 1 |
| 18 | |
| 19 | set cpo-=C |
| 20 | |
| 21 | " Error formats |
| 22 | setlocal efm= |
| 23 | \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:, |
| 24 | \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m, |
| 25 | \%+EReference\ to\ unbound\ regexp\ name\ %m, |
| 26 | \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m, |
| 27 | \%Wocamlyacc:\ w\ -\ %m, |
| 28 | \%-Zmake%.%#, |
| 29 | \%C%m |
| 30 | |
| 31 | " Add mappings, unless the user didn't want this. |
| 32 | if !exists("no_plugin_maps") && !exists("no_ocaml_maps") |
| 33 | " Uncommenting |
| 34 | if !hasmapto('<Plug>Comment') |
| 35 | nmap <buffer> <LocalLeader>c <Plug>LUncomOn |
| 36 | vmap <buffer> <LocalLeader>c <Plug>BUncomOn |
| 37 | nmap <buffer> <LocalLeader>C <Plug>LUncomOff |
| 38 | vmap <buffer> <LocalLeader>C <Plug>BUncomOff |
| 39 | endif |
| 40 | |
| 41 | nnoremap <buffer> <Plug>LUncomOn mz0i(* <ESC>$A *)<ESC>`z |
| 42 | nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^(\* \(.*\) \*)/\1/<CR> |
| 43 | vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i(*<ESC>`>o<ESC>0i*)<ESC>`< |
| 44 | vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`< |
| 45 | |
| 46 | if !hasmapto('<Plug>Abbrev') |
| 47 | iabbrev <buffer> ASS (assert false) |
| 48 | endif |
| 49 | endif |