Skip to content

Add autodetection (only load plugin when editing a Django project) #13

@joeytwiddle

Description

@joeytwiddle

This project could not be included in vim-polyglot because it does too much on startup, even if the user is only editing a text file or a Javascript file.

(I am also reluctant to keep it installed, for the same reason. I use Vim for lots of different things, and only use Django occasionally.)

Suggestion:

  • Move all setup functions into a separate file, which will only be run when needed
  • Do a quick check on BufReadPost: If django-plus is not yet loaded, and this file looks like a Django file, then load django-plus

Challenges:

  • If the user is starting a fresh project, or has not yet opened a Django-like file, then they will see none of the django-plus features. (I suggest providing an option to always load django-plus on startup, for those people who use django every day.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions