vim-clojure-static 插件未启用使用 #_ 表单进行注释,因为它禁用了已注释块的 REPL 集成(请参阅 https://github.com/guns/vim-clojure-static/issues/60)。
在解决这个问题的问题(上面链接)中,@guns 为语法文件提供了以下补充,以启用 cmets 的突出显示:
" WARNING: This code has the following KNOWN deficiencies:
"
" · Consecutive #_ macros are not matched correctly:
" (list #_#_ 1 2 3) ;; => (3)
" · Bracket character literals within #_ comment regions break syntax:
" #_[\a \[ \] \b] ;; broken
" · Compound forms preceded by reader metacharacters are unmatched:
" #_'(α β γ) ;; broken
" · Atomic forms preceded by reader metacharacters + whitespace are unmatched:
" #_' foo ;; broken
"
syntax match clojureCommentAtom /\v#_[ \t\r\n]*[^()\[\]{} \t\r\n]+/
syntax region clojureCommentListContained start=/(/ end=/)/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained contained
syntax region clojureCommentVectorContained start=/\[/ end=/]/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained contained
syntax region clojureCommentMapContained start=/{/ end=/}/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained contained
syntax region clojureCommentStringContained start=/"/ skip=/\v\\\\|\\"/ end=/"/ contained
syntax region clojureCommentList matchgroup=clojureCommentDelimiter start=/\v#_[ \t\r\n]*\(/ end=/)/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained
syntax region clojureCommentVector matchgroup=clojureCommentDelimiter start=/\v#_[ \t\r\n]*\[/ end=/]/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained
syntax region clojureCommentMap matchgroup=clojureCommentDelimiter start=/\v#_[ \t\r\n]*\{/ end=/}/ contains=clojureCommentListContained,clojureCommentVectorContained,clojureCommentMapContained,clojureCommentStringContained
syntax region clojureCommentString matchgroup=clojureCommentDelimiter start=/\v#_[ \t\r\n]*"/ skip=/\v\\\\|\\"/ end=/"/
highlight link clojureCommentDelimiter clojureComment
highlight link clojureCommentAtom clojureComment
highlight link clojureCommentListContained clojureComment
highlight link clojureCommentVectorContained clojureComment
highlight link clojureCommentMapContained clojureComment
highlight link clojureCommentStringContained clojureComment
highlight link clojureCommentList clojureComment
highlight link clojureCommentVector clojureComment
highlight link clojureCommentMap clojureComment
highlight link clojureCommentString clojureComment
我个人使用Spacemacs(包含 Vim 绑定和电池的 Emacs)和 Clojure layer,并且 cmets 和 REPL 集成都可以正常工作,但我相信您已经意识到这一点。