开发者

What is the equivalent of option/alt + left/right arrow on debian but on a Mac OS X?

开发者 https://www.devze.com 2023-01-17 04:45 出处:网络
As the title says... It\'s been annoying me forever that开发者_开发问答 I can\'t skip over words when writing in the Mac terminal (it works when im logged into Debian via ssh on the Mac terminal)

As the title says...

It's been annoying me forever that开发者_开发问答 I can't skip over words when writing in the Mac terminal (it works when im logged into Debian via ssh on the Mac terminal)

I get '[D' on Mac instead of jumping a word left.


Option + B to skip back a word, Option + F to skip forward a word. You also have to use the option key as the meta key.


Ctrl-[ b should jump back a word. You can also use Esc instead of Ctrl-[, and f to go forward.

The same key combos will work on Linux (over SSH, or sitting at the machine) and doesn't require adjusting to different keyboard layouts.


The answers here do not solve the issue in my opinion. To get GNU like word scrolling, you can edit your key bindings for CTRL + -> and CTRL + <- in order to have them skip words.

ITERM(2) Go to Preferences -> Profiles -> Keys -> + (Under the bindings) You will have a prompt asking you for a keyboard shortcut, press CTRL and the arrow key you are using. Set ACTION to SEND ESCAPE SEQUENCE Set ESC+ to b (for back) or to f (for forward)

TERMINAL Preferences -> Profiles -> Keyboard -> + (Under the bindings) Set KEY to <- Cursor left or right Set MODIFIER to ^ Control Set ACTION to Send Text Set the empty input box to either \033f (for forward) or \033b (for backward)

After exiting, you will be able to skip forward and backward by 1 word, exactly like in GNU Linux.

Please note that there will be an issue with vim for cycling forward, as noted here: https://superuser.com/questions/639992/iterm2-vim-altright-left-arrow

I hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消