DAML for Neovim
- BatyrOP 3
Hi! I built a Neovim plugin for DAML: https://github.com/Sengoku11/daml.nvim
It’s easy to install and comes with:
- LSP setup (diagnostics, autocompletion, go-to, hover, etc.)
- Syntax highlighting (reuses Haskell grammar)
- Filetype detection out of the box
Install is simple (e.g., via
lazy.nvim):{ 'Sengoku11/daml.nvim', ft = 'daml', opts = {}, dependencies = { 'nvim-treesitter/nvim-treesitter', 'saghen/blink.cmp', }, }Feedback and PRs welcome!
P.S. Here are some screenshots using daml-finance tutorials source.
Autocompletion:
Error checking:
- bernhard 2
That’s neat, thanks for the contribution to the ecosystem!
I’d recommend also posting on the GSF app dev Slack channel: #gsf-global-synchronizer-appdev
- WallaceKelly
Thank you, @Batyr!
I needed to add an:initfunction to my treesitter.lua plugin as followsEDIT: see later in the thread
return { { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", init = function() vim.treesitter.language.register('haskell', 'daml') vim.api.nvim_create_autocmd("FileType", { pattern = "daml", callback = function() vim.treesitter.start() end, }) end, opts = { ensure_installed = { "lua", "vim", "vimdoc", "query", "javascript", "python", "scala", "haskell" }, highlight = { enable = true }, indent = { enable = true }, }, }, }Did you find that you need a similar
initfunction? Without it, I was not getting the color highlighting. But I’m wondering if that indicates I had something else wrong. - Batyr
Hi @WallaceKelly , looks like the plugin wasn’t initialized properly. How do you install it? Also could be issue with a treesitter, did it work with other languages before?
Normally it should map automatically, and add extra syntax to highlighting (you mapped it directly so should miss some highlights on keywords like
ensure,nonconsuming, etc.).Here is my treesitter config: kickstart.nvim/lua/plugins/coding/treesitter.lua at 593d3006fc9ae11b8637adb9767ff407e71aff5a · Sengoku11/kickstart.nvim · GitHub
- WallaceKelly 1
You are right, @Batyr. The
initfunction in my previous post is not correct. I’ve moved this discussion to a GitHub issue. - Batyr 1
Hi @WallaceKelly, thanks for the heads-up! I hope my answers there were comprehensive, but let me know if anything doesn’t work on your end.
- Batyr 2
Hey everyone! If you’ve migrated from the default Daml assistant to
dpm, you’ll need to pass this specificcmdoverride in your opts:{ ‘Sengoku11/daml.nvim’, ft = ‘daml’, opts = { lsp = { cmd = { ‘dpm’, ‘damlc’, ‘multi-ide’ }, -- override daml assistant with dpm }, }, }Also, please make sure are updated to the latest version of the plugin!
- Batyr 4
daml.nvimnow supports Script Results directly in the IDE!It works exactly like in VS Code, except I tweaked the rendering (HTML → Markdown) so it fits your terminal perfectly. You can have instant results faster than ever, check this out!
github.com
GitHub - Sengoku11/daml.nvim: A Neovim plugin for Daml, a Haskell-based...
A Neovim plugin for Daml, a Haskell-based functional programming language designed for building secure, distributed smart contracts on the Canton network.




