lprolog.vim 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. " Vim settings file
  2. " Language: LambdaProlog (Teyjus)
  3. " Maintainer: Markus Mottl <markus.mottl@gmail.com>
  4. " URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
  5. " Last Change: 2023 Aug 28 - added undo_ftplugin (Vim Project)
  6. " 2006 Feb 05
  7. " 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
  8. " 2001 Sep 02 - initial release (MM)
  9. " Only do these settings when not done yet for this buffer
  10. if exists("b:did_ftplugin")
  11. finish
  12. endif
  13. " Don't do other file type settings for this buffer
  14. let b:did_ftplugin = 1
  15. " Error format
  16. setlocal efm=%+A./%f:%l.%c:\ %m
  17. " Formatting of comments
  18. setlocal formatprg=fmt\ -w75\ -p\\%
  19. let b:undo_ftplugin = "setlocal efm< fp<"
  20. " Add mappings, unless the user didn't want this.
  21. if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
  22. " Uncommenting
  23. if !hasmapto('<Plug>Comment')
  24. nmap <buffer> <LocalLeader>c <Plug>LUncomOn
  25. vmap <buffer> <LocalLeader>c <Plug>BUncomOn
  26. nmap <buffer> <LocalLeader>C <Plug>LUncomOff
  27. vmap <buffer> <LocalLeader>C <Plug>BUncomOff
  28. let b:undo_ftplugin ..=
  29. \ " | silent! execute 'nunmap <buffer> <LocalLeader>c'" ..
  30. \ " | silent! execute 'vunmap <buffer> <LocalLeader>c'" ..
  31. \ " | silent! execute 'nunmap <buffer> <LocalLeader>C'" ..
  32. \ " | silent! execute 'vunmap <buffer> <LocalLeader>C'"
  33. endif
  34. nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
  35. nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^\/\* \(.*\) \*\//\1/<CR>
  36. vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i/*<ESC>`>o<ESC>0i*/<ESC>`<
  37. vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
  38. endif