Mac으로 갈 때 쉘 환경 메모
(거의 100만번 달이지만)
요약
zsh 설치
$ brew install zsh
/usr/local/bin/zsh에 설치되기 때문에, /etc/shells에 쉘을 추가한다. $ sudo vim /etc/shells
/usr/local/bin/zsh 추가다음 명령으로 쉘 전환
$ chsh -s /usr/local/bin/zsh
prezto 설치
prezto 은 zsh 를 설정하기 위한 framework 로, 뻔뻔하고 멋지기 때문에, 간단하게 좋은 느낌으로 그것 같게 해 준다. 사람 방향
$ git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
.z~ 시스템 파일 및 심볼릭 링크 만들기 $ setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
  ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
좋은 느낌은 pure, steeef 또는 sorin이라고합니다.
여기에는 테마가 있습니다.
테마가 결정되면
.zpreztorc 파일에 씁니다..zpreztorc
zstyle ':prezto:module:prompt' theme 'sorin'
Git 브랜치를 보려면 Prezto 모듈에 git을 추가하십시오.
.zpreztorc
zstyle ':prezto:load' pmodule \
  'environment' \
  'terminal' \
  'editor' \
  'history' \
  'directory' \
  'spectrum' \
  'utility' \
  'completion' \
  'prompt' \
  'git'
이런 느낌이 된다.

VSCode setting.json 수정
Code → 기본 설정 → 설정에서 다음을
/usr/local/bin/zsh로 변경Terminal › Integrated › Shell: Linux
Terminal › Integrated › Shell: Osx
settings.json을 직접 변경하는 경우.
settings.json
    "terminal.integrated.shell.linux": "/usr/local/bin/zsh",
    "terminal.integrated.shell.osx": "/usr/local/bin/zsh",
~/.bashrc ~/.bash_profile →~/.zshrc 로 이사
aliase 와 환경 변수나 함수라든지, 필요한 것을 가져갑니다.
gcloud SDK 시작하지 않음
공식 여기으로 설치하고,
bash 때는 ~/.bashrc에 이하 기재가 있었습니다.
~/.bashrc
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/andormeda/y/google-cloud-sdk/path.bash.inc' ]; then . '/Users/andormeda/y/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/andormeda/y/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/andormeda/y/google-cloud-sdk/completion.bash.inc'; fi
아무 일도 없었고 bash를 zsh로 변경하면 잘 작동했습니다.
~/.zshrc
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/andormeda/y/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/andormeda/y/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/andormeda/y/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/andormeda/y/google-cloud-sdk/completion.zsh.inc'; fi
peco를 사용한 편리한 기능
오이타 유명하지만, history를 증분 검색하는 사람입니다.
brew로 설치
brew install peco
~/.zshrc에 다음을 추가
control + r에 키 바닌드를 할당합니다.~/.zshrc
# peco peco-select-history
function peco-select-history {
    BUFFER=`history -n -r 1 | peco --query "$LBUFFER"`
    CURSOR=$#BUFFER
    zle reset-prompt
}
zle -N peco-select-history
bindkey '^r' peco-select-history
자주 실행하는 명령을 텍스트 「~/.command」에 정리해 두어, 같이 증분 검색해 사용할 수 있습니다.
control + t에 키 바닌드를 할당합니다.~/.zshrc
# peco-snippets
function peco-snippets() {
    BUFFER=$(grep -v "^#" ~/.command | peco --query "$LBUFFER")
    zle reset-prompt
}
zle -N peco-snippets
bindkey '^t' peco-snippets
Reference
이 문제에 관하여(Mac으로 갈 때 쉘 환경 메모), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/andromeda/items/ab1bc0ae62eae49e3ae7텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)