/usr/bin/bash: Difference between revisions

Line 1,922: Line 1,922:


=== Completing ===
=== Completing ===
      complete (TAB)
;complete (TAB)
              Attempt to perform completion on the text before point.  Bash attempts completion treating
:Attempt to perform completion on the text before point.  Bash attempts completion treating the  text as a variable (if the text begins with $), username (if the text begins with ~), hostname (if the text begins with @), or command  (including  aliases  and  functions)  in turn.  If none of these produces a match, filename completion is attempted.
              the  text as a variable (if the text begins with $), username (if the text begins with ~),
;possible-completions (M-?)
              hostname (if the text begins with @), or command  (including  aliases  and  functions)  in
:List the possible completions of the text before point.
              turn.  If none of these produces a match, filename completion is attempted.
;insert-completions (M-*)
      possible-completions (M-?)
:Insert  all  completions of the text before point that would have been generated by possible-completions.
              List the possible completions of the text before point.
;menu-complete
      insert-completions (M-*)
:Similar to complete, but replaces the word to be completed with a single  match  from  the list  of possible completions.  Repeated execution of menu-complete steps through the list of possible completions, inserting each match in turn.  At the end of the list of  completions,  the  bell  is rung (subject to the setting of bell-style) and the original text is restored.  An argument of n moves n positions forward in the list of matches;  a  negative argument  may  be  used to move backward through the list.  This command is intended to be bound to TAB, but is unbound by default.
              Insert  all  completions of the text before point that would have been generated by possi‐
;menu-complete-backward
              ble-completions.
:Identical to menu-complete, but moves backward through the list of  possible  completions, as  if  menu-complete  had been given a negative argument.  This command is unbound by default.
      menu-complete
;delete-char-or-list
              Similar to complete, but replaces the word to be completed with a single  match  from  the
:Deletes the character under the cursor if not at the beginning or end of  the  line  (like delete-char).  If  at  the  end of the line, behaves identically to possible-completions. This command is unbound by default.
              list  of possible completions.  Repeated execution of menu-complete steps through the list
;complete-filename (M-/)
              of possible completions, inserting each match in turn.  At the end of the list of  comple‐
:Attempt filename completion on the text before point.
              tions,  the  bell  is rung (subject to the setting of bell-style) and the original text is
;possible-filename-completions (C-x /)
              restored.  An argument of n moves n positions forward in the list of matches;  a  negative
:List the possible completions of the text before point, treating it as a filename.
              argument  may  be  used to move backward through the list.  This command is intended to be
;complete-username (M-~)
              bound to TAB, but is unbound by default.
:Attempt completion on the text before point, treating it as a username.
      menu-complete-backward
;possible-username-completions (C-x ~)
              Identical to menu-complete, but moves backward through the list of  possible  completions,
:List the possible completions of the text before point, treating it as a username.
              as  if  menu-complete  had been given a negative argument.  This command is unbound by de‐
;complete-variable (M-$)
              fault.
:Attempt completion on the text before point, treating it as a shell variable.
      delete-char-or-list
;possible-variable-completions (C-x $)
              Deletes the character under the cursor if not at the beginning or end of  the  line  (like
:List the possible completions of the text before point, treating it as a shell variable.
              delete-char).  If  at  the  end of the line, behaves identically to possible-completions.
;complete-hostname (M-@)
              This command is unbound by default.
:Attempt completion on the text before point, treating it as a hostname.
      complete-filename (M-/)
;possible-hostname-completions (C-x @)
              Attempt filename completion on the text before point.
:List the possible completions of the text before point, treating it as a hostname.
      possible-filename-completions (C-x /)
;complete-command (M-!)
              List the possible completions of the text before point, treating it as a filename.
:Attempt completion on the text before point, treating it as a command name.  Command  completion attempts to match the text against aliases, reserved words, shell functions, shell builtins, and finally executable filenames, in that order.
      complete-username (M-~)
;possible-command-completions (C-x !)
              Attempt completion on the text before point, treating it as a username.
:List the possible completions of the text before point, treating it as a command name.
      possible-username-completions (C-x ~)
;dynamic-complete-history (M-TAB)
              List the possible completions of the text before point, treating it as a username.
:Attempt completion on the text before point, comparing the text  against  lines  from  the history list for possible completion matches.
      complete-variable (M-$)
;dabbrev-expand
              Attempt completion on the text before point, treating it as a shell variable.
:Attempt  menu  completion  on the text before point, comparing the text against lines from the history list for possible completion matches.
      possible-variable-completions (C-x $)
;complete-into-braces (M-{)
              List the possible completions of the text before point, treating it as a shell variable.
:Perform filename completion and insert the list of possible  completions  enclosed  within braces so the list is available to the shell (see Brace Expansion above).
      complete-hostname (M-@)
              Attempt completion on the text before point, treating it as a hostname.
      possible-hostname-completions (C-x @)
              List the possible completions of the text before point, treating it as a hostname.
      complete-command (M-!)
              Attempt completion on the text before point, treating it as a command name.  Command  com‐
              pletion attempts to match the text against aliases, reserved words, shell functions, shell
              builtins, and finally executable filenames, in that order.
      possible-command-completions (C-x !)
              List the possible completions of the text before point, treating it as a command name.
      dynamic-complete-history (M-TAB)
              Attempt completion on the text before point, comparing the text  against  lines  from  the
              history list for possible completion matches.
      dabbrev-expand
              Attempt  menu  completion  on the text before point, comparing the text against lines from
              the history list for possible completion matches.
      complete-into-braces (M-{)
              Perform filename completion and insert the list of possible  completions  enclosed  within
              braces so the list is available to the shell (see Brace Expansion above).


=== Keyboard Macros ===
=== Keyboard Macros ===