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

I tried cdm command but it didn't work #9

Closed
c0debreaker opened this issue Oct 15, 2015 · 3 comments
Closed

I tried cdm command but it didn't work #9

c0debreaker opened this issue Oct 15, 2015 · 3 comments

Comments

@c0debreaker
Copy link

so I added this to my key binding

  {
    "keys": ["ctrl+shift+,"],
    "command": "insert_snippet",
    "args": {
      "name": [ 
        "Packages/Babel Snippets/react_wrap.sublime-snippet",
        "Packages/Babel Snippets/react_componentDidMount_(class).sublime-snippet"
      ]
    }
  }
@zertosh
Copy link
Member

zertosh commented Oct 16, 2015

"name" must be a string not an array. react_componentDidMount_(class).sublime-snippet should just work out-of-the-box. However, it's scoped to only work inside a class body. react_wrap.sublime-snippet does need a keybinding (or you can use it without one via the command palette). You first need to select the thing you want wrapped in a component, and then run the snippet.

@c0debreaker
Copy link
Author

Would that mean that I will have 2 entries? How about this?

{
    "keys": ["ctrl+shift+,"],
    "command": "insert_snippet",
    "args": {
      "name": "Packages/Babel Snippets/react_wrap.sublime-snippet"
    }
},
{
   "command": "insert_snippet",
    "args": {
      "name": "Packages/Babel Snippets/react_componentDidMount_(class).sublime-snippet"
    }
}

@c0debreaker
Copy link
Author

Disregard my question, the cdm works now :D Thank you for mentioning class. That helped a lot!!!

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