Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.
Nope, no way to do this for the time being due to the absence of a variable storing the currently selected text.. as Textmate does. I’ll put this up on the feature requests list.
Maybe centi can move this thread over there so that you won’t have to create another thread :) And welcome to the Intype forums!
silentrob: try to move this thread into Feature request category yourself. Just edit your first comment in this thread and select the other category. I’m just curious whether a regular forum member is able to move threads like this, or only admins can do that.
idyllrain: Nope, no way to do this for the time being due to the absence of a variable storing the currently selected text.
I actually think this is already possible, but I may be mistaken…
Check the HTML bundles for examples. When using the HTML bundle I just noticed you can wrap some selected items in tags (such as a hyperlink).
Yeah you can use the variable $SELECTED_TEXT.
Ah…. pardon my ignorance… There’s another variable that I encountered while fixing/rewriting the C/C++ snippets, $FILE_NAME, but it doesn’t seem to be working tho.
FILE_NAME and many other variables will be added in the next release. Wrapping each line in snippet is not possible now. You can wrap selected text, but not each line. This will be handled by scripts.
martincohen: Wrapping each line in snippet is not possible now. You can wrap selected text, but not each line. This will be handled by scripts.
Mm, I’m not quite sure what you mean, but if you mean wrapping each line of selected text, well… its possible. Since the regex replacement works, and that we have the $SELECTED_TEXT variable, we can replicate the same behavior silentrob asks… as shown by the snippet below:
{
title: 'Test wrap'
key_equivalent: 'Ctrl+/'
scope: 'source.html'
content: '${SELECTED_TEXT/(^\s*)([^\r\n\f]+)/$1<li>$2<\/li>/g}'
}
To test this, just enter some lines of text in Intype, select them, then choose this snippet from the menu (or just press the shortcut key if your language grammar is already HTML).
Edit: Modified the regex to better match non word characters and the like….
:) Mm.. yeah.. I am aware of the HTML snippet in question. Well… Warp Selection as Link snippet uses another executable “pbpaste” to get stuff from the clipboard, along with some other shell commands that would allow the snippet to work on Macs. Martin will implement this for Intype in future releases… so we’ll just have to wait :)
The bundles are TextMate converted bundles, there are some bugs and nasty things.. but not to worry.. some of us are working on them :) You can contribute too if you want :)
Yep, that’s good solution, but there’s more power with scripting. You can for example wrap each line in a snippet, so you will be able to dynamically change the tag name in the editor.
Yeah Lua is a great language but correct me if I’m wrong martin aren’t you guys going to use javascript for scripting.
Yeah… martin mentioned it in this post
Diane, although it wraps it in a p tag, you do know that you can type in a tag name and have it mirror at the ending tag right? ;)
Two options? Could you post a screenshot of that?
Yes, thats what the snippet does. :) Just select some text, press Ctrl + W, then type the tag. ;)
And as for learning it, you could refer to the Textmate snippets manual I linked in the other thread, and take a look at the snippet files themselves. You can just ignore the “Interpolated Shell Code” part of the Textmate manual. The rest are identical or almost identical (in the case of the “Variables” section: we use $SELECTED_TEXT instead of $TM_SELECTED_TEXT). Martin and co are already planning for the Intype documentation, so we’ll have our own reference in a while :)
1 to 23 of 23