StrongEd key bindings
|
Is there anyone out there who knows how to edit the StrongEd key bindings? |
|
Also, how do I change the default width from 80 characters? |
|
For a single mode, or for a global change in SE ? Global – StrongED.Defaults.Modes.BaseMode.ModeFile Text wrap widths are in the choices file(s) and again, like the key bindings you have choices in the base mode and specific modes |
|
Ctrl-Adjust click on the iconbar icon to load the BaseMode ModeFile. In there are all of StrongED’s standard key bindings. Edit the bindings as you see fit, then save the ModeFile and the bindings should be altered (no need to restart StrongED).
On the toolbar, Adjust click on the tick icon (v4.69) or the cog icon (v4.70) to open the mode choices. Then go to the Wrapping section and change the width set for ‘Fixed number of characters’. Click ‘Save’ when done. Note that this is a mode specific setting so you’ll need to change it for each mode that you want have to a specific width. |
|
Nice, thanks both. I’d eventually stumbled my way to that file ( |
|
There is a StrongHelp file inside !StrongEd, in !StrongEd.Resources.UK If you open a file in a mode that has the width set to 80 characters you will see 80 in the status bar at the bottom of the window. Click on it and it should change to a80 and that means auto. You can resize the page as you like now. |
|
Aha. Found it in the StrongHelp manual. |
|
They are, in the StrongHelp manual go to ‘Reference section > (List of) Functions’ and you’ll find a description of all the supported functions. |
|
Sorted now. I have the key bindings, colour scheme and window widths I want. Nice! |
|
Is there any trick to move the caret to the start of the text on a line (i.e. to the first character after the indent, if there’s any indent)? I’ve been able to set up lots of useful stuff, but can’t see a way to do this – aside from perhaps calling out to a plugin. |
|
There’s no function for this (although I might just create one) but you can tie a few functions together to achieve this. A simple solution could be to add this to the main KeyList:
However this doesn’t work correctly if the line has no indent (it takes the caret to the second word on the line) but on such lines you could just use Ctrl-Left arrow to move to start of line. A more elaborate trick is to use the GotoFound function. For this a search expression needs to be added to the ModeFile’s Search section:
Then a key binding that uses this search expression:
I’ve used the Home key here but of course it can be any valid keyboard shortcut. |
|
Hi Fred. Thanks – I had a feeling I’d be able to use a pre-baked search somehow. I have been able to cobble together a few useful bindings of my own. Some people may find these interesting, or awful! # Open the ListOfFound dialogue box with any selected text inserted in the search box: # Duplicate the current line onto the next line # Scroll the window up/down by several lines without moving the caret |
|
I tried your Ah, it was |
|
StrongED already provides this but it needs two keypresses, F2 then F7. Here’s an alternative way of doing this that doesn’t need the clipboard. ^F7 dbox_ListOfFound BlockToBuffer If the text to search for is a single word then you can just place the caret in that word and hit c-F (searches current text) or cs-F (searches all texts).
This can be shortened to cs-D StartOfTLine MarkLine BlockCopy BlockClear
Ah, so these are the opposite of LineUp etc where the caret is kept in the same x,y position. With the above the caret stays in the same line during scrolling. Candidates for a new function, me thinks.
Sorry about that, I run 4.70a16 almost all of the time. 4.69a5 is a very old version (2011), I would recommend upgrading to 4.69f14 or (if you fancy) 4.70a15. The PushBlock and PullBlock functions are 4.70 additions. Without them the move to first non-space character still works but if a selection is present it will be cleared. |
|
Thanks for your help!
Yes. As a real function, you can do the right thing when: a) the caret scrolls out of view, which is OK Thus, the caret never moves, but you can peek up or down the document. My key mapping at the moment is obviously a cludge and goes wrong near the top/bottom of the file or when trying to peek beyond a screenful of text from where the caret is. Having a parameter to specify how many lines at once might be nice, too. |
|
I don’t think that’s correct because it would cause the list of found dialogue to set its context to the block, which is generally pretty useless (for this use case). |
|
I’ve changed the ScrollText function (4.70’s replacement for LineUp & LineDown) to take two extra parameters so it now looks like this:
Direction is one of: Up,Down,Left,Right With CaretAdr the caret stays in the same position relative to the text, and CaretPos keeps caret in same x,y position relative to the window. Seems to work, might need some fine-tuning (I’m not happy yet with left/right scrolling).
Oh dear, silly me, you’re right. |
|
Good stuff. I appreciate that I’m pushing against the norms of RISC OS text editors here, but is it possible to make (select) clicking in the document clear the selection ( |