Mac OS X 터미널 : 맵 옵션 + 삭제를 "뒤로 삭제 단어"로
환경 설정-> 설정-> 키보드에서 매핑하려고 시도했지만 "키"콤보 상자에는 "전달 삭제"만 있고 "삭제"는 없습니다. 반면에 내 키보드에는 "삭제"만 있고 "앞으로 삭제"는 없습니다!
환경 설정을 제외하고 다른 방법이 있습니까?
옵션 키를 메타 키로 사용
- 로 이동
Terminal
>Preferences
>Profiles
>Keyboard
- 확인하십시오
Use option key as meta key
.
영상
macOS High Sierra 10.13.6에서 2018 년 10 월 23 일에 캡처되었습니다.
노트
bash 및 tcsh를 포함한 많은 응용 프로그램은 Meta-Delete를 "뒤로 삭제 단어"로 취급합니다.
OS X's terminal runs bash, which includes readline support. Follow Glomek's advice and tell terminal to use option as meta key (or else use Esc) and then you've got a bunch of handy options: Ctrl+w deletes prev word (as does Meta+delete as mentioned), but you can also use Meta+f and Meta+b to walk forward and backwards thru words, Ctrl+a and Ctrl+e to beginning and end of line, Ctrl+k delete (kill) from cursor to end of line, and a bunch more.
See http://www.bigsmoke.us/readline/shortcuts for a nice little reference table.
Delete a word going back:
Ctr-w.
By default meta backspace does a backwards word yank in most shells. If you press escape and then press backspace, that pretty much works everywhere.
⌃W
(control+W) is not the same thing than meta + delete (ESC+delete if you don't have checked use option as meta key) meta+delete will treat / _
as word delimiter where ^W
will consider space as delimiter.
e.g. using ESC+Bakcspace on (cursor at the end)
rm /dira/dirb/file1
gives
rm /dira/dirb/
while ^W on the same will give
rm
So it is better to use \033\177 rather than ^W when defining the modifying the terminal profile. That way you are really mapping ⌥⌫ to what esc⌫ is doing and you keep having ^W to erase word based on space delimiter.
I would love to be able to post an image on how do this but as a newbies I can't.
refer to bouke comment to see how to modify terminal profile.
In your Terminal's profile, you can bind ⌥⌫ (option+delete) to ⌃W (control+W), so it works similar to other apps.
iTerm 을 시도해보십시오 . 키 바인딩을보다 세밀하게 제어 할 수 있습니다 .
'Programing' 카테고리의 다른 글
오류 코드 : 2013. 쿼리 중 MySQL 서버 연결이 끊어졌습니다 (0) | 2020.05.01 |
---|---|
Eclipse CDT에서 C ++ 11 / C ++ 0x 지원을 활성화하는 방법은 무엇입니까? (0) | 2020.05.01 |
인수를 전달하고 파일에서 stdin을 gdb에서 실행되는 프로그램으로 리디렉션하는 방법은 무엇입니까? (0) | 2020.05.01 |
DIV에 클래스 "x"가없는 경우 jQuery (0) | 2020.05.01 |
jQuery에서 텍스트 영역의 변경 이벤트에 어떻게 바인딩 할 수 있습니까? (0) | 2020.05.01 |