blob: ba4947d7097a86ed46916c065e00e7b7cefd116c [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim settings file
2" Language: LambdaProlog (Teyjus)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00003" Maintainer: Markus Mottl <markus.mottl@gmail.com>
4" URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
Riley Bruinsdf630972025-06-09 21:03:04 +02005" Last Change: 2025 Jun 08 - set 'comments', 'commentstring'
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +02006" 2025 Apr 16 - set 'cpoptions' for line continuation
7" 2023 Aug 28 - added undo_ftplugin (Vim Project)
dkearnsf937ab32023-08-29 05:32:27 +10008" 2006 Feb 05
Bram Moolenaar5eb86f92004-07-26 12:53:41 +00009" 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
10" 2001 Sep 02 - initial release (MM)
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
12" Only do these settings when not done yet for this buffer
13if exists("b:did_ftplugin")
14 finish
15endif
16
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020017let s:cpo_save = &cpo
18set cpo&vim
19
Bram Moolenaar071d4272004-06-13 20:20:40 +000020" Don't do other file type settings for this buffer
21let b:did_ftplugin = 1
22
23" Error format
dkearnsf937ab32023-08-29 05:32:27 +100024setlocal efm=%+A./%f:%l.%c:\ %m
Bram Moolenaar071d4272004-06-13 20:20:40 +000025
26" Formatting of comments
27setlocal formatprg=fmt\ -w75\ -p\\%
28
Riley Bruinsdf630972025-06-09 21:03:04 +020029setlocal comments=s1:/*,mb:*,ex:*/,:% commentstring=%\ %s
30
31let b:undo_ftplugin = "setlocal efm< fp< com< cms<"
dkearnsf937ab32023-08-29 05:32:27 +100032
Bram Moolenaar071d4272004-06-13 20:20:40 +000033" Add mappings, unless the user didn't want this.
34if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
35 " Uncommenting
36 if !hasmapto('<Plug>Comment')
37 nmap <buffer> <LocalLeader>c <Plug>LUncomOn
38 vmap <buffer> <LocalLeader>c <Plug>BUncomOn
39 nmap <buffer> <LocalLeader>C <Plug>LUncomOff
40 vmap <buffer> <LocalLeader>C <Plug>BUncomOff
dkearnsf937ab32023-08-29 05:32:27 +100041 let b:undo_ftplugin ..=
42 \ " | silent! execute 'nunmap <buffer> <LocalLeader>c'" ..
43 \ " | silent! execute 'vunmap <buffer> <LocalLeader>c'" ..
44 \ " | silent! execute 'nunmap <buffer> <LocalLeader>C'" ..
45 \ " | silent! execute 'vunmap <buffer> <LocalLeader>C'"
Bram Moolenaar071d4272004-06-13 20:20:40 +000046 endif
47
48 nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
49 nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^\/\* \(.*\) \*\//\1/<CR>
50 vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i/*<ESC>`>o<ESC>0i*/<ESC>`<
51 vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
52endif
Eisuke Kawashimafbbaa6e2025-04-16 18:20:59 +020053
54let &cpo = s:cpo_save
55unlet s:cpo_save