2014-02-06 42 views

回答

3

笨例如:
1.打開菜單 「Options」 - > 「打開的Lua啓動腳本」
2.寫任何Lua代碼,例如print('Selected: <'..editor:GetSelText()..'>')
3.按Ctrl-S(如果您想保存該文件),腳本將立即執行,輸出將顯示在輸出窗格中(右側)。
4.重複步驟2-3


多少有點愚蠢例如:
插入到這個 SciTEGlobal.properties

ext.lua.startup.script=$(SciteDefaultHome)/your_script.lua 

#print length of selected text 
command.33.*=PrintSelectionLength 
command.subsystem.33.*=3 
command.mode.33.*=savebefore:no 
command.shortcut.33.*=F1 

# User defined key commands 
user.shortcuts=\ 
F1|1133|\ 
Ctrl+Shift+V|IDM_PASTEANDDOWN|\ 
Ctrl+PageUp|IDM_PREVFILE|\ 
Ctrl+PageDown|IDM_NEXTFILE| 

user.context.menu=\ 
Selection Length (F1)|1133|\ 
||\ 
Toggle Output|IDM_TOGGLEOUTPUT| 

插入這your_script.lua

function PrintSelectionLength() 
    local sel = editor:GetSelText() 
    print(#sel..' chars selected') 
    print(table.concat({sel:byte(1,-1)},',')) 
end 

現在你可以按F1看到ASCII碼在編輯SciTE中的任何文件時選擇符號。

+0

有沒有什麼辦法可以在Scite正在運行而您正在處理另一個文檔時獲得這些功能? – user3279589

+0

是的,「SciTEGlobal.properties」中的任何更改都可以在不重新啓動SciTE的情況下實時應用。 –

+0

謝謝,我想我正在處理它 – user3279589