smart home?

15 views
Skip to first unread message

John Gabriele

unread,
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?

todd_...@unc.edu

unread,
Aug 16, 2019, 2:16:19 PM8/16/19
to niceeditor
Something like this maybe:
PushPrefs
MoveSOL
SearchBack 0
FindRegExp [^  ]
PopPrefs
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

unread,
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
Forward
0 new messages