Setting / Terminal / Mac

codelab·2024년 6월 13일
0

Dev

목록 보기
8/9
post-thumbnail

Install Homebrew

https://brew.sh/ko/

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Utils

brew install zsh highlight coreutils iterm2 jq tree
zsh # change shell to zsh

Create Vimrc

add color, line number

vi ~/.vimrc

syntax on
colorscheme default
set number

Create zsh_install.sh

vi ~/zsh_install.sh

mkdir -pv $HOME/Repos
curl -L https://raw.githubusercontent.com/nordtheme/dircolors/develop/src/dir_colors -o ~/.dircolors
git clone --depth 1 https://github.com/marlonrichert/zsh-snap.git $HOME/Repos/znap
git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/Repos/fzf && $HOME/Repos/fzf/install --all
git clone --depth 1 https://github.com/spaceship-prompt/spaceship-prompt.git $HOME/Repos/spaceship-prompt
# git clone https://github.com/chriskempson/base16-shell.git $HOME/Repos/base16-shell
git clone https://github.com/chriskempson/base16-shell.git $HOME/.config/base16-shell
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git $HOME/Repos/fast-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/Repos/zsh-autosuggestions

Create .zshrc

vi ~/.zshrc

export LANG=ko_KR.UTF-8
[ -f /Users/codelab/.fzf.zsh ] && source /Users/codelab/.fzf.zsh

# Base16 Shell
BASE16_SHELL="$HOME/.config/base16-shell/"
source "$BASE16_SHELL/profile_helper.sh"

# gdircolors를 사용하여 LS_COLORS 환경 변수를 설정합니다.
if type gdircolors > /dev/null 2>&1; then
    eval "$(gdircolors -b)"
fi

# 명령에 색상을 추가합니다.
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

eval "$(gdircolors ~/.dircolors)"

alias catc="highlight  --out-format xterm256 -l --force -s solarized-light --no-trailing-nl"
alias caty="highlight  --out-format xterm256 -l --force -s solarized-light --no-trailing-nl --syntax=yaml"


#  Zsh History
# History won't save duplicates.
setopt HIST_IGNORE_ALL_DUPS
# History won't show duplicates on search.
setopt HIST_FIND_NO_DUPS

#  Zsh Theme
source $HOME/Repos/spaceship-prompt/spaceship.zsh-theme
SPACESHIP_PROMPT_ORDER=(
    user
    dir
    host
    git
    exec_time
    line_sep
    jobs
    exit_code
    char
)
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_ADD_NEWLINE=false
SPACESHIP_CHAR_SYMBOL=">"
SPACESHIP_CHAR_SUFFIX=" "


#  Zsh Plugins
# fast-syntax-highlighting
source $HOME/Repos/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
# zsh-autosuggestions
source $HOME/Repos/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh


#  Znap
[ -f $HOME/Repos/znap/znap.zsh ] ||
    git clone --depth 1 https://github.com/marlonrichert/zsh-snap.git $HOME/Repos/znap

source $HOME/Repos/znap/znap.zsh

znap prompt sindresorhus/pure
znap source marlonrichert/zsh-autocomplete
znap eval iterm2 'curl -fsSL https://iterm2.com/shell_integration/zsh'
znap function _pyenv pyenv "znap eval pyenv 'pyenv init - --no-rehash'"
compctl -K    _pyenv pyenv
znap install aureliojargas/clitest zsh-users/zsh-completions


# aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'


#  Kubernetes
# To load completions for each session, execute once:
# kubectl completion zsh > "$HOME/Repos/zsh-users/zsh-completions/src/_kubectl"
# clusterctl completion zsh > "$HOME/Repos/zsh-users/zsh-completions/src/_clusterctl"
autoload -U compinit; compinit
alias k=kubectl
alias c=clusterctl
export KUBECONFIG=$HOME/.kube/config
# export KUBECONFIG=/etc/kubernetes/admin.conf

#  nvm
export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion


#  Setting env
# github api token
export GITHUB_TOKEN=$GITHUB_TOKEN
export CLUSTER_TOPOLOGY=true

# oci
export OCI_CLI_AUTH=instance_principal
export USE_INSTANCE_PRINCIPAL=true
export USE_INSTANCE_PRINCIPAL_B64=$(echo -n true | base64)

if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)"; fi

Run commands

chmod +x ~/zsh_install.sh && ~/zsh_install.sh # Download Reps
source ~/.zshrc # reload .zshrc

set Iterm2

profile
Think about a better architecture

1개의 댓글

comment-user-thumbnail
2024년 7월 5일

The macOS ecosystem offers a wealth of applications, and one standout for power users is commander one. This versatile file manager streamlines workflow with its dual-pane interface, providing a robust alternative to the Finder. Commander One excels in handling multiple file types and integrates seamlessly with cloud services, making it a go-to tool for efficient file management. Whether you're a developer managing large codebases or a creative professional organizing multimedia projects, Commander One’s flexibility and feature set make it an indispensable asset for maximizing productivity on a Mac.

답글 달기