Skip to content

[Proposal] add a VSCode 'strict' option, but allow extra features #136

Open
@mg979

Description

@mg979

For example, let g:vsnip_vscode_strict = 1 to disable all features that are not VSCode compatible. Then you can enable extra features.

Reason: I'd like extra features implemented as keys in the snippet, like:

  • line_pattern: only trigger if line matches pattern
  • path_pattern: only trigger if file path matches pattern
  • syntax_pattern: only trigger in syntax element with pattern
  • syntax_no_pattern: don't trigger in syntax elements with pattern

There are snippet that I only want to trigger at the start of an empty line.
Or I have project-specific snippets, that I only want to trigger if the file path matches a certain pattern. Or there are snippets that I don't want to trigger in strings or comments, etc.

Example:

    "NO": {
        "description": "note",
        "body": [
            "[NOTE]",
            "====",
            "$TM_SELECTED_TEXT$0",
            "===="
        ],
        "prefix": [
            "NO"
        ],
        "line_pattern": "^NO$"
    },

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions