jaberwacky Posted August 10, 2013 Share Posted August 10, 2013 (edited) I hate using the arrow keys to go up or down several lines and especially loathe having to use the mouse. Which is what I usually do after I've hit the down arrow fifteen times. So, I cooked up this lua script which will jump the curser the indicated amount of lines either up or down. With this installed and SciTE reloaded simply press [ctrl] + [1] through [5]. This will jump the cursor from one to five lines in the document from its current position. To go the other way then press [ctr] + [alt] + [1] through [5]. I can add more if you think it would be necessary. Forgot to mention that this only works with the number pad. To use this just place the following lua file in the "...AutoIt3SciTELUA" directory. expandcollapse popupLineJumper = EventClass:new(Common) function LineJumper:OnKey(key, shift, ctrl, alt) local lines = 0 if ctrl == true and alt == false then if key == 97 then lines = 1 LineJumper:LineJump(lines) elseif key == 98 then lines = 2 LineJumper:LineJump(lines) elseif key == 99 then lines = 3 LineJumper:LineJump(lines) elseif key == 100 then lines = 4 LineJumper:LineJump(lines) elseif key == 101 then lines = 5 LineJumper:LineJump(lines) end elseif ctrl == true and alt == true then if key == 97 then lines = -1 LineJumper:LineJump(lines) elseif key == 98 then lines = -2 LineJumper:LineJump(lines) elseif key == 99 then lines = -3 LineJumper:LineJump(lines) elseif key == 100 then lines = -4 LineJumper:LineJump(lines) elseif key == 101 then lines = -5 LineJumper:LineJump(lines) end end return false end function LineJumper:LineJump(lines) local jump_to_line = editor:LineFromPosition(editor.CurrentPos) + lines if jump_to_line <= 0 then jump_to_line = 0 end editor:GotoLine(jump_to_line) return false end After you have done that then open SciTE and click 'Options' --> 'Open Lua Startup Script' and paste this line after the other lines (may require administrative rights): LoadLuaFile("LineJumper.lua") Not really useful but it is what it is. Found the scite editor functions here: Edited August 10, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
MHz Posted August 10, 2013 Share Posted August 10, 2013 You seem to enjoy using Lua. It looks like an interesting idea that you have created. Very good. If you know what line number that you want to go to then you can use Ctrl+G and then enter the line number. Press return and your there. I usually hide the line numbers by default so it can be perhaps a best guess if I use it. Link to comment Share on other sites More sharing options...
jaberwacky Posted August 10, 2013 Author Share Posted August 10, 2013 It's just so neat! Thanks. I guess this still has its purpose. I just use it to get me in the general location by sight. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now