hyper
hyper copied to clipboard
Text Navigation (Ctrl + arrow)
When editing text (coming from a windows background), I like to use Ctrl+left/right arrow for jumping from word to word. I'd like to be able to do this in Hyper as well.
I've been able to get this behavior on mac by using a DefaultKeyBinding.dict
(Karabiner is currently broken on mac sierra)...
"^\UF702" = "moveWordBackward:";
"^\UF703" = "moveWordForward:";
...since electron-based apps obviously don't respect DefaultKeyBinding.dict
, I got this to work in atom (keymap.cson
) using...
'ctrl-left': 'editor:move-to-beginning-of-word'
'ctrl-right': 'editor:move-to-end-of-word'
It looks like there's some discussion around adding something like this to hyper, but in the meantime, anyone else run into this or have any solutions to offer? Thanks.
@jritsema alt+left arrow or alt+right arrow should work for this
Right, but I want to use the control
key rather than alt
.
The issue there is that ctrl + left arrow controls desktop management on macOS, so that'd be a conflict.
True, but I've disabled that in mac preferences (mission control), and like I said, I've enabled it in atom (another electron based app) using their keymap.cson support. I'm also able to get this behavior in iTerm2 (since they support keyboard mappings) but would prefer to use Hyper.
I wouldn't have posted this if I felt it was a very niche personal request. I'm guessing there is a significant percentage of former windows developers using mac that would appreciate the ability to change keyboard mappings.
I also looked at using the hyper-keymap plugin but it only allows mapping keys to the limited Hyper-specific commands (like new-window
, close-window
, etc.). I understand this ask might be complex to implement since I'm wanting to change keys inside the terminal.
At any rate, this PR by the same author as hyper-keymap looks promising.
That's a good point. It's been a very popular request here to support custom keymaps and that feature could help you here. Although, I think @rauchg prefers that functionality in a plugin (though not completely sure). Perhaps he could chime in.
Thanks @CodeTheory. Curious what @rauchg thinks. Perhaps this doesn't belong inside Hyper since it will be possible once Karabiner gets updated for sierra. But still might be a slick enhancement.
Even on Windows, I can't seem to get Ctrl+Arrow to work, or Alt+Arrow.
Neither Ctrl + Arrow or Alt + Arrow are working for me on Windows either
This seems like an issue that's been around for months (Alt + Arrow navigations).
you can now configure keyboard shortcuts for hyper commands:
https://github.com/zeit/hyper/blob/7f804cf66cd948357471333bccf39e0abc9a844b/app/keymaps/darwin.json
i guess the solution is to either add editor:move-to-beginning-of-word
to hyper or write an extension
Default OSX keys are not the same as Windows. OSX alt+left is normal, but on Win its normal to use ctrl + left/right. Even though configurations/plugins could solve this, I think you should think how the normal OS UX is and go from there instead.
Alt+Left/Right works on Windows, but are non standard behavior
But what are the state then for ctrl+left/right to be configurable, so I can do that?
@lorensr yeah a config like that would be perfect 👌
I too would very much like an option to get Ctrl+Arrow working. I use it all the time in other apps and it's kinda annoying when I automatically try it in Hyper only to remember once again that it's not supported.
So it looks like there IS an option for this: https://github.com/zeit/hyper/blob/2.0.0/app/keymaps/win32.json#L42-L43
but it doesn't seem to work for me. Can anyone get this to work?
To share some history, binding Ctrl+Arrow to word movement in terminal apps is has been standard on Linux for quite some time, and (IIRC) was actually also the default movement binding for Terminal.app on macOS prior to the release of Spaces in 10.5 (when Apple decided to set a default binding for switching spaces).
Maybe I'm showing my age here, but I've always disliked how macOS automatically binds this keyboard shortcut for switching spaces, and have therefore always unbound it. Old habits die hard, I suppose, and in fact I hadn't even realized until now that macOS's Terminal.app defaults to using Option+Arrow for word movement, because I've always rebound Ctrl+Arrow to work for that.
It would be nice if we could rebind Ctrl+Arrow to word movement in Hyper on either macOS or Windows. 🙂
I'm used to doing fn+left/right to go to beginning/end of line, which also doesn't seem to work. Any suggestions? Thanks!
@marcooliveira, I assume on your keyboard fn+← maps to Home, and that fn+→ maps to End. In which case, those are working fine for me (on Windows)
@marcooliveira ctrl+a and ctrl+e moves the cursor to the beginning and end of a line.
ctrl + right and ctrl + left does also not work for me. I have explicitly set the keymap in the configuration, however alt + arrow key instead works
Same here I can't get this to work on linux.
So it looks like there IS an option for this: https://github.com/zeit/hyper/blob/2.0.0/app/keymaps/win32.json#L42-L43
but it doesn't seem to work for me. Can anyone get this to work?
I'm running hyper terminal on Windows, and the following method is working for me (Change keymaps, use cmd+left instead of ctrl+left):
I open the keymap file by pressing the hamburger menu on the left-top corner, then press "Edit", then press "Preferences..." to open the " ~/.config/Hyper/.hyper.js" https://hyper.is/#keymaps
Scroll to the bottom of the hyper.js and you will see the snippet of keymaps like this: keymaps: { // Example // 'window:devtools': 'cmd+alt+o', },
Then you add the following key-value into the keymaps snippet (Notice that it isn't ctrl+left or ctrl+right. Just use cmd instead of ctrl ): 'editor:movePreviousWord': 'cmd+left', 'editor:moveNextWord': 'cmd+right'
It turns out to be like this: keymaps: { // Example // 'window:devtools': 'cmd+alt+o', 'editor:movePreviousWord': 'cmd+left', 'editor:moveNextWord': 'cmd+right' },
Then you can use ctrl + left or ctrl + right to move word in the terminal.
So it looks like there IS an option for this: https://github.com/zeit/hyper/blob/2.0.0/app/keymaps/win32.json#L42-L43 but it doesn't seem to work for me. Can anyone get this to work?
I'm running hyper terminal on Windows, and it is working for me (Change keymaps, use cmd+left instead of ctrol+leftt):
I open the keymap file by pressing the hamburger menu on the left-top corner, then press "Edit", then press "Preferences..." to open the " ~/.config/Hyper/.hyper.js" https://hyper.is/#keymaps
Scroll to the bottom of the hyper.js and you will see the snippet of keymaps like this: keymaps: { // Example // 'window:devtools': 'cmd+alt+o', },
Then you add the following key-value into the keymaps snippet (Notice that it isn't ctrl+left or ctrl+right. Just use cmd instead of ctrl ): 'editor:movePreviousWord': 'cmd+left', 'editor:moveNextWord': 'cmd+right'
It turns out to be like this: keymaps: { // Example // 'window:devtools': 'cmd+alt+o', 'editor:movePreviousWord': 'cmd+left', 'editor:moveNextWord': 'cmd+right' },
Then you can use ctrl + left or ctrl + right to move word in the terminal.
adding the keymaps does not work in macos
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
"editor:movePreviousWord": "ctrl+left",
"editor:moveNextWord": "ctrl+right",
},
tbh I think the app should respect the DefaultKeyBinding.dict
as per os settings support. Minimum would be that hyper actually applies the changes in it's own configuration.
Also my config is in ~/.hyper.js
not in ~/.config/Hyper/.hyper.js