Shortcut for closing HTML tags?

Hi all,

I started writing HTML in about 2003, and I learned a lot by using CoffeeCup HTML Editor on Windows. One of first useful features of that editor, for me, was that you could hit ctrl+T and it would close the nearest tag for you. Whereas in Komodo, when you initialize a tag it automatically gives you an end, but this is not always useful when you are editing, so I have disabled that feature. What I want is a similar feature to ctrl+T. Is this possible to do, or how could I possibly customize my KIDE to do it for me?

Thanks!

phm

@paulmadore in komodo there is no such key binding.
When you want to close a tag, you only have to type the beginning of the closing tag </ and komodo will show you an auto completion for the closing tag:

If you want this in one action you can write a simple userscript for this:

//Get current view
var currentView = ko.views.manager.currentView;

if (currentView === undefined) {
    return false;
}

var scimoz = currentView.scimoz;

scimoz.insertText(scimoz.currentPos, '</'); // insert closing tag
scimoz.gotoPos(scimoz.currentPos + 2); // Move cursor

currentView.setFocus();
ko.commands.doCommand('cmd_triggerPrecedingCompletion'); // trigger autocompletion

You can add this trough you’re toolbox Add > new Userscript.
In the tab key bindings you can asing it to Ctrl + t key biding:

As you can see there is already a key binding assinged to Ctrl + t General: New Tab,
to re-assign/clear this key binding, you will have to go to preferences > Key bindings, so you can use the new userscript with Ctrl + t

3 Likes