SciTE - Hotkeys unlimited, Neue Funktionen (Run selected Code, Move selection left/right/up/down u.a.)

    • Offizieller Beitrag

    Edit: Jetzt als AddOn!!

    !! DEMO ANGUCKEN !!

    Hi,
    ich bin ja ein Tastaturfreak und somit versuche ich natürlich die Maus möglichst nicht zu benutzen.
    In Sublime Text haben mir viele der möglichen Editoroperationen sehr gut gefallen. Ich versuche mal soviel, wie möglich davon in SciTE umzusetzen.
    Für den Anfang:
    • (markierte) Zeile(n) auf/ab bewegen mit Strg+Shift+PfeilAuf /+PfeilAb
    • Markierung aufheben mit Strg+U
    • Benachbarte Zeichen (li. u. re. vom Cursor) tauschen mit Strg+Shift+T

    Die Datei bei euren Lua-Dateien speichern, Pfadaufruf anpassen. Hier ist mein persönlicher Lua-Pfad als Propertie hinterlegt.
    Den Programmaufruf in der SciTEStartup.lua hinter "EventClass:BeginEvents()" einfügen:

    Spoiler anzeigen


    NEUE VERSION in Post #2

    In Planung:
    - zeitgleiches Editieren an Mehrfachvorkommen einer Auswahl (z.B. eine Variable selektieren, Auswahl auf alle od. Schritt-für-Schritt weitere Vorkommen erweitern, Änderung Inhalt in allen Selektionen)
    - Alignment bei Zuweisungen (mehrere Zuweisungen untereinander, markieren und am "=" ausrichten)

    • Offizieller Beitrag

    Hotkeys
    SciTE hat ja bereits alle Sequenzen von Ctrl+Key vorbelegt. Das ist natürlich unschön, da man für eigene Hotkeys dann auf umständliche Kombinationen zurückgreifen muss, die einem fast die Finger brechen. Oder man muss die voreingestellten Hotkeys ummappen.

    Aber das hat ein Ende. Die Lösung: Cascading Hotkeys
    Das funktioniert recht simpel. Ich habe mir als Trigger die Sequenz "Ctrl+Win" ausgewählt. Das beißt sich mit keinem anderen Hotkey und läßt sich schön mit 2 Fingern einer Hand erledigen. Ist dieser Hotkey gedrückt, läßt man die Win-Taste wieder los aber hält die Ctrl-Taste weiterhin gedrückt und wählt nun die beliebige Taste für die zweite Ctrl+Key-Sequenz. Somit ergeben sich Hotkeys der Form: "Ctrl+Win, Ctrl+X" oder "Ctrl+Win, Ctrl+F2" usw..

    Alle Tasten der Standardtastatur, ohne Sonderzeichen, habe ich vorbereitet in der angehängten Datei. Will man eine Sequenz nutzen, muss nur der Kommentar aus der entsprechenden Zeile entfernt und die gewünschte Aktion hinterlegt werden. Was in SciTEUser.properties an command-Befehlen für Hotkeys hinterlegt ist, kann man ebenso in diesem Skript aufrufen. Wenn es Probleme bei der Umsetzung gibt, einfach melden.

    Markierten Code ausführen
    Mir passiert es öfter mal, dass ich aus einem Projekt einzelne Codesequenzen ausführen möchte ohne jedoch das Skript selbst zu starten. Bisher habe ich dann immer eine Testdatei geöffnet, den entsprechenden Code hineinkopiert, auf fehlende Includes geprüft und dann ausgeführt.
    Das habe ich nun automatisiert. Per Hotkey wird:
    - markierter Code in eine separate Datei geschrieben ( __TMP__RunSelected.au3 im Ordner des aktuellen Skripts )
    - aus dem offenen Skript werden die Includes ausgelesen und mit in die Datei geschrieben
    - die Datei wird im Editor geöffnet und sofort ausgeführt
    - bei erneuter Nutzung wird die Datei überschrieben, somit nur diese eine zusätzliche Datei im entsprechenden Skript-Ordner

    Markierten Inhalt aus einer Zeile verschieben
    Ich hatte ja bereits in der Version 0.1 das Verschieben von kpl. Zeilen auf Hotkeys gelegt.
    Nun habe ich zusätzlich integriert, dass selektierter Text in alle Richtungen verschoben werden kann. Sequenz: "Ctrl+Alt+ [Pfeil li/ re/ auf/ ab]"

    Kommentar in Zeile anspringen
    Setzt den Cursor vor das Zeichen für den Kommentarstart, sofern die Zeile einen Kommentar enthält.

    Markierungen
    - Variable unter Cursor ohne "$" markieren (markiert auch jede andere Zeichenkette ohne NonWordCharacter)
    - Variable unter Cursor mit "$" markieren
    - kpl. Zeile markieren

    Einbinden in SciTE, wie in Post #1 beschrieben.

    Ausgabe einer Auflistung der Hotkeys in die Konsole mit "Ctrl+Win, Ctrl+0"


    EditProcessing (v0.2)
    [autoit]


    -- TIME_STAMP 2013-05-27 18:02:39 v 0.2
    -- by BugFix

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EditKey = EventClass:new(Common)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local fOwnMode = false
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local Clock = function() local datetable = os.date("*t", os.time())
    return string.format('%02d:%02d:%02d', datetable.hour, datetable.min, datetable.sec) end
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local SelectionMoveH = function(_fLeft)
    local moveText = function(_s, _a, _e, _val)
    editor:SetSelection(_a, _e) editor:Clear()
    if _val == -1 then editor:CharLeft() else editor:CharRight() end
    editor:InsertText(editor.CurrentPos, _s)
    editor:SetSelection(_a +(_val), _e +(_val))
    end
    output:ClearAll()
    local sErr = "!>> "..Clock().." [Error SelectionMoveH] >> "
    local caret = editor.CurrentPos
    local line = editor:LineFromPosition(caret)
    local selText, selLen = editor:GetSelText()
    local selStart, selEnd = editor:GetLineSelStartPosition(line), editor:GetLineSelEndPosition(line)
    editor:SetSelection(selStart, selEnd) -- now the cursor is on left side of selection
    if selLen == 0 then print(sErr..'Nothing selected!') return end
    local lineStart = editor:PositionFromLine(line)
    editor:LineEnd()
    local lineEnd = editor.CurrentPos
    if _fLeft then
    if caret > lineStart then moveText(selText, selStart, selEnd, -1) else
    print(sErr..'First position was already reached!') editor:SetSelection(selStart, selEnd) end
    else
    if selStart +selLen -1 < lineEnd then moveText(selText, selStart, selEnd, 1) else
    print(sErr..'Last position was already reached!') editor:SetSelection(selStart, selEnd) end
    end
    end --> SelectionMoveH
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local SelectionMoveV = function(_fUp)
    local moveText = function(_i, _txt, _len, _line)
    editor:Clear()
    local lineNext = _line +(_i)
    local lenNext = editor:LineLength(lineNext)
    local lineNextStart = editor:PositionFromLine(lineNext)
    local insertPos = lineNextStart + editor.Column[editor.CurrentPos]
    if lenNext < editor.Column[editor.CurrentPos] then insertPos = lineNextStart end
    editor:InsertText(insertPos, _txt)
    editor:SetSelection(insertPos, insertPos +_len-1)
    editor:EnsureVisible(lineNext)
    end
    output:ClearAll()
    local sErr = "!>> "..Clock().." [Error SelectionMoveV] >> "
    local line = editor:LineFromPosition(editor.CurrentPos)
    local lineLast = editor.LineCount -1
    local selStart, selEnd = editor:GetLineSelStartPosition(line), editor:GetLineSelEndPosition(line)
    local selText, selLen = editor:GetSelText()
    editor:SetSelection(selStart, selEnd) -- now the cursor is on left side of selection
    if selLen == 0 then print(sErr..'Nothing selected!') return end
    if _fUp then
    if line == 0 then print(sErr..'No line before this!') return else moveText(-1, selText, selLen, line) end
    else
    if line == lineLast then print(sErr..'No line after this!') return else moveText(1, selText, selLen, line) end
    end
    end --> SelectionMoveV
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local SkipToComment = function()
    local IsComment = function(_pos)
    local tComment = {1,2} if tComment[editor.StyleAt[_pos]] == nil then return false
    else return true end
    end
    output:ClearAll()
    local caret = editor.CurrentPos
    local iStart = caret
    local iLine = editor:LineFromPosition(iStart)
    local iLineStart = editor:PositionFromLine(iLine)
    if IsComment(iStart) then
    while (iStart-1 >= iLineStart) and IsComment(iStart-1) do
    iStart = iStart-1
    end
    else
    while (iStart+1 < iLineStart +editor:LineLength(iLine)) and not IsComment(iStart+1) do
    iStart = iStart+1
    end
    iStart = iStart+1
    end
    if not IsComment(iStart) then editor.CurrentPos = caret
    print("!>> "..Clock().." [Error SkipToComment] >> No comment in this line!") return end
    editor:SetSelection(iStart, iStart)
    end --> SkipToComment
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local SetSelection = function(_part)
    local isWordChar = function(_char)
    if string.char(_char):find('[a-zA-Z0-9_]') then return true end
    return false
    end
    local iStart = editor.CurrentPos
    local iEnd = iStart
    while isWordChar(editor.CharAt[iStart-1]) do
    iStart = iStart - 1
    end
    if not _part and string.char(editor.CharAt[iStart-1]) == "$" then iStart = iStart - 1 end
    while isWordChar(editor.CharAt[iEnd]) do
    iEnd = iEnd + 1
    end
    if iStart ~= iEnd then editor:SetSelection(iStart, iEnd) end
    end --> SetSelection
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local RunSelectedCode = function()
    local writeTmpFile = function(_path, _s)
    local file = io.open(_path, 'w+')
    file:write(_s) file:close()
    end
    output:ClearAll()
    local sErr = "!>> "..Clock().." [Error RunSelectedCode] >> "
    local fileExt = props["FileExt"]
    if fileExt:upper() ~= 'AU3' then output:ClearAll() print(sErr..'Attempting to run code from a non-au3 file!') return end
    local fileDir = props["FileDir"]
    local sSel = editor:GetSelText()
    if sSel == '' then print(sErr..'No code selected!') return end
    local text = editor:GetText()
    local sWrite = ''
    for incl in text:gmatch("[\n]?(#[iI][nN][cC][lL][uU][dD][eE]%s-<[%w%s_.]+>)") do sWrite = sWrite..incl..'\n' end
    for incl in text:gmatch("[\n]?(#[iI][nN][cC][lL][uU][dD][eE]%s-([\"'])[%w%s_.:\\]+%2)") do sWrite = sWrite..incl..'\n' end
    local newPath = fileDir..'\\'..'__TMP__RunSelected.au3'
    writeTmpFile(newPath, sWrite..'\n'..sSel)
    scite.Open(newPath)
    scite.MenuCommand(IDM_GO)
    end --> RunSelectedCode
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    -------------------------------------------------------------------------
    local GetHotkeyList = function()
    local tKeys = {}
    tKeys['Ctrl+Win, Ctrl+C'] = ' Skip to |C|omment in line if any'
    tKeys['Ctrl+Win, Ctrl+F'] = ' |F|ull selection, expand selection to full word with Wordcharacters and leading "$"'
    tKeys['Ctrl+Win, Ctrl+L'] = ' |L|ine selection'
    tKeys['Ctrl+Win, Ctrl+P'] = ' |P|artial selection, expand selection to full word with only Wordcharacters'
    tKeys['Ctrl+Win, Ctrl+R'] = ' |R|un Selected Code'
    tKeys['Ctrl+Win, Ctrl+S'] = ' Reload SciTE |S|tartup script'
    tKeys['Ctrl+Win, Ctrl+T'] = ' |T|oggle adjacent characters'
    tKeys['Ctrl+Win, Ctrl+U'] = ' |U|nselect any selections'
    tKeys['Ctrl+Win, Ctrl+Z'] = ' Run Testscript "LUA_TEST.lua"'
    tKeys['Ctrl+Win, Ctrl+0'] = ' Print HotkeyList to console'
    tKeys['Ctrl+Alt+ArrowLeft'] = ' Move selection in line to Left'
    tKeys['Ctrl+Alt+ArrowRight'] = ' Move selection in line to Right'
    tKeys['Ctrl+Alt+ArrowUp'] = ' Move selection in line Up'
    tKeys['Ctrl+Alt+ArrowDown'] = ' Move selection in line Down'
    tKeys['Ctrl+Shift+ArrowDown'] = ' Move line/selected-lines Down'
    tKeys['Ctrl+Shift+ArrowUp'] = ' Move line/selected-lines Up'

    [/autoit] [autoit][/autoit] [autoit]

    local pairsSortByKeys = function(t, f)
    local a = {}
    for n in pairs(t) do table.insert(a, n) end
    table.sort(a, f)
    local i = 0
    local iter = function ()
    i = i + 1 if a[i] == nil then return nil
    else return a[i], t[a[i]] end
    end
    return iter
    end
    local lenMax, s = 0, '.'
    for k, _ in pairs(tKeys) do if k:len() > lenMax then lenMax = k:len() end end
    lenMax = lenMax +4
    output:ClearAll()
    print('--> KeyList in alphabetical order')
    for k, v in pairsSortByKeys(tKeys) do print('+-> '..k..s:rep(lenMax-k:len())..v) end
    end --> GetHotkeyList
    -------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    --- Event: OnKey --------------------------------------------------------
    function EditKey:OnKey(_keycode, _shift, _ctrl, _alt)
    --~ print('_keycode: '..tostring(_keycode)..', _shift: '..tostring(_shift)..', _ctrl: '..tostring(_ctrl)..', _alt: '..tostring(_alt)) -- DebugToConsole

    [/autoit] [autoit][/autoit] [autoit]

    if not fOwnMode and _ctrl and not _shift and not _alt and _keycode == 91 then --- Ctrl+Win activates OwnMode
    fOwnMode = true return true
    end
    if fOwnMode then --- processing own commands
    -- Ctrl+Win, Ctrl+A
    --~ if _ctrl and not _shift and not _alt and _keycode == 65 then
    -- Ctrl+Win, Ctrl+B
    --~ if _ctrl and not _shift and not _alt and _keycode == 66 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+C ##== Skip to |C|omment in line if any ==##
    if _ctrl and not _shift and not _alt and _keycode == 67 then SkipToComment() end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+D
    --~ if _ctrl and not _shift and not _alt and _keycode == 68 then
    -- Ctrl+Win, Ctrl+E
    --~ if _ctrl and not _shift and not _alt and _keycode == 69 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+F ##== |F|ull selection, expand selection to full word with Wordcharacters and leading "$" ==##
    if _ctrl and not _shift and not _alt and _keycode == 70 then SetSelection(false) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+G
    --~ if _ctrl and not _shift and not _alt and _keycode == 71 then
    -- Ctrl+Win, Ctrl+H
    --~ if _ctrl and not _shift and not _alt and _keycode == 72 then
    -- Ctrl+Win, Ctrl+I
    --~ if _ctrl and not _shift and not _alt and _keycode == 73 then
    -- Ctrl+Win, Ctrl+J
    --~ if _ctrl and not _shift and not _alt and _keycode == 74 then
    -- Ctrl+Win, Ctrl+K
    --~ if _ctrl and not _shift and not _alt and _keycode == 75 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+L ##== |L|ine selection ==##
    if _ctrl and not _shift and not _alt and _keycode == 76 then
    editor:Home() editor:LineEndExtend() end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+M
    --~ if _ctrl and not _shift and not _alt and _keycode == 77 then
    -- Ctrl+Win, Ctrl+N
    --~ if _ctrl and not _shift and not _alt and _keycode == 78 then
    -- Ctrl+Win, Ctrl+O
    --~ if _ctrl and not _shift and not _alt and _keycode == 79 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+P ##== |P|artial selection, expand selection to full word with only Wordcharacters ==##
    if _ctrl and not _shift and not _alt and _keycode == 80 then SetSelection(true) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+Q
    --~ if _ctrl and not _shift and not _alt and _keycode == 81 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+R ##== |R|un Selected Code ==##
    if _ctrl and not _shift and not _alt and _keycode == 82 then RunSelectedCode() end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+S ##== Reload SciTE |S|tartup script ==##
    if _ctrl and not _shift and not _alt and _keycode == 83 then
    dofile( props["SciteDefaultHome"] .. "\\Lua\\SciTEStartup.lua" ) output:ClearAll() print('++> '..Clock()..' SciTE StartUp script reloaded.')
    end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+T ##== |T|oggle adjacent characters ==##
    if _ctrl and not _shift and not _alt and _keycode == 84 then
    caret = editor.CurrentPos editor:SetSel(caret-1, caret) charLeft = editor:GetSelText()
    editor:SetSel(caret, caret+1) charRight = editor:GetSelText() editor:ReplaceSel(charLeft)
    editor:SetSel(caret-1, caret) editor:ReplaceSel(charRight) editor.CurrentPos = caret end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+U ##== |U|nselect any selections ==##
    if _ctrl and not _shift and not _alt and _keycode == 85 then caret = editor.CurrentPos editor:SetSel(caret, caret) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+V
    --~ if _ctrl and not _shift and not _alt and _keycode == 86 then
    -- Ctrl+Win, Ctrl+W
    --~ if _ctrl and not _shift and not _alt and _keycode == 87 then
    -- Ctrl+Win, Ctrl+X
    --~ if _ctrl and not _shift and not _alt and _keycode == 88 then
    -- Ctrl+Win, Ctrl+Y
    --~ if _ctrl and not _shift and not _alt and _keycode == 89 then

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+Z ##== Run Testscript "LUA_TEST.lua" ==## Hiermit starte ich immer mein Lua-Testscript, da mit "Run" eine Ausführung nicht möglich ist
    if _ctrl and not _shift and not _alt and _keycode == 90 then
    dofile( props["Lua.User.Scripts.Path"] .. "\\LUA_TEST.lua" ) -- ich habe eine eigene Propertie definiert mit dem Pfad meiner Skripte
    end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+0 ##== Print HotkeyList to console ==##
    if _ctrl and not _shift and not _alt and _keycode == 48 then GetHotkeyList() end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Win, Ctrl+1
    --~ if _ctrl and not _shift and not _alt and _keycode == 49 then
    -- Ctrl+Win, Ctrl+2
    --~ if _ctrl and not _shift and not _alt and _keycode == 50 then
    -- Ctrl+Win, Ctrl+3
    --~ if _ctrl and not _shift and not _alt and _keycode == 51 then
    -- Ctrl+Win, Ctrl+4
    --~ if _ctrl and not _shift and not _alt and _keycode == 52 then
    -- Ctrl+Win, Ctrl+5
    --~ if _ctrl and not _shift and not _alt and _keycode == 53 then
    -- Ctrl+Win, Ctrl+6
    --~ if _ctrl and not _shift and not _alt and _keycode == 54 then
    -- Ctrl+Win, Ctrl+7
    --~ if _ctrl and not _shift and not _alt and _keycode == 55 then
    -- Ctrl+Win, Ctrl+8
    --~ if _ctrl and not _shift and not _alt and _keycode == 56 then
    -- Ctrl+Win, Ctrl+9
    --~ if _ctrl and not _shift and not _alt and _keycode == 57 then
    -- Ctrl+Win, Ctrl+Backspace
    --~ if _ctrl and not _shift and not _alt and _keycode == 8 then

    [/autoit] [autoit][/autoit] [autoit]

    -- ##== N U M P A D ==##
    -- Ctrl+Win, Ctrl+NUMPAD_0
    --~ if _ctrl and not _shift and not _alt and _keycode == 96 then
    -- Ctrl+Win, Ctrl+NUMPAD_1
    --~ if _ctrl and not _shift and not _alt and _keycode == 97 then
    -- Ctrl+Win, Ctrl+NUMPAD_2
    --~ if _ctrl and not _shift and not _alt and _keycode == 98 then
    -- Ctrl+Win, Ctrl+NUMPAD_3
    --~ if _ctrl and not _shift and not _alt and _keycode == 99 then
    -- Ctrl+Win, Ctrl+NUMPAD_4
    --~ if _ctrl and not _shift and not _alt and _keycode == 100 then
    -- Ctrl+Win, Ctrl+NUMPAD_5
    --~ if _ctrl and not _shift and not _alt and _keycode == 101 then
    -- Ctrl+Win, Ctrl+NUMPAD_6
    --~ if _ctrl and not _shift and not _alt and _keycode == 102 then
    -- Ctrl+Win, Ctrl+NUMPAD_7
    --~ if _ctrl and not _shift and not _alt and _keycode == 103 then
    -- Ctrl+Win, Ctrl+NUMPAD_8
    --~ if _ctrl and not _shift and not _alt and _keycode == 104 then
    -- Ctrl+Win, Ctrl+NUMPAD_9
    --~ if _ctrl and not _shift and not _alt and _keycode == 105 then
    -- Ctrl+Win, Ctrl+NUMPAD_Dot
    --~ if _ctrl and not _shift and not _alt and _keycode == 110 then
    -- Ctrl+Win, Ctrl+NUMPAD_Add
    --~ if _ctrl and not _shift and not _alt and _keycode == 107 then
    -- Ctrl+Win, Ctrl+NUMPAD_Sub
    --~ if _ctrl and not _shift and not _alt and _keycode == 109 then
    -- Ctrl+Win, Ctrl+NUMPAD_Mul
    --~ if _ctrl and not _shift and not _alt and _keycode == 106 then
    -- Ctrl+Win, Ctrl+NUMPAD_Div
    --~ if _ctrl and not _shift and not _alt and _keycode == 111 then

    [/autoit] [autoit][/autoit] [autoit]

    -- ##== F - K e y s ==##
    -- Ctrl+Win, Ctrl+F1
    --~ if _ctrl and not _shift and not _alt and _keycode == 112 then
    -- Ctrl+Win, Ctrl+F2
    --~ if _ctrl and not _shift and not _alt and _keycode == 113 then
    -- Ctrl+Win, Ctrl+F3
    --~ if _ctrl and not _shift and not _alt and _keycode == 114 then
    -- Ctrl+Win, Ctrl+F4
    --~ if _ctrl and not _shift and not _alt and _keycode == 115 then
    -- Ctrl+Win, Ctrl+F5
    --~ if _ctrl and not _shift and not _alt and _keycode == 116 then
    -- Ctrl+Win, Ctrl+F6
    --~ if _ctrl and not _shift and not _alt and _keycode == 117 then
    -- Ctrl+Win, Ctrl+F7
    --~ if _ctrl and not _shift and not _alt and _keycode == 118 then
    -- Ctrl+Win, Ctrl+F8
    --~ if _ctrl and not _shift and not _alt and _keycode == 119 then
    -- Ctrl+Win, Ctrl+F9
    --~ if _ctrl and not _shift and not _alt and _keycode == 120 then
    -- Ctrl+Win, Ctrl+F10
    --~ if _ctrl and not _shift and not _alt and _keycode == 121 then
    -- Ctrl+Win, Ctrl+F11
    --~ if _ctrl and not _shift and not _alt and _keycode == 122 then
    -- Ctrl+Win, Ctrl+F12
    --~ if _ctrl and not _shift and not _alt and _keycode == 123 then

    [/autoit] [autoit][/autoit] [autoit]

    fOwnMode = false
    -- avoids default processing
    return true
    end
    fOwnMode = false

    [/autoit] [autoit][/autoit] [autoit]

    -- ##== MOVE LINES ==##
    -- Ctrl+Shift+ArrowUp ##== Move line/selected-lines Up ==##
    if _ctrl and _shift and not _alt and _keycode == 38 then editor:MoveSelectedLinesUp() end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Shift+ArrowDown ##== Move line/selected-lines Down ==##
    if _ctrl and _shift and not _alt and _keycode == 40 then editor:MoveSelectedLinesDown() end

    [/autoit] [autoit][/autoit] [autoit]

    -- ##== MOVE SELECTIONS IN LINE ==##
    -- Ctrl+Alt+ArrowUp ##== Move selection in line Up ==##
    if _ctrl and not _shift and _alt and _keycode == 38 then SelectionMoveV(true) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Alt+ArrowDown ##== Move selection in line Down ==##
    if _ctrl and not _shift and _alt and _keycode == 40 then SelectionMoveV(false) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Alt+ArrowLeft ##== Move selection in line to Left ==##
    if _ctrl and not _shift and _alt and _keycode == 37 then SelectionMoveH(true) end

    [/autoit] [autoit][/autoit] [autoit]

    -- Ctrl+Alt+ArrowRight ##== Move selection in line to Right ==##
    if _ctrl and not _shift and _alt and _keycode == 39 then SelectionMoveH(false) end

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    return nil
    end --> EditKey
    -------------------------------------------------------------------------

    [/autoit]
  • Ich habe in letzter Zeit versucht mir anzugewöhnen mehr mit der Tastatur zu arbeiten. Es ist einfach schneller. Von dem her hört sich das schon mal sehr vielversprechend an :thumbup: .
    Wenn ich endlich mal wieder Zeit habe ein wenig zu scripten probiere ich deine Erweiterungen mal aus. ;)

  • Ich hoffe, du hast die im Startpost verlinkte AddOn-Variante (OwnHotKeys) verwendet. Die ist noch komfortabler und umfangreicher als die Variante aus diesem Thread hier. ;)

    Hi BugFix !

    Schon etwas älter der Thread ;), daher meine Frage : "Ist das so noch aktuell ?"

    Zitat

    Exzellent! Völlig unterschätzter Thread imo.

    Der Aussage schließe ich mich an :thumbup:.

    Der AddOn-Link im Startbeitrag funktioniert nicht mehr (Forumsupdate) - hier die neue Variante :

    SciTE-AddOn: OwnHotKeys (inkl. Installer)

    Nebenbei : DEMO-ANGUCKEN liefert mir eine leere Seite.

    EDIT : Flashplayer wird benötigt

    Gruß Musashi

    86598-musashi-c64-png

    "Am Anfang wurde das Universum erschaffen. Das machte viele Leute sehr wütend und wurde allenthalben als Schritt in die falsche Richtung angesehen."

    2 Mal editiert, zuletzt von Musashi (15. Juni 2019 um 20:32)

  • Musst auch den Flashplayer aktiviert haben.

    Danke !

    Darauf hätte ich durch einen Blick in den Seitenquelltext auch selbst kommen können :Face:

    NAME=movie VALUE="ohk.swf">

    Der Flashplayer ist bei mir seit langem verbannt !

    Gruß Musashi

    86598-musashi-c64-png

    "Am Anfang wurde das Universum erschaffen. Das machte viele Leute sehr wütend und wurde allenthalben als Schritt in die falsche Richtung angesehen."

    • Offizieller Beitrag

    Ist das so noch aktuell ?"

    Grundsätzlich ja.

    Es gibt aber inzwischen Änderungen in der SciTE Version. Dadurch

    - funktioniert der Installer nicht mehr (manuelle Installation erforderlich)

    - die neueste SciTE Version kann keine externen Bibliotheken einbinden (hier erforderlich: shell.dll), lässt sich beheben, indem man einfach die SciTE.exe gegen die der Vorversion tauscht.

    Wenn Probleme auftauchen, einfach fragen.

    Edit:

    Die Probleme beziehen sich auf die OHK-Version. In dieser Version verwende ich require nicht, somit ist die fehlende Bibliothekeneinbindung hier nicht relevant.