Script for increment and decrement number save position local StartPos = editor.CurrentPos Local fs,fe = editor:findtext( "\-*+", SCFIND_REGEXP,StartPos) Local CurLine = editor:LineFromPosition(StartPos) This script increment and decrement the next number found in text. Insert the current time in HH:MM:SS Timezone format function insertTime() replace current selection with text - if there is none, insert at cursor position function replaceOrInsert(text)Įnd end - insert the current date in YYYY-mm-dd format function insertDate()Īnd another function for inserting the current time: This version replaces the current selection, if there is one: I missed this feature in SciTE.Add the following lines into User Options File (SciTEUser.properties)Īdd the following lines into Lua Startup Script: function InsertDate() Insert the current date at the cursor position This script flips the positions of two adjacent characters.Įditor:ReplaceSel( string.sub(sel, 2, 2). ReplaceOrInsert( os.date( "%H:%M:%S %Z")) LOG (similar notepad)Īdd the following lines into User Options File (SciTEUser.properties)Īdd the following lines into Lua Startup Script: function InsertDateTimeLog() INSERT automatic current date time in mode. If Linea1 = nil then Linea1 = "0000" endĮditor:AddText( "\n\n-\n")Įditor:AddText( os.date( "%d.%b.%Y_%Hh:%Mm"))Įditor:AddText( "\n-\n")Ī simple Lua expression evaluator for calculating stuff. Local str = string.gsub( ' '.editor:GetLine(l), '%s+', ' ') While s do local l = editor:LineFromPosition(s) Local s,e = editor:findtext(findText,flag,0) If not f then print( ">Calculator: cannot evaluate selection") return endįind selection local findText = editor:GetSelText() If not expr or expr = "" then return end local f, msg = loadstring( "return ".expr) Highlight a valid Lua expression and run the script to perform the calculation or evaluation. Local ind = ' ' while ( string.len(ind) result: '.count.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |