If you haven't yet, get the latest beta of Komodo 4.3,
and have a look at the Abbreviations/HTML section of the
Toolbox.
You can then add new ones, such as a snippet called "b"
that expands to "<b>|</b>"
where the "|" is the cursor location; check both the
"Maintain cursor position" and "Maintain indentation"
options.
Then when you type "b", you can replace it with the snippet
by pressing "Ctrl-T" with the new default keybindings.
"complete a word based on other occurrences in the current document" - I think that snippets should be "autosuggested" and completed by pressing TAB button (this is how it works in ZendStudio)
Go to Preferences|Editor|Key Bindings, search for
"abbrev" in the "Commands" window, click in the
New Key Sequence box, and press Ctrl+K, Tab,
press the "Add" button, press "OK", and you'll
have this binding.
I'm using this binding, because I didn't want to give
up the old binding of Ctrl+T to transpose-characters.
I just downloaded Komodo Edit 4.3 and the only things I see under Toolbox are Samples, Import/Export Package, and Add... and I don't see anything about Abbreviations/HTML in there... what am I missing?
First, you need to create a Folder (not Live Folder) in your
toolbox called "Abbreviations". Inside that create another
folder called "HTML". You'll create your snippets in that one.
Now the sample we are shipping apparently isn't always getting
installed. Here's how to make them. For example, there's a
snippet in the HTML folder called "p".
It's invoked by pressing Ctrl-T after the word p in an
HTML buffer. The "p" can't be part of a word, like "hop".
Also, if you're using a keybinding set other than "Default",
you'll probably want to bind the command
"Editor: Insert Abbreviation as Snippet" to a keystroke;
otherwise this functionality is basically unavailable.
The only special part of this snippet is that it's in
the Abbreviations/HTML path in your toolbox. Then when
you're in an HTML context, type "p", and press Ctrl-T,
Komodo will replace "p" with the snippet contents, and
select the first tabstop, for classname.
it includes these tags: a, br, comments (), div, em , fieldset, form, all hs (h1,h2,h3,h4,h5,h6), hr, img, input, label, li, option, p, pre, script, script with a link, select, span, strong, style, table, td, textarea, title, tr, ul
If you haven't yet, get the latest beta of Komodo 4.3,
and have a look at the Abbreviations/HTML section of the
Toolbox.
You can then add new ones, such as a snippet called "b"
that expands to "<b>|</b>"
where the "|" is the cursor location; check both the
"Maintain cursor position" and "Maintain indentation"
options.
Then when you type "b", you can replace it with the snippet
by pressing "Ctrl-T" with the new default keybindings.
Is it possible to activate snippet by pressing TAB (like in zent studio) instead of "Ctrl-T" ??
Currently the tab key does the following things, depending on context:
- indent a block of lines
- insert either a tab character or n spaces
- complete a word based on other occurrences in the current document
- select a "tabstop" in a snippet
- carry out a replacement based on the current tabstop
We need to make sure that if we add another action on to the tab
key that we don't lose any of the above.
"complete a word based on other occurrences in the current document" - I think that snippets should be "autosuggested" and completed by pressing TAB button (this is how it works in ZendStudio)
What about CTRL+B, I, etc?
Go to Preferences|Editor|Key Bindings, search for
"abbrev" in the "Commands" window, click in the
New Key Sequence box, and press Ctrl+K, Tab,
press the "Add" button, press "OK", and you'll
have this binding.
I'm using this binding, because I didn't want to give
up the old binding of Ctrl+T to transpose-characters.
I just downloaded Komodo Edit 4.3 and the only things I see under Toolbox are Samples, Import/Export Package, and Add... and I don't see anything about Abbreviations/HTML in there... what am I missing?
At least I see that in my release build, but I'm running
release builds on the same machines I use for development
builds.
Uninstalling reinstalling... I only show Samples (4.2.1) folder...
First, you need to create a Folder (not Live Folder) in your
toolbox called "Abbreviations". Inside that create another
folder called "HTML". You'll create your snippets in that one.
Now the sample we are shipping apparently isn't always getting
installed. Here's how to make them. For example, there's a
snippet in the HTML folder called "p".
It contains this text:
It's invoked by pressing Ctrl-T after the word p in an
HTML buffer. The "p" can't be part of a word, like "hop".
Also, if you're using a keybinding set other than "Default",
you'll probably want to bind the command
"Editor: Insert Abbreviation as Snippet" to a keystroke;
otherwise this functionality is basically unavailable.
The only special part of this snippet is that it's in
the Abbreviations/HTML path in your toolbox. Then when
you're in an HTML context, type "p", and press Ctrl-T,
Komodo will replace "p" with the snippet contents, and
select the first tabstop, for classname.
I uninstalled Komodo IDE, Edit 4.2.1, Edit 4.3 beta and reinstalled 4.3... still getting 4.2.1 in samples. I will try the above...
I think I see how it works now... and I did find the 4.3 beta toolbox by going to View - Tabs - Toolbox... for anyone that is a little slow like me :)
One other thing - is there any way to have word wrap turned on for all files by default?
This can be set globally here:
Edit|Preferences...|Editor|Smart Editing -> Wrap long lines by [Word|Character]
here's my own HTML abbreviation/snippets directory guys. :)
http://www.sendspace.com/file/x7umaz
it includes these tags: a, br, comments (), div, em , fieldset, form, all hs (h1,h2,h3,h4,h5,h6), hr, img, input, label, li, option, p, pre, script, script with a link, select, span, strong, style, table, td, textarea, title, tr, ul