V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yaotian
V2EX  ›  Python

在console下敲字实在是太累了

  •  
  •   yaotian · Jul 29, 2012 · 5887 views
    This topic created in 5030 days ago, the information mentioned may be changed or developed.
    最近常在终端下工作,由此想到,是不是也可以像sublime一样,ctrl+p,后那些经常用的命令直接出来,敲几个字母就完成一个命令的输入。

    当然,你也可以说可以用alias,可不能到一台机器上就设置一遍,太麻烦鸟。
    19 replies    2016-06-11 00:11:08 +08:00
    sinxccc
        1
    sinxccc  
       Jul 29, 2012
    如今是个 shell 就有自动补全和搜索历史的功能吧?

    实际上常敲的命令就那么几种,基本都是搜历史+改改…
    reus
        2
    reus  
       Jul 29, 2012
    默认按tab就有自动补全
    agassi_yzh
        3
    agassi_yzh  
       Jul 29, 2012
    vim很舒服啊!!!
    skydiver
        4
    skydiver  
       Jul 29, 2012   ❤️ 1
    在.inputrc里面加上两行:
    <pre>
    "\e[A":history-search-backward
    "\e[B":history-search-forward
    </pre>
    就可以用上下键寻找历史中以已经输入的字母开头的命令了。
    shiweifu
        5
    shiweifu  
       Jul 29, 2012
    换成zsh,再clone份oh-my-zsh基本就能很安逸的使用了
    doyle
        6
    doyle  
       Jul 29, 2012
    c-r不就行了。。。
    yaotian
        7
    yaotian  
    OP
       Jul 29, 2012
    @doyle 此为正解,谢谢分享
    yaotian
        8
    yaotian  
    OP
       Jul 29, 2012
    试了一下c-r还是不是很方便,它只能找到最后一个,切换起来也不是很流畅
    sinxccc
        9
    sinxccc  
       Jul 29, 2012
    @yaotian 再按一次 C-r ...
    haha1903
        10
    haha1903  
       Jul 29, 2012
    @sinxccc 9494
    wangzhen
        11
    wangzhen  
       Jul 29, 2012
    sublime 是用着很爽
    xlaok
        12
    xlaok  
       Jul 29, 2012   ❤️ 1
    最喜欢在console里面敲字了,很酷有没有
    c-r很好用,再加上oh-my-zsh,配置文件往坚果云里面一丢,舒舒服服
    phay
        13
    phay  
       Jul 29, 2012
    0.bash, zsh 都有很不错的补全。至于配置应该有现成的,zsh更有oh-my-zsh。
    1.终端自带补全。URXVT折腾下应该有。os x下iterm2自带的补全还挺方便的
    2.配置请同步。
    yaotian
        14
    yaotian  
    OP
       Jul 30, 2012
    @xlaok 哈哈,看来你敲的键盘还不够多。当敲键盘手指开始疼的时候,你就会想到一些省手指的工具了,呵呵。
    jiazhoulvke
        15
    jiazhoulvke  
       Jul 30, 2012
    dropbox或者git同步配置
    Ricepig
        16
    Ricepig  
       Jul 30, 2012
    欢迎使用power shell,哈哈哈
    Kvm
        17
    Kvm  
       Jul 31, 2012
    用KVM OVER IP有时候输入一个字 后面出现一大堆 。。。。。。
    9hills
        18
    9hills  
       Aug 1, 2012
    用zsh + oh my zsh吧。默认就非常好用

    比如你输入 abc,然后按上方向键,并不是和bash一样,显示abc开头的历史命令,而是显示包含abc的历史命令。而且tab补全非常强大,可以部分补全,而不是首字母补全。。。
    arrowna
        19
    arrowna  
       Jun 11, 2016
    @Kvm 和网速有关系?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3229 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 94ms · UTC 14:41 · PVG 22:41 · LAX 07:41 · JFK 10:41
    ♥ Do have faith in what you're doing.