tree-sitter-elixir
tree-sitter-elixir copied to clipboard
Add sample config
It would be nice to see a sample setup in the README showing a typical setup in neovim/lua with nvim-treesitter. I feel like I have it working, but I also have a plugin called elixir-editors/vim-elixir that does syntax highlighting for elixir files. If I turn that off I feel like I am not getting much from tree-sitter which makes me feel like I am missing something.
@wilkinson4 how did you do it? I'm trying to use it to no avail
Same here…
Anyone with a sample config working ?
I cloned this repo into my root directory ~. Then I created a treesitter.lua file with the following config.
require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
highlight = {
enable = true, -- false will disable the whole extension
disable = { }, -- list of language that will be disabled
},
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false -- Whether the query persists across vim sessions
},
rainbow = {
enable = true
}
}
require("nvim-treesitter.parsers").elixir = {
install_info = {
url = "$HOME/tree-sitter-elixir/",
files = "grammar.js"
},
used_by = {'elixir'}
}
Finally, in vim window I ran TSInstallFromGrammar elixir.