New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support text editing shorcuts #21
Comments
I think most of these will be possible to implement, although they will only work on a subset of terminals which support these kinds of keybindings. I believe all relatively modern terminals support this stuff though. Unfortunately tcell does not support these keybindings out of the box, but I might be able add them anyway. Of course, I will need to use Ctrl instead of Cmd for all these keybindings. See #19. |
Sortof related to this, the Home and End keys don't seem to work yet. |
Tagging onto this, also appreciated would be some Sublime/Atom like commands such as:
Another small nit I have is when selecting text with the mouse, it would be nice if it highlighted as you go rather than when you release the mouse. Great work, love having this! |
It should highlight as you go, unless your terminal doesn't support mouse tracking. What terminal are you using? Also, I'm currently using |
OS X Terminal.app, but I'm inside of a tmux. Hmmm, works find outside of tmux. Looks like sublime support keyboard scrolling functionality but don't have key bindings set by default. |
Maybe a nice solution to this would be to read off configuration from a file, and ship it with sensible defaults? Assigning meaning to keybindings borders on holy war territory. |
I think @pscollins has the way of it. :) |
@zyedidia do you think it'd be better to try to add more keypress events to tcell, or to look for an alternative solution for dealing with keybindings? I feel like most of these aren't possible until those keybindings are easily detectable. I also do really like @pscollins idea about a config file |
I guess the first step towards making it configurable would be defining what actions there should be: |
Yeah, that's what I was planning on doing. This configuration could go in the {
"syntax": true,
"keybindings": {
"CtrlC": "copy",
"CtrlV": "paste"
}
} |
A bunch of these keybindings are now supported (using |
Using current master (6c99eea) I'm still seeing ctrl+arrows doing nothing and alt+arrows inserting |
Can you make sure you run Make sure you use commit 957e97d which has the updated makefile. |
I ran |
Nevermind, I was on the wrong branch, works fine. |
Of the bindings on this list, all that are possible have been implemented, so I'm closing this issue as resolved. Here are the bindings that are implemented: Movement Alt-LeftArrow: Go to start of previous word Selection Shift-Alt-LeftArrow: Select from current position to start of previous word Deletion Unfortunately, due to the way terminals work, it is not possible to support these keybindings: Ctrl-Backspace: Delete until the start of the line Alt-Delete: delete until end of next word Terminals simply don't send these as their own key events. |
Sorry to hijack that closed thread, but for all the people who came here for some sane defaults:
|
@LukeSkyw I understand your feeling, but you're implying that the default keybindings are not sane while they totally make sense from a mac perspective. 😉 I guess providing keybindings for linux and windows couldn't hurt. That would go in a new issue though. |
The file above should be bindings.json, and to fix the shifted as well:
|
Hello, I was having the same (original) issue on Mac OS with Terminal app. The Based on the mapping here, in preferences > profiles > keyboard you must map the missing key / action pair with what's on the code, by replacing |
It would be nice if the full range of text editing shorcuts worked:
On Macs:
Movement
Cmd-UpArrow: Go to start of the file
Cmd-LeftArrow: Go to start of the line
Cmd-RightArrow: Go to end of the line
Cmd-DownArrow: Go to end of the file
Alt-LeftArrow: Go to start of previous word
Alt-RightArrow: Go to start of next word
Selection
Shift-Cmd-UpArrow: Select from current position to start of the file
Shift-Cmd-LeftArrow: Select from current position to start of the line
Shift-Cmd-RightArrow: Select from current position to end of the line
Shift-Cmd-DownArrow: Select from current position to end of the file
Shift-Alt-LeftArrow: Select from current position to start of previous word
Shift-Alt-RightArrow: Select from current position to start of next word
Deletion
Cmd-Backspace: Delete until the start of the line
Cmd-Delete: Delete until the end of the line
Alt-Backspace: delete until end of previous word
Alt-Delete: delete until end of next word
Jump to previous/next word: #12
Select to previous/next word: #13
The text was updated successfully, but these errors were encountered: