• # Pour classer vos raccourcis par applications

    Posté par . En réponse au journal Faire de la magie avec son .inputrc. Évalué à 10.

    Il est possible de restreindre vos raccourcis pour une application donnée. Je vous laisse quelques exemples.

    $if Bash
     # Edit the path
     "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
     # Insert open and close double quotes
     "\C-x\"": "\"\"\C-b"
     # Insert a backslash (testing backslash escapes in sequences and macros)
     "\C-x\\": "\\"
     # Quote the current or previous word
     "\C-xq": "\eb\"\ef\""
     # Add a binding to refresh the line, which is unbound
     "\C-xr": redraw-current-line
     # Edit variable on current line.
     "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
     # Non-incremental style of history completion
     "\ep": history-search-backward
     "\en": history-search-forward
    $endif
    $if Python
     # http://albatross.dnsdojo.net/apache2-default/wiki/index.php/Python_Readline_Completions
     ...
    $endif
    $if Mysql
     "\C-xc": "SELECT count(*) FROM "
     "\C-d": "desc "
     "\C-l": "show tables;\n"
    $endif
    $if Lftp
     "\C-g": "lftp "
    $endif
    $if Ftp
     "\C-xg": "get \M-?"
     "\C-xt": "put \M-?"
     "\M-.": yank-last-arg
    $endif

    Vous pouvez également le faire par mode:

     $if mode=vi
     ...
     $endif