Skip to content

Instantly share code, notes, and snippets.

@maksimr
Last active May 13, 2022 09:46
Show Gist options
  • Save maksimr/8e7646738a87947c1664a8d70dc4ca19 to your computer and use it in GitHub Desktop.
Save maksimr/8e7646738a87947c1664a8d70dc4ca19 to your computer and use it in GitHub Desktop.
Vim Embed clojure language into sh for babashka (bb) command
" Clojure Embedding:
" ==============
if exists("b:current_syntax")
unlet b:current_syntax
endif
syn include @CLJScript syntax/clojure.vim
syn region CLJScriptCode matchgroup=CLJCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@CLJScript contained
syn region CLJScriptEmbedded matchgroup=CLJCommand start=+\<bb\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=CLJScriptCode
syn cluster shCommandSubList add=CLJScriptEmbedded
hi def link CLJCommand Type
@maksimr
Copy link
Author

maksimr commented Feb 15, 2022

Should be placed in ~/.vim/after/syntax/zsh. zsh can be replaced by any other shell language which we want to extend

image

@maksimr
Copy link
Author

maksimr commented May 13, 2022

brew install borkdude/brew/babashka
brew install clojure/tools/clojure
brew install clojure-lsp/brew/clojure-lsp-native

https://clojure-lsp.io/installation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment