Not signed in (Sign In)

Categories

Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthortstrokes
    • CommentTimeFeb 8th 2007 edited
     permalink

    I was wondering what people think of this idea.
    When you enter a snippet that is the defining element of a language it would auto select the grammar.
    i.e. When you insert the php snippet (php tab inserts <?php ?>) the php language grammar would auto select.
    I realize this would require a default bundle/scope where all the defining elements are included.
    I also realize that some langauges don’t really have a defining element.
    But some form of snippet or template could be created for those languages.

    And I won’t be offended if you guys cut this idea to pieces.

    • CommentAuthorDarkRaver
    • CommentTimeFeb 8th 2007
     permalink

    Well, I don’t find this so much useful because of the already existing grammar shortcuts : you just have to press Ctrl+Shift+H then Enter or 1 to select XHTML grammar and so on.
    I think that every grammar should have a shortcut to select it easily.

    • CommentAuthori
    • CommentTimeFeb 8th 2007
     permalink

    Same here… along with default file types… this feature probably won’t see much use by me. Though I suppose implementing this as a plugin/script would probably be very easy.

    •  
      CommentAuthortstrokes
    • CommentTimeFeb 8th 2007 edited
     permalink

    Yeah this probably fits better as a plugin.

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007
     permalink

    When you’re in HTML and write php and get a PHP snippet, you can then use PHP snippets within the PHP tags… so I don’t really see why it’s necessary…

    •  
      CommentAuthortstrokes
    • CommentTimeFeb 9th 2007
     permalink

    Thats true with embedded grammars. I would mainly use it when starting new documents.

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007
     permalink

    Hm, yeah… Hm. Maybe if you could define snippets for the “None” grammar :) Or define in the HTML bundle that the “PHP tag” snippet should be available when no grammar is defined… Or maybe that wouldn’t work at all or at least be too taxing on the bundle loading and stuff…

    •  
      CommentAuthortstrokes
    • CommentTimeFeb 9th 2007
     permalink

    Yeah, you may be right it might be to taxing to load…?

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007
     permalink

    I don’t know, maybe it could be done. Developers?

    • CommentAuthorcorelon
    • CommentTimeFeb 9th 2007
     permalink

    I do not really think that this will be a very useful feature unless you work with HTML and the like. Only tag based languages, such as (X)HTML, PHP, XML and the like use such “keywords” to denote the content language. But the EXTREME majority of languages do not have a predefined start point.

    Cheers,

    Nick

  1.  permalink

    @corelon: That could simply be solved by typing the name of the language itself and pressing tab.

    ...however, I don’t really like this idea. Handy? Yes. A duplicate of something already in use now? Yes. I’d rather just use the shortcut commands to access it…or if the shortcuts become too cluttered and we need more, just give me a single shortcut to have the dropdown (popup) language selection box become focused so I can scroll through it.

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007 edited
     permalink

    BrendonKoz: @corelon: That could simply be solved by typing the name of the language itself and pressing tab. ...however, I don’t really like this idea. Handy? Yes. A duplicate of something already in use now? Yes. I’d rather just use the shortcut commands to access it…or if the shortcuts become too cluttered and we need more, just give me a single shortcut to have the dropdown (popup) language selection box become focused so I can scroll through it.

    I believe a couple of users expressed their wish to have it work like that, a while back. Myself included. Ctrl+Shift+letter for every grammar occupies too much space within the shortcut matrix.

    • CommentAuthorBrendonKoz
    • CommentTimeFeb 9th 2007 edited
     permalink

    Funny, we usually tend to disagree. :) I believe I was also one of those who had suggested it previously, so it doesn’t really add to the count of people that want it.

    I figure that if Intype’s supposed to increase productivity, but we also have to leverage ease of use with that productivity….how often in any job’s single file am I really going to access that selection menu? I think I could live with a slightly slower method.

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007 edited
     permalink

    Yeah. Hmm. That selection menu could have a quicksearch thing, maybe? And it could earn one of the new Ctrl+Shift-shortcuts. Like Ctrl+Shift+G for “Grammars”? So, I would hit that and start typing, “ph” for example, and it’d choose PHP first, because it’s my most frequently used among the grammars that the search found. It’d show PHP first in a list of all the matches, that is. Wouldn’t that be nice?

  2.  permalink

    Hmm, what I think is, that this will bring a lot of confusion to the editor. It’s better for Intype to be exact (use specific command to switch the grammar) than pretending to be smart (MS Word). I’m not really into using editor that is doing something that is hardly expected and have non-deterministic result. Let’s maybe talk about how switching grammar should be done better to be quick so you don’t have to think about features like this one :) However, I’m not against some plugin or JS solution for this (though, I don’t think that this would be easy to implement).

  3.  permalink

    Frederick: Yep, it definitely would, because actually this is a feature to come shortly.

    • CommentAuthorBrendonKoz
    • CommentTimeFeb 9th 2007 edited
     permalink

    Frederick: That would definitely be nice. I like that. :) I’m glad to see it’s a feature that may eventually be introduced…hopefully we can replace the CTRL+SHIFT+(* ) with just that. I think it’d be much more intuitive.

    Fictional conversation:
    (What’s the shortcut for Textile? CTRL+SHIFT+T? Ok! Now, what’s the one for XHTML? CTRL_SHIFT+H?! Why not an X?!)

  4.  permalink

    BrendonKoz: The grammar shortcuts are not final, and are about to be changed. Mainly because the current selecting model is not sufficient, as many have stated in this topic…

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007
     permalink

    martincohen: Hmm, what I think is, that this will bring a lot of confusion to the editor. It’s better for Intype to be exact (use specific command to switch the grammar) than pretending to be smart (MS Word). I’m not really into using editor that is doing something that is hardly expected and have non-deterministic result. Let’s maybe talk about how switching grammar should be done better to be quick so you don’t have to think about features like this one :) However, I’m not against some plugin or JS solution for this (though, I don’t think that this would be easy to implement).

    I agree with all that you’re saying. First I thought this was in reply to my most recent post, but of course you’re talking about the main topic.

    I’d love it if what I suggested became a reality soon. Would it be possible to search the grammar titles or would it just be a popup menu where you had to visually scan it and press a number? I’d much prefer the first alternative…

  5.  permalink

    martincohen: I know. I should be more careful how I structure sentences, examples, and my language when it’s almost impossible to understand sarcasm from someone that does not use the language as their primary. My apologies.

    •  
      CommentAuthorFrederick
    • CommentTimeFeb 9th 2007
     permalink

    BrendonKoz: martincohen: I know. I should be more careful how I structure sentences, examples, and my language when it’s almost impossible to understand sarcasm from someone that does not use the language as their primary. My apologies.

    Yeah, this is beginning to hit me too.