Skip to content

nvim-cmp source for PHP constants autocompletion in twig

License

Notifications You must be signed in to change notification settings

thomas-hiron/cmp-twig-constants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmp-twig-constants

nvim-cmp source for twig.
This plugin autocompletes PHP constants located in src directory for twig.

Autocomplete

Output is:

constant('App\\Voter\\MyVoter::CAN_EDIT')

Constants are refreshed every 60 seconds.

Prerequisites

  • ripgrep to search for PHP constants.

Setup

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

About

nvim-cmp source for PHP constants autocompletion in twig

Topics

Resources

License

Stars

Watchers

Forks

Languages