diff --git a/runtime/indent/racket.vim b/runtime/indent/racket.vim index 93bd38fbff..2d45d89242 100644 --- a/runtime/indent/racket.vim +++ b/runtime/indent/racket.vim @@ -3,7 +3,7 @@ " Maintainer: D. Ben Knoble " Previous Maintainer: Will Langstroth " URL: https://github.com/benknoble/vim-racket -" Last Change: 2022 Aug 12 +" Last Change: 2023 Jul 17 if exists("b:did_indent") finish @@ -11,18 +11,25 @@ endif let b:did_indent = 1 setlocal lisp autoindent nosmartindent +if has('vim9script') + setlocal indentexpr=racket#Indent() lispoptions+=expr:1 +endif -setlocal lispwords+=module,module*,module+,parameterize,let-values,let*-values,letrec-values,local +setlocal lispwords+=module,module*,module+,parameterize,parameterize*,let-values,let*-values,letrec-values,local setlocal lispwords+=define/contract setlocal lispwords+=λ setlocal lispwords+=with-handlers setlocal lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse setlocal lispwords+=define-for-syntax,define-syntax-parser,define-syntax-parse-rule,define-syntax-class,define-splicing-syntax-class +setlocal lispwords+=define-syntax-parameter,syntax-parameterize setlocal lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig setlocal lispwords+=define-opt/c,define-syntax-rule -setlocal lispwords+=define-test-suite +setlocal lispwords+=define-test-suite,test-case setlocal lispwords+=struct setlocal lispwords+=with-input-from-file,with-output-to-file +setlocal lispwords+=begin,begin0 +setlocal lispwords+=place +setlocal lispwords+=cond " Racket OOP " TODO missing a lot of define-like forms here (e.g., define/augment, etc.) @@ -41,6 +48,8 @@ setlocal lispwords+=for/hash,for/hasheq,for/hasheqv,for/sum,for/flvector,for*/fl setlocal lispwords+=for/async setlocal lispwords+=for/set,for*/set setlocal lispwords+=for/first,for*/first +setlocal lispwords+=for/last,for*/last +setlocal lispwords+=for/stream,for*/stream setlocal lispwords+=match,match*,match/values,define/match,match-lambda,match-lambda*,match-lambda** setlocal lispwords+=match-let,match-let*,match-let-values,match-let*-values @@ -57,4 +66,4 @@ setlocal lispwords+=if-view,case-view,cond-view,list-view,dyn-view setlocal lispwords+=case/dep setlocal lispwords+=define/obs -let b:undo_indent = "setlocal lisp< ai< si< lw<" +let b:undo_indent = "setlocal indentexpr< lisp< lispoptions< ai< si< lw<" diff --git a/runtime/syntax/racket.vim b/runtime/syntax/racket.vim index b1ed2b454c..fcd64a7c9b 100644 --- a/runtime/syntax/racket.vim +++ b/runtime/syntax/racket.vim @@ -4,7 +4,7 @@ " Previous Maintainer: Will Langstroth " URL: https://github.com/benknoble/vim-racket " Description: Contains all of the keywords in #lang racket -" Last Change: 2022 Aug 12 +" Last Change: 2023 Sep 22 " Initializing: if exists("b:current_syntax") @@ -514,13 +514,13 @@ syntax region racketString start=/\%(\\\)\@