Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Discovering that you could so such things in .inputrc was a big lightbulb moment for me.

    # not relevant on osx
    #$include /etc/inputrc
    
    $if Bash
        # append a '/' to show a dir is a dir
        set mark-directories on
        set mark-symlinked-directories on
        # no audible or visual bell
        set bell-style none
        # use ls -F style highlights for completion
        set visible-stats on
        # go right to showing multiple options
        set show-all-if-ambiguous on
        # ctrl-p cycles through options
        "\C-p": menu-complete
        "\C-x\C-x": exchange-point-and-mark
        "\ew": copy-region-as-kill
        # easier back and forth by word
        "\C-b": backward-word
        "\eb": backward-char
        "\C-f": forward-word
        "\ef": forward-char
    $endif
    
    # Two silly macros
    #
    # Insert double quotes & set cursor between them
    "\C-x\"": "\"\"\eb"
    #
    # Insert single quotes & set cursor between them
    "\C-x'": "''\eb"


> # silly macros

I get shell access on one of my webhosting companies (DreamHost), so I scp data up to it a lot, but the path is a bit of a pain to type, except for this shortcut:

   # ctrl-d ctrl-h is a mnemonic for DreamHost
  '\C-d\C-h': login@mysite:login/path/to/mywebsite/data  etc.


I did not know you could put conditions in inputrc. Useful.


I haven't gone to much further with it, but it is very handy: http://tiswww.case.edu/php/chet/readline/readline.html#SEC11




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: