Readline

Readline est le programme qui prends les commandes utilisateur. On va retrouver readline dans la plupart des programmes: bash, vim, read, etc ... L'interet de readline est donc d'avoir des methodes/raccourcis/config commune a tout ce qui prends du texte.

Les raccourcis cools

Les plus utiles sont les suivants:

Cursor Movement:

  • Ctrl+b: Move cursor one character to the left
  • Ctrl+f: Move cursor one character to the right
  • Alt+b: Move cursor one word to the left
  • Alt+f: Move cursor one word to the right
  • Ctrl+a: Move cursor to start of the line
  • Ctrl+e: Move cursor to end of the line

Copy & Paste:

  • Ctrl+u: Cut everything from line start to cursor
  • Ctrl+k: Cut everything from the cursor to end of the line
  • Alt+d: Cut the current word after the cursor
  • Ctrl+w: Cut the current word before the cursor
  • Ctrl+y: Paste the previous cut text
  • Alt+y: Paste the second latest cut text
  • Alt+Ctrl+y: Paste the first argument of the previous command
  • Alt+., Alt+_: Paste the last argument of the previous command

History:

  • Ctrl+p: Move to the previous line (useless?)
  • Ctrl+n: Move to the next line (useless?)
  • Ctrl+s: Search (useless, freeze default terms?)
  • Ctrl+r: Reverse search
  • Ctrl+j: End search (Usseless, Esp ?)
  • Ctrl+g: Abort search (restores original line)
  • Alt+r: Restores all changes made to line

Completion:

  • Tab: Auto-complete a name
  • Alt+?: List all possible completions (useless?)
  • Alt+*: Insert all possible completions

Edition:

  • Ctrl+e,Ctrl+x : Permet d'editer le prompt avec $EDITOR

Misc:

  • Ctrl+l: Clear the screen

Voir aussi: http://www.bigsmoke.us/readline/shortcuts Source: https://wiki.archlinux.org/index.php/Keyboard_shortcuts#Readline

Voir la conf

Simple:
bind -P
Page last modified on July 12, 2017, at 06:54 PM EST