Re: [Ext] [code] Moving around and selecting text with arrow and modifier keys

From: James Reynolds <>
Date: Wed, 24 Jun 2020 21:44:35 +0000

I can't see the alt-shift-arrow keybinding in the keys.lua file. I tried to manually set it with the following but it didn't work.

keys['asleft'] = buffer.word_left_extend
keys['asright'] = buffer.word_right_extend

I don't know if I'm doing it wrong. In fact, the only mapping for alt that I see is the following.

keys.aright, keys.aleft = buffer.word_right, buffer.word_left


Is the intended functionality that control-shift-arrow selects the words and alt-shift-arrow selects chars? I just checked on Windows and it seems like that's how Notepad and Notepad++ work on it. These comments seem to verify the this is the intended functionality.

-- Ctrl+Shift+Left |^⇧⇠<br/>^⌘⇧B|S-^Left |Word left extend selection
-- Alt+Shift+Left |⌥⇧⇠ |M-S-Left |Char left extend rect. selection
-- Ctrl+Shift+Right|^⇧⇢<br/>^⌘⇧F|S-^Right |Word right extend selection
-- Alt+Shift+Right |⌥⇧⇢ |M-S-Right |Char right extend rect. selection

Unfortunately, that's not how any text editors/fields work on Mac. Alt-shift-arrow universally selects by word. I've got 20 years of muscle memory doing that and I guess that's why I can't get over how Textadept is doing it. All of the following apps select by word using alt-shift-arrow. Just to be complete, I'm listing what they do with cntl-shift-arrow.

- In BBEdit (the most revered text editor on the Mac), Xcode, and Sublime Text cntl-shift-arrow extends by word (same as alt-shift-arrow).
- In Microsoft Word cntl-shift-arrow moves the selected toolbar item (doesn't affect the text at all).
- In LibreOffice and OpenOffice cntl-shift-arrow just moves the cursor one char and doesn't select anything.
- In Atom cntl-shift-arrow changes tabs (doesn't affect the text at all).
- In Visual Studio Code I'm not sure what it's trying to do... right arrow selects 1 word then the entire line, left arrow puts the cursor at the end of the current word and then does nothing...
- In everything else, e.g. Thunderbird, and Cocoa text fields (Mail, Notes, TextEdit, and all text fields) it extends to the selection to the start/end of the line (same as cmd-shift-arrow).

So I'm guessing cntl-shift-arrow isn't something that anyone on the Mac even uses with regularity. And alt-shift-arrow selects by word in all of them.

Because I did all of this research, I'm actually hoping you will be willing to make this change in your source. I actually want to try to push Textadept to the Mac administrators at my university and if this is changed it will help my cause. I'm actually trying to convince people to stop using Electron apps like Atom and Visual Studio Code... Most Mac people I know will only use BBEdit. But because BBEdit is only on the Mac, the crossplatform Mac people might be enticed by Textadept over Atom and VSCode.


Note: OSX was a nickname given to Mac OS X by the community. A few years ago Apple swapped "Mac OS X" for "macOS". On Monday Apple announced the next version of macOS is macOS 11. The last version of macOS to contain a 10 is macOS 10.15 (and it was released last fall). The next version (released this fall?) wont have any form of 10 or X that's part of its name or version number. I don't know if this is something you really want to change, but I thought I'd let you know. If you were to change it I'd recommend using macOS. I didn't like the name change myself but some battles can't be won so I gave in.

James Reynolds
Sr Systems Administrator
School of Biological Sciences
The University of Utah

> On Jun 24, 2020, at 11:57 AM, Mitchell <> wrote:
> WARNING: Stop. Think. Read. This is an external email.
> Hi James,
> On Tue, 23 Jun 2020, James Reynolds wrote:
>> I regularly use opt/alt arrow to move around and skip words and it works in macOS in every app I can think of. I can also select text by word by adding shift. So shift-opt/alt-arrow will select the word. Textadept doesn't use this shortcut, instead it uses shift-cntl-arrow to select text by word. I've been trying to relearn this but it's the only app that I use that does this and I can see it's not going to happen. Is it possible to remap this behavior? I'm afraid it's part of scintilla and isn't modifiable.
> Are you not able to bind the keys you want to use?[1] Most of Textadept's key bindings are defined in *modules/textadept/keys.lua* to give you an idea of what you can try.
> Cheers,
> Mitchell
> [1]:
> --
> You are subscribed to
> To change subscription settings, send an e-mail to
> To unsubscribe, send an e-mail to

Received on Wed 24 Jun 2020 - 17:44:35 EDT

This archive was generated by hypermail 2.2.0 : Thu 25 Jun 2020 - 06:42:24 EDT