1

Let's take a couple of lines:

asdkgjas;fwewgdsgflk : wthtklsjflasd
djfghkdjfgndfgdfg : wreteqw'[erlw

How could I move right away to the next line so that the cursor would appear after : (regardless of it's previous position on the previous line)?
If not possible to do it right away the with minimum actions.
I don't have certain preference about text editor, it can be any.

2 Answers 2

2

A. Notepad++

Add this macro on the `shortcut.xml` file found in `C:\Users\Username\AppData\Roaming\Notepad++` (replace `Username` with your username). It finds the `:` then moves on its right. Its shortcut is CTRL+Shift+A (you can change it, see first line of the macro).
<Macro name="Move_Next_To_Colon" Ctrl="yes" Alt="no" Shift="yes" Key="65">
     <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
     <Action type="3" message="1601" wParam="0" lParam="0" sParam=":" />
     <Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
     <Action type="3" message="1702" wParam="0" lParam="770" sParam="" />
     <Action type="3" message="1701" wParam="0" lParam="1" sParam="" />
     <Action type="0" message="2306" wParam="0" lParam="0" sParam="" />
</Macro>

Small caveats:

  • The macro will only move to lines that have : as it searches for colons.
  • If you are on a line where the cursor is before the colon, it will go next to colon on the same line. You will have to press on the shortcut to go to the next line with a colon.

This is how it works when pressing CTRL+Shift+A:

enter image description here

B. EmEditor

This macro is the equivalent of the one created for Notepad++. It works the same way and has the same caveats.

1.Create a new file and enter the following code:

document.selection.Find(":",eeFindNext | eeFindReplaceCase | eeFindAround,0);
document.selection.CharRight(false,1);
  1. On the menu bar, click Macro, then Save As. Give the macro a name.
  2. On the menu bar, click Tools, then Properties for All Configurations (or Properties for Current Configuration).
  3. On the windows that appears, on the left pane select Keyboard. On the right pane, on the Category dropdown list, select My Macros.
  4. On the Commands dropdown list, select the macro you created/saved. Enter the keys that should constitute the shortcut. Click Assign, then OK.

IMG:

1

In CudaText editor, make a macro. Install plugin "Macros" from "Plugins / Addon manager / Install", and use top menu "Macros" after restart. Macro must have few commands, if caret is on ":" char:

  • Shift+Right key, to select ":" char (or any char)
  • "find current selection, next" (from Command Palette)
  • Left key, to unselect char

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.