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

Feature request : expand with "tab" #24

Open
raphaelgoetter opened this issue Nov 3, 2013 · 11 comments
Open

Feature request : expand with "tab" #24

raphaelgoetter opened this issue Nov 3, 2013 · 11 comments
Assignees

Comments

@raphaelgoetter
Copy link

Hello,

"Ctrl-Alt-V" to insert the snippet is a bit painful and long.
Would it be possible to expand trigger with tab key, as Emmet does for example ?

@ghost
Copy link

ghost commented Dec 17, 2013

(I see it's an old post, but I wanted to reply so everybody who read this'll know)

You can change that keybind to whatever you want in "jrowny.brackets.snippets/main.js"

//add the keybinding
KeyBindingManager.addBinding(SNIPPET_EXECUTE, "Ctrl-Alt-V");

But I agree with you that it should be good if it could work as Emmet, because now if you change keybind "Ctrl-Alt-V" to "Tab" with this extension and then you want to use regular space with "Tab" it deletes everything on that line.
Issue here: #30

@zaggino
Copy link
Collaborator

zaggino commented Mar 11, 2014

This is now solved and you can set your own key in settings dialog - #34
Error with deleting everything on the line is solved in #35

@raphaelgoetter
Copy link
Author

Hello,

I changed my settings to "Tab" key, but doesn't work if Emmet extension is installed :/

@zaggino
Copy link
Collaborator

zaggino commented Apr 30, 2014

emmet uses tab for something else ... you can't have multiple bindings on one key currently
https://github.com/emmetio/brackets-emmet/blob/master/keymap.json

@raphaelgoetter
Copy link
Author

Yep, that's the problem.

I'd love to expand my snippets as I use Emmet, with Tab key :/

@zaggino
Copy link
Collaborator

zaggino commented Apr 30, 2014

What exactly does the emmet extension do on tab key?

@raphaelgoetter
Copy link
Author

It expands abbreviations, it's his main function.

Ex. div>p + tab -->

<div>
    <p></p>
</div>

@zaggino
Copy link
Collaborator

zaggino commented Apr 30, 2014

Well one expands abbreviations, one snippets - it'd be quite hard to execute both at the same time, wasn't it?

@raphaelgoetter
Copy link
Author

We do not execute both at the same time.

Emmet is made to extend the most common abbreviations: HTML elements, CSS properties, vendor prefixes, or many shortcuts such as w20width: 20px; etc..

On the other hand, snippets of code does not seem at all incompatible.

For example, one of my snippets is navi

<nav role="navigation" id="navigation"> 
     <ul> 
        <li> <a href="#"> </ a> </ li> 
        <li> <a href="#"> </ a> </ li> 
        <li> <a href="#"> </ a> </ li> 
        <li> <a href="#"> </ a> </ li> 
        <li> <a href="#"> </ a> </ li> 
    </ ul> 
</ nav> 

Why would it be uncompatible?

@zaggino zaggino reopened this May 1, 2014
@zaggino zaggino mentioned this issue May 1, 2014
@zaggino
Copy link
Collaborator

zaggino commented May 1, 2014

@raphaelgoetter I'll try to open an issue with main Brackets core when I'll have time. Currently implementing this feature you want is not possible.

@alexvf
Copy link

alexvf commented May 30, 2014

Hi raphaelgoetter,
You asked:

Why would it be uncompatible?

It would be incompatible because Emmet creates "code" with all strings. Even the ones it does not know.
If you type "navi" and hit the tab key, you will get:
<navi></navi>

How would brackets know what was really the plugin you were expecting to execute the command (Emmet or Snippets)?

I don't think it is possible to use both with the same key combination.

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

4 participants