smart home?

Skip to first unread message

John Gabriele

Aug 16, 2019, 1:58:30 PM8/16/19
to niceeditor
Does ne have a "smart home" command --- that is, one that takes me to the first non-whitespace character on the line? Currently this takes me two keystrokes for most lines, but even more if I want to move to the beginning of a line like

    // some comment

If no command for that, maybe a macro using MoveSOL and FindRegExp?

Aug 16, 2019, 2:16:19 PM8/16/19
to niceeditor
Something like this maybe:
SearchBack 0
FindRegExp [^  ]
That's a space followed by a literal Tab character in the brackets. Save that as "smarthome" in your ~/.ne directory, then map it to a key in your ~/.ne/.keys file.

John Gabriele

Aug 16, 2019, 2:29:59 PM8/16/19
to niceeditor
Awesome! Thanks, Todd!

For posterity, to insert that literal tab character: ^k ic 9

To my .keys file, to remap the Home key, I added:

    KEY 105 smart-home

(So, I can still use ^a to get all the way to the left.)

-- John
Reply all
Reply to author
0 new messages