Babobski
Bob de Haas

Komodo Userscripts

var currentView = ko.views.manager.currentView;

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

var scimoz = currentView.scimoz;
var selection = scimoz.selText;
var remove    = selection.length;
var currentPos = scimoz.currentPos;
var startPos = currentPos - remove;

if (selection.length == 0) {
    return false;
}

scimoz.setSel(startPos, currentPos);

var result = '<? ' + selection + ' ?>';

scimoz.replaceSel(result, selection);

copy

var currentView = ko.views.manager.currentView;

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

var scimoz = currentView.scimoz;

currentView.setFocus();

currentView.scimoz.beginUndoAction()
try {
    scimoz.lineCopy();
    scimoz.newLine();
    scimoz.paste();
    scimoz.deleteBack();
    scimoz.homeDisplay();
    scimoz.wordLeft();
    scimoz.wordRight();
    scimoz.insertText(scimoz.currentPos, '-webkit-');
    scimoz.lineEnd();
} finally {
    currentView.scimoz.endUndoAction()
}

copy

var currentView = ko.views.manager.currentView;

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

var scimoz = currentView.scimoz;
var selection = scimoz.selText;

if (selection.length == 0) {
    return false;
}
selection = selection.replace(/\s*/g, '_');

var result = selection.replace(/[^a-z0-9]/gi, '');

scimoz.replaceSel(result.toLowerCase());

copy

var currentView = ko.views.manager.currentView;

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

var scimoz = ko.views.manager.currentView.scimoz;
var selection = scimoz.selText;

if (selection.length == 0) {
    return false;
}

if (/\\'/.test(selection)) {
    var result = selection.replace(/\\'/g, '\'');
} else {
    var result = selection.replace(/'/g, '\\\'');
}

scimoz.replaceSel(result, selection);

copy
ko.commands.doCommand('cmd_newWindow');
copy
var koDoc = (komodo.koDoc === undefined ? komodo.document : komodo.koDoc);

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

var content = koDoc.buffer;
var result = content.replace(/<!--[^>]+>/g, '');
    //result = result.replace(/\/\/[^\r\n]*/g, '');

koDoc.buffer = result;
copy

var currentView = ko.views.manager.currentView;

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

var scimoz = currentView.scimoz;
var selection = ko.interpolate.getWordUnderCursor();
var remove    = selection.length;
var currentPos = scimoz.currentPos;
var startPos = currentPos - remove;

if (selection.length == 0) {
    return false;
}

if (/\$/.test(selection)) {
    var result = selection.replace('$', '');
} else {
    var result = '$' + selection;
}

scimoz.setSel(startPos, currentPos);

scimoz.replaceSel(result, selection);

copy

Github

3 days ago
Sep 21, 2017
@babobski
  • @babobski 34c2d19
    converting addon to also import and export to/from file
5 days ago
Sep 19, 2017
babobski closed pull request Komodo/Packages#126
@babobski
added import servers addon
5 days ago
Sep 19, 2017
babobski commented on pull request Komodo/Packages#126
@babobski

I agree, closing it for now.

5 days ago
Sep 19, 2017
babobski commented on pull request Komodo/Packages#126
@babobski

Yes it is now working for me running the latest build. The import servers functionality is now a bit obsolete for Komodo 11. But it is still a good…

5 days ago
Sep 19, 2017
babobski commented on pull request Komodo/Packages#126
@babobski

Thought only the projects issue was fixed. The servers dit not get imported while developing this addon. Just ran a clean install, with a new profi…

5 days ago
Sep 19, 2017