Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Add sample config #24

Open
wilkinson4 opened this issue Jun 3, 2021 · 4 comments
Open

Add sample config #24

wilkinson4 opened this issue Jun 3, 2021 · 4 comments
Labels
PR accepted Feel free to open PR for the issue

Comments

@wilkinson4
Copy link

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.

@ananthakumaran ananthakumaran added the PR accepted Feel free to open PR for the issue label Jun 5, 2021
@gugahoa
Copy link

gugahoa commented Jun 6, 2021

@wilkinson4 how did you do it? I'm trying to use it to no avail

@alappe
Copy link

alappe commented Jun 7, 2021

Same here…

@cvignal
Copy link

cvignal commented Jun 15, 2021

Anyone with a sample config working ?

@wilkinson4
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR accepted Feel free to open PR for the issue
Projects
None yet
Development

No branches or pull requests

5 participants