elixir-editors / vim-elixir

Vim configuration files for Elixir

Home Page:http://elixir-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to show context-aware snippets with this plugin ?

collegeimprovements opened this issue · comments

Is it possible to show context-aware snippets with this plugin ?

Currently we have a lot of elixir snippets.
Is it possible to show only migration related snippets in migration file and schema-related snippets in schema file and so on, with the help of this and any snippet-plugin?
Can it imply if current module have use ... or import ... and use them as context for snippets?

This is not something I see vim-elixir supporting. Snippets are fairly individualized and outside of vim-elixir's primary focus (highlighting, syntax, indentation, some mix integration). You could write a plugin similar to vim-rails perhaps: https://github.com/tpope/vim-rails/blob/a13a6527f9a463612fb54d3587d4f2918648cd45/autoload/rails.vim#L4968

Okay....Thanks a lot @jbodah.
It's not just about the snippet but about the context of the module a cursor is in.
I believe it's not supported at the moment and has to be accomplished with the help of another plugin.