V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
orangutan92
V2EX  ›  macOS

求推荐一款好用 macOS 终端

  •  
  •   orangutan92 · 2020-05-05 19:57:06 +08:00 · 5820 次点击
    这是一个创建于 1442 天前的主题,其中的信息可能已经有所发展或是发生改变。

    iterm2 的快捷键用着太难受了,尤其是移动光标,简直反人类。

    自带终端的又单调了点,默认配色白瞎眼。

    我想找一款终端,支持 option + 方向键跨单词移动,这样就不用连续按←或者→了。

    同时支持 option + delete 删除单词,command + delelte 删除当前行,操作逻辑跟 typora 一致。

    如果没有默认这样的终端,那么如何才能够让原有的终端快捷键设置成这样呢?

    第 1 条附言  ·  2020-05-06 11:49:05 +08:00
    经过各位 v 友的指导,经过一番摸索后,我最终找到了解决方案:
    In OSX, ⌥+⌫ and ⌘+⌫ are the shortcuts for deleting a word and deleting a line respectively. ⌘+ ← and ⌘+ → are for going to the beginning and end of lines. By default, iTerm2 isn't configured this way, and there are a lot of misleading guides online. The following is what I've found to work on my machine.

    Open the preferences (⌘+,) and go to the Keys tab.
    Add a global shortcut key, and just type in your shortcut
    In the Action dropdown, select Send Hex Code
    The hex codes for...

    Deleting a word: 0x17.
    Deleting a line: 0x15.
    Moving to the beginning of the line: 0x01.
    Moving to the end of the line: 0x05.
    Just open a new tab, and it should work!

    Here is a screenshot, for clarity.
    快捷键这样设置就可以了,跟一般软件设置不同的是,需要输入对应十六进制键值才能生效。
    22 条回复    2021-01-16 14:45:45 +08:00
    dcalsky
        1
    dcalsky  
       2020-05-05 19:58:34 +08:00
    你说的这些,item2 都可以,你没设置正确而已。
    orangutan92
        2
    orangutan92  
    OP
       2020-05-05 20:03:03 +08:00
    @dcalsky 是啊,不太懂默认的快捷键逻辑,而且网上也找了一些,文不对题。
    dcalsky
        3
    dcalsky  
       2020-05-05 20:06:59 +08:00   ❤️ 5
    Preferences -> Profiles -> Keys -> Load Presets -> Natural Text Editing.
    1002xin
        4
    1002xin  
       2020-05-05 20:07:06 +08:00
    要不看下我之前写的 iTerm2 帖子,应该算是比较好看了吧
    jdhao
        5
    jdhao  
       2020-05-05 20:08:17 +08:00 via Android
    你不管用哪个 terminal,它都需要你配置,学习怎么配置就行了。
    idlerlestat
        6
    idlerlestat  
       2020-05-05 20:13:57 +08:00
    在 bashrc 里设置 vi 模式,然后按 vi 用就行,不管哪个终端都行
    Volekingsg
        7
    Volekingsg  
       2020-05-05 20:14:16 +08:00
    macOS 基本上所有地方都支持 GNU Readline shortcut,你说的这些基本上应该都是默认支持了(除了 option + 方向键,但 iTerm 中应该也可以设置)
    Kobayashi
        8
    Kobayashi  
       2020-05-05 20:21:50 +08:00 via Android
    terminal != shell. 对于键入的内容修改归 shell 管。bash 依赖的是 readline,man readline 自己看。zsh 不依然 readline,使用自己实现的 ZLE,翻手册自己查。
    orangutan92
        9
    orangutan92  
    OP
       2020-05-05 20:22:03 +08:00
    @1002xin 是这个帖子吗? [前两天答应的--打造高颜值的 iTerm2 - V2EX (3)]( https://www.v2ex.com/t/608399?p=2)
    1002xin
        10
    1002xin  
       2020-05-05 21:09:16 +08:00
    hronro
        11
    hronro  
       2020-05-05 21:24:01 +08:00
    shell 换成 fish 就可以用 option + 方向键移动了
    darksword21
        12
    darksword21  
       2020-05-05 21:35:06 +08:00 via iPhone
    可以用 emacs 的快捷键移动单词
    VingeRayCN
        13
    VingeRayCN  
       2020-05-06 09:05:30 +08:00 via iPhone
    hyper 颜值在线
    CY4suncheng
        14
    CY4suncheng  
       2020-05-06 14:28:09 +08:00
    你说的这些快捷方式,karabiner-elements 可以帮你,哈哈,不只是终端,全局都可以,另外我就是默认终端+zsh
    orangutan92
        15
    orangutan92  
    OP
       2020-05-06 21:26:19 +08:00
    @CY4suncheng 这个软件不错呢,只是全局改了 vscode 里面也变了……
    CY4suncheng
        16
    CY4suncheng  
       2020-05-07 12:01:08 +08:00
    @orangutan92 我就喜欢所有的文本类工具都是同一套快捷键。。。这样用起来不是更好么?
    orangutan92
        17
    orangutan92  
    OP
       2020-05-07 21:55:24 +08:00
    @CY4suncheng 很容易冲突呀,而且冲突了很难找到
    EvilDevilJin
        18
    EvilDevilJin  
       2020-05-07 23:39:36 +08:00
    ihwbunny
        19
    ihwbunny  
       2020-05-08 08:55:00 +08:00
    macOS 自带 teminal 就可以 option + 方向键,就可以在单词间跳光标
    CY4suncheng
        20
    CY4suncheng  
       2020-05-08 10:56:08 +08:00
    @orangutan92 我用下来感觉还好
    longgediyi999
        21
    longgediyi999  
       2020-05-08 10:58:00 +08:00
    这个是跨单词解决方案 分别修改 option+←和 option+→的映射如下图所示,选择 Action 为“Send Escape Sequence”,然后输入“b”和“f”即可 网上查到的
    iuhiyuh
        22
    iuhiyuh  
       2021-01-16 14:45:45 +08:00
    直接用 vscode
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1028 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:37 · PVG 03:37 · LAX 12:37 · JFK 15:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.