리눅스 쉘에서 놓친 것 중 하나는 Alt + Dot 단축키입니다. 그것이하는 것은 이전 명령의 마지막 인수를 삽입하는 것입니다. 사소한 기술로 보이지만 실제로는 유용합니다.
즉, 이것을 입력하면 :
$ ls /Applications/MAMP/conf/apache/
다음에 명령 + 바로 가기를 입력하면 인수가 완료됩니다.
$ cd 'alt+dot'
Mac에서는 두 가지 대안을 알고 있습니다. 누르면 Esc 키 + 점 또는 입력을 ! $ , * 와 마법의 공간 설정 .
그러나 두 대안 모두 마지막으로 사용한 인수를 삽입하지만 Alt + Dot를 반복적으로 입력하는 것처럼 명령 기록에서 다시 스크롤 할 수 없습니다 .
나는 지금이 옵션으로 살 수 있지만 누군가가 더 나은 방법을 알고 있는지 알고 싶습니다.
답변
Esc-dot를 여러 번 누를 수 있으며, alt-dot과 같은 일을합니다. 그러나, 당신처럼, alt-dot보다 타이핑하는 것이 더 번거 롭습니다.
답변
Terminal.app의 Preferences-> Settings에서 Keyboard 탭을 선택하십시오. “옵션 키를 메타로 사용”이 선택되어 있는지 확인하십시오.
답변
option+ 사용.
이것은 리눅스가 아닌 bash의 기능입니다. 맥도 그들에게 배쉬를 가지고있다. Alt-. 내장 된 bash 함수의 단축키입니다 insert-last-argument
. 이것을 다른 키 조합에 바인딩하는 방법 에 대해서는 bash 매뉴얼 페이지 의 READLINE 섹션을 읽으십시오 .
관련 부품 몇 가지 붙여 넣기 :
Readline Initialization
Readline is customized by putting commands in an initialization file (the
inputrc file).
The default key-bindings may be changed with an inputrc file. Other pro-
grams that use this library may add their own commands and bindings.
For example, placing
M-Control-u: universal-argument
or
C-Meta-u: universal-argument
into the inputrc would make M-C-u execute the readline command univer-
sal-argument.
Readline Key Bindings
The syntax for controlling key bindings in the inputrc file is simple.
All that is required is the name of the command or the text of a macro and
a key sequence to which it should be bound. The name may be specified in
one of two ways: as a symbolic key name, possibly with Meta- or Control-
prefixes, or as a key sequence.
When using the form keyname:function-name or macro, keyname is the name of
a key spelled out in English. For example:
Control-u: universal-argument
Meta-Rubout: backward-kill-word
Control-o: "> output"
In the above example, C-u is bound to the function universal-argument,
M-DEL is bound to the function backward-kill-word, and C-o is bound to run
the macro expressed on the right hand side (that is, to insert the text
``> output'' into the line).
In the second form, "keyseq":function-name or macro, keyseq differs from
keyname above in that strings denoting an entire key sequence may be spec-
ified by placing the sequence within double quotes. Some GNU Emacs style
key escapes can be used, as in the following example, but the symbolic
character names are not recognized.
"\C-u": universal-argument
"\C-x\C-r": re-read-init-file
"\e[11~": "Function Key 1"
Commands for Manipulating the History
insert-last-argument (M-., M-_)
A synonym for yank-last-arg.
답변
Terminal.app를 열고 환경 설정을 입력하고 설정> 키보드로 이동하여 “옵션을 메타 키로 사용”을 선택하면 다음과 같이 alt를 사용하는 bash 단축키를 사용할 수 있습니다.
Alt+ B: 거꾸로 단어 건너 뛰기
Alt+ F: 단어 앞으로 건너 뛰기