racket.vim 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. " Vim indent file
  2. " Language: Racket
  3. " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com>
  4. " Previous Maintainer: Will Langstroth <will@langstroth.com>
  5. " URL: https://github.com/benknoble/vim-racket
  6. " Last Change: 2022 Aug 12
  7. if exists("b:did_indent")
  8. finish
  9. endif
  10. let b:did_indent = 1
  11. setlocal lisp autoindent nosmartindent
  12. setlocal lispwords+=module,module*,module+,parameterize,let-values,let*-values,letrec-values,local
  13. setlocal lispwords+=define/contract
  14. setlocal lispwords+=λ
  15. setlocal lispwords+=with-handlers
  16. setlocal lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse
  17. setlocal lispwords+=define-for-syntax,define-syntax-parser,define-syntax-parse-rule,define-syntax-class,define-splicing-syntax-class
  18. setlocal lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig
  19. setlocal lispwords+=define-opt/c,define-syntax-rule
  20. setlocal lispwords+=define-test-suite
  21. setlocal lispwords+=struct
  22. setlocal lispwords+=with-input-from-file,with-output-to-file
  23. " Racket OOP
  24. " TODO missing a lot of define-like forms here (e.g., define/augment, etc.)
  25. setlocal lispwords+=class,class*,mixin,interface,class/derived
  26. setlocal lispwords+=define/public,define/pubment,define/public-final
  27. setlocal lispwords+=define/override,define/overment,define/override-final
  28. setlocal lispwords+=define/augment,define/augride,define/augment-final
  29. setlocal lispwords+=define/private
  30. " kanren
  31. setlocal lispwords+=fresh,run,run*,project,conde,condu
  32. " loops
  33. setlocal lispwords+=for,for/list,for/fold,for*,for*/list,for*/fold,for/or,for/and,for*/or,for*/and
  34. setlocal lispwords+=for/hash,for/hasheq,for/hasheqv,for/sum,for/flvector,for*/flvector,for/vector,for*/vector,for*/sum,for*/hash,for*/hasheq,for*/hasheqv
  35. setlocal lispwords+=for/async
  36. setlocal lispwords+=for/set,for*/set
  37. setlocal lispwords+=for/first,for*/first
  38. setlocal lispwords+=match,match*,match/values,define/match,match-lambda,match-lambda*,match-lambda**
  39. setlocal lispwords+=match-let,match-let*,match-let-values,match-let*-values
  40. setlocal lispwords+=match-letrec,match-define,match-define-values
  41. setlocal lispwords+=let/cc,let/ec
  42. " qi
  43. setlocal lispwords+=define-flow,define-switch,flow-lambda,switch-lambda,on,switch,π,λ01
  44. setlocal lispwords+=define-qi-syntax,define-qi-syntax-parser,define-qi-syntax-rule
  45. " gui-easy
  46. setlocal lispwords+=if-view,case-view,cond-view,list-view,dyn-view
  47. setlocal lispwords+=case/dep
  48. setlocal lispwords+=define/obs
  49. let b:undo_indent = "setlocal lisp< ai< si< lw<"