https://github.com/thomas-hiron/cmp-twig-constants
nvim-cmp source for PHP constants autocompletion in twig
https://github.com/thomas-hiron/cmp-twig-constants
neovim neovim-plugin neovim-plugin-lua nvim-cmp
Last synced: about 2 months ago
JSON representation
nvim-cmp source for PHP constants autocompletion in twig
- Host: GitHub
- URL: https://github.com/thomas-hiron/cmp-twig-constants
- Owner: thomas-hiron
- License: mit
- Created: 2024-04-07T19:08:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T13:03:53.000Z (over 1 year ago)
- Last Synced: 2025-02-27T23:21:12.903Z (over 1 year ago)
- Topics: neovim, neovim-plugin, neovim-plugin-lua, nvim-cmp
- Language: Lua
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cmp-twig-constants
### ⚠️ 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 PHP constants located in src directory for twig.

Output is:
```twig
constant('App\\Voter\\MyVoter::CAN_EDIT')
```
Constants are refreshed every 60 seconds.
## Prerequisites
- [ripgrep](https://github.com/BurntSushi/ripgrep) to search for
PHP constants.
## Setup
```lua
require('cmp').setup({
sources = {
{ name = 'twig_constants' },
},
})
```
## Triggers
The plugin is activated for `twig` filetype only.
The trigger character is a single quote, and the line must contains `constant`.
## Configuration
There is no configuration at the moment.
## Todo
- Make sure cursor is between quotes
- Follow composer autoload