An open API service indexing awesome lists of open source software.

https://github.com/thomas-hiron/cmp-twig

nvim-cmp source for twig filters and functions autocompletion
https://github.com/thomas-hiron/cmp-twig

neovim neovim-plugin neovim-plugin-lua nvim-cmp

Last synced: 10 months ago
JSON representation

nvim-cmp source for twig filters and functions autocompletion

Awesome Lists containing this project

README

          

# cmp-twig

### ⚠️ This repo has been moved ⚠️

This code has been merged to https://github.com/thomas-hiron/cmp-symfony.

---

[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source for twig.
This plugin autocompletes twig filters and functions located in
`src` directory.
The native filters and functions are also available.

Filters:
![Autocomplete](./docs/filters.png)

Functions:
![Autocomplete](./docs/functions.png)

Filters and functions are refreshed every 30 seconds.

## Prerequisites
- [ripgrep](https://github.com/BurntSushi/ripgrep) to search for
filters and functions

## Setup

```lua
require('cmp').setup({
sources = {
{ name = 'twig' },
},
})
```

## Triggers

The plugin is activated for `twig` filetype.
There are three trigger characters:
- pipe triggers filters completion
- space and open parenthesis trigger functions completion

## Configuration

There is no configuration at the moment.

## Todo

- Configure filetypes
- Configure filters and functions location