Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override key binding for tab emmet_expand_abbreviation #146

Open
japalo opened this issue Dec 10, 2020 · 3 comments
Open

Can't override key binding for tab emmet_expand_abbreviation #146

japalo opened this issue Dec 10, 2020 · 3 comments

Comments

@japalo
Copy link

japalo commented Dec 10, 2020

I'm currently trying to disable emmet_expand_abbreviation if sublimes autocomplete is visible using this snippet in my user key bindings:

[
    // Tab key handler for single cursor
    {
        "keys": ["tab"],
        "command": "emmet_expand_abbreviation",
        "args": { "tab": true },
        "context": [
            {
                "operand": false,
                "operator": "equal",
                "match_all": true,
                "key": "auto_complete_visible"
            },
            { "key": "emmet_abbreviation" },
            { "key": "emmet_tab_expand" },
            { "key": "num_selections", "operand": 1 }
        ]
    },

    // Tab key handler for multiple cursors
    {
        "keys": ["tab"],
        "command": "emmet_expand_abbreviation",
        "context": [
            {
                "operand": false,
                "operator": "equal",
                "match_all": true,
                "key": "auto_complete_visible"
            },
            { "key": "emmet_activation_scope" },
            { "key": "emmet_multicursor_tab_expand" },
            { "key": "num_selections", "operator": "not_equal", "operand": 1 }
        ]
    }
]

What i expected is that the default key binding is inactivated, and mine are applied, but this doesn't happen. Not sure if I'm doing it wrong though so support is also welcome :)
The new version of emmet kinda slowed my workflow a bit. I've been working with abbreviation expansion only if autocomplete isn't visible and nothing is selected for many years so it would be nice to be able to customize the key mappings.

Refer to this gif to better understand the issue:
Dec-10-2020 10-13-57

@sergeche
Copy link
Member

In Sublime Text, you can’t unset shortcuts provided by plugins.

I’m not sure which goal you’re trying to achieve. New Emmet doesn’t require autocomplete, it automatically tracks abbreviations you are typing (displayed as subtle underline). Tracked abbreviation can be expanded with Tab key or reseted with Esc key. If you’re not happy with this behaviour, there’s a number of ways to disable tracking and expand by specific keybinding for specific syntax: https://github.com/emmetio/sublime-text-plugin#disable-abbreviation-capturing

@japalo
Copy link
Author

japalo commented Dec 13, 2020

I want to achieve to avoid expanding abbreviation if sublimes OOTB auto complete i open. If it's open, the Tab key should not expand abbreviation. I don't want to unset the shortcut, i want to extend it. What i am asking for here is either ways to extend the shortcut, or at least a setting for the plugin where I can disable the expand abbreviation if autocomplete is open.

@japalo
Copy link
Author

japalo commented Dec 13, 2020

I also think that this semi viral gist worked great: https://gist.github.com/wesbos/2bb4a6998635df97c748
I've used this (unsupported) key binds for many years so it's really hard to work with the new version.

I hope it's doable to get this change for the newest version of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants