From 5202b7b0986b2a4be8b14e02010fd7390575d775 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 27 Jul 2020 20:59:51 -0500 Subject: [PATCH] Docs: rework readme - Fix some typos - Remove some unnecessary text that was taking space - Use double quotes in lua examples (this seems to be the convention in the source code) - Sort list of languages so they are easy to find. --- README.md | 142 +++++++++++++++++----------------------- doc/nvim-treesitter.txt | 14 ++-- 2 files changed, 68 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 0d9ee970c..efbd054bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -![Nvim-treesitter](nvim-treesitter.png) -Traditionnal highlighting (left) vs Treesitter-based highlighting (right). - [![Gitter](https://badges.gitter.im/nvim-treesitter/community.svg)](https://gitter.im/nvim-treesitter/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) ![Linting and style checking](https://github.com/nvim-treesitter/nvim-treesitter/workflows/Linting%20and%20style%20checking/badge.svg?branch=master) ![Check loading of syntax files](https://github.com/nvim-treesitter/nvim-treesitter/workflows/Check%20loading%20of%20syntax%20files/badge.svg) @@ -9,6 +6,10 @@ Traditionnal highlighting (left) vs Treesitter-based highlighting (right). Treesitter configurations and abstraction layer for Neovim. +![Nvim-treesitter](nvim-treesitter.png) + +Traditional highlighting (left) vs Treesitter-based highlighting (right). + **Warning: Treesitter and Treesitter highlighting are an experimental feature of nightly versions of Neovim. Please consider the experience with this plug-in as experimental until Neovim 0.5 is released!** @@ -32,7 +33,7 @@ Simply add these lines to your `init.vim` : Plug 'nvim-treesitter/nvim-treesitter' ``` -### Using neovim `pack` feature +### Using Neovim `pack` feature We highly recommend reading `:h packages` to learn more about this feature, but you can still follow these steps: @@ -44,77 +45,55 @@ $ git clone https://github.com/nvim-treesitter/nvim-treesitter.git ## Adding parsers -Treesitter is using a different _parser_ for every language. It can be quite a pain to install, but fortunately `nvim-treesitter` +Treesitter uses a different _parser_ for every language. It can be quite a pain to install, but fortunately `nvim-treesitter` provides two command to tackle this issue: - - `TSInstall` to install one or more parser. You can use `TSInstall all` to download all parsers. - - `TSInstallInfo` to know which parser is installed. -Let's say you need parsers for `lua`, `c`, and `python`, this is how you do with these commands: +- `TSInstall {language}` to install one or more parsers. + `TSInstall ` will give you a list of supported languages, or select `all` to install them all. +- `TSInstallInfo` to know which parser is installed. + +Let's say you need parsers for `lua`, this is how you do with these commands: ```vim -:TSInstall c -Downloading... -Compiling... -Treesitter parser for c has been installed - :TSInstall lua Downloading... Compiling... Treesitter parser for lua has been installed - -:TSInstall python -Downloading... -Compiling... -Treesitter parser for python has been installed ``` Cool, lets see which parsers are installed: ```vim :TSInstallInfo -csharp [✗] not installed +lua [✓] installed +c [✗] installed html [✗] not installed typescript [✗] not installed -c [✓] installed -swift [✗] not installed -java [✗] not installed -python [✓] installed -cpp [✗] not installed -lua [✓] installed -ruby [✗] not installed -ocaml [✗] not installed -go [✗] not installed -rust [✗] not installed -json [✗] not installed -javascript [✗] not installed -css [✗] not installed -julia [✗] not installed -php [✗] not installed -bash [✗] not installed -tsx [✗] not installed +... ``` -And now you should be able to use every functionality `nvim-treesitter` provides! +And now you should be ready to use every functionality `nvim-treesitter` provides! ## Setup -In your `init.vim`: +All modules are disabled by default, +so you'll need to activate them by putting this in your `init.vim`: ```lua lua <