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

Plugin's typescript_format_brackets overrides Sublime's default unfold keybinding #753

Open
nh2 opened this issue Jul 13, 2020 · 1 comment

Comments

@nh2
Copy link

nh2 commented Jul 13, 2020

Sublime's default keybindings

	{ "keys": ["ctrl+shift+["], "command": "fold" },
	{ "keys": ["ctrl+shift+]"], "command": "unfold" },

fold and unfold code, like this:

image

In

"keys": [ "ctrl+shift+]" ],
"command": "typescript_format_brackets",

the TypeScript plugin overrides the unfold, so you can no longer unfold code after folding it.

Does it make sense to override a default keybinding this way?

@LetsZiggy
Copy link

LetsZiggy commented Jul 23, 2020

@nh2 ,
I manage to change the keybinding based on this reference

In my Default (Linux).sublime-keymap

[
  ...
  // Reimplement default
  {
    "keys": ["ctrl+shift+["],
    "command": "fold" 
  },
  {
    "keys": ["ctrl+shift+]"],
    "command": "unfold"
  },
  ...

  ...
  // Rebind default typescript key binding
  {
    "keys": ["ctrl+shift+\\"],
    "command": "typescript_format_brackets",
    "context": [
      { "key": "selector", "operator": "equal", "operand": "source.ts, source.tsx, source.js, source.jsx" }
    ]
  },
  ...
]

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