BASH 완료: 반복을 무시하시겠습니까?

BASH 완료: 반복을 무시하시겠습니까?

TAB저는 단말기를 사용할 때 너무 여러번 누르는 나쁜 버릇이 있습니다 . 호출된 bash 완료 루틴이 특히 느린 경우 터미널이 완료 목록을 2~3회(또는 여러 번 TAB눌렀는지) 표시하는 동안 엄청난 대기 시간이 발생합니다.

반복되는 키 누르기를 무시하기 위해 bash 완료를 수행하는 방법이 있습니까?

답변1

매뉴얼 페이지는 지원되는 완성 키를 조정하기 위해 ~/.inputrc 파일에 정의할 수 있는 대규모 "변수" 세트를 정의합니다.

전략적으로 할당함으로써오른쪽 키올바른 기능을 사용하면 아마도 원하는 효과를 얻을 수 있을 것입니다. 그러나 실제로 double이 TAB작업을 두 번 수행하는 것을 막을 수는 없습니다.

샘플 ~/.inputrc 파일:

C-TAB: complete
TAB: complete-filename

매뉴얼 페이지의 관심 영역은 다음과 같습니다.

Completing
   complete (TAB)
          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.
   possible-completions (M-?)
          List the possible completions of the text before point.
   insert-completions (M-*)
          Insert all completions of the text before point that would have been
          generated by possible-completions.
   menu-complete
          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.
   menu-complete-backward
          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.
   delete-char-or-list
          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 identi‐
          cally to possible-completions.  This command is unbound by default.
   complete-filename (M-/)
          Attempt filename completion on the text before point.
   possible-filename-completions (C-x /)
          List the possible completions of the text before point, treating it as
          a filename.
   complete-username (M-~)
          Attempt completion on the text before point, treating it as a username.
   possible-username-completions (C-x ~)
          List the possible completions of the text before point, treating it as
          a username.
   complete-variable (M-$)
          Attempt completion on the text before point, treating it as a shell variable.
   possible-variable-completions (C-x $)
          List the possible completions of the text before point, treating it as
          a shell variable.
   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 completion 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).

관련 정보