ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๋ฐ˜์‘ํ˜•

โœ… iTerm2 ์„ค์น˜

๋งฅ์˜ ๊ธฐ๋ณธ ํ„ฐ๋ฏธ๋„์ด ์žˆ์ง€๋งŒ ๊ธฐ๋ณธํ„ฐ๋ฏธ๋„ ๋ณด๋‹ค ๋” ๋‹ค์–‘ํ•œ ํ”Œ๋กœ๊ทธ์ธ๊ณผ ํ…Œ๋งˆ๋“ฑ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

Download๋ฅผ ๋ˆŒ๋Ÿฌ ์„ค์น˜ํ•ด์ฃผ์„ธ์š”!!

 

iTerm2 - macOS Terminal Replacement

iTerm2 by George Nachman. Website by Matthew Freeman, George Nachman, and James A. Rosen. Website updated and optimized by HexBrain

iterm2.com

iTerm2 ํ…Œ๋งˆ ์„ค์น˜

iTerm ํ…Œ๋งˆ ๋‹ค์šด๋กœ๋“œ

์••์ถ•์„ ํ•ด์ œ ํ•ด์ฃผ์‹œ๊ณ  ์ด์ „์— ์„ค์น˜ํ–ˆ๋˜ iTerm2 ์‹คํ–‰

iTerm2 > Preferences > Profiles (ํƒญ) > Colors (ํƒญ) ๊นŒ์ง€ ์ด๋™ > Color Presets > import...

์••์ถ• ํ’€์—ˆ๋˜ ๋””๋ ‰ํ† ๋ฆฌ์— schemes์— ์žˆ๋Š” ๋ชจ๋“  ํŒŒ์ผ ์„ ํƒํ•˜์—ฌ import... ๋ฅผ ํ•ด์ค๋‹ˆ๋‹ค importํ•˜๋Š”๋ฐ ์กฐ๊ธˆ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆฝ๋‹ˆ๋‹ค.

import๊ฐ€ ๋๋‚ฌ๊ณ 

iTerm2 > Preferences > Profiles (ํƒญ) > Colors (ํƒญ) ๊นŒ์ง€ ์ด๋™ > Color Presets

์ด ๊ฒฝ๋กœ๋กœ ๊ฐ„๋‹ค๋ฉด ์—ฌ๋Ÿฌ๊ฐ€์ง€ ํ…Œ๋งˆ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์‹ ์ด ์›ํ•˜๋Š” ํ…Œ๋งˆ๋ฅผ ์„ ํƒํ•ด์„œ ์‚ฌ์šฉํ•ด ์ฃผ์„ธ์š”!! (MatrialDark)

brew ์„ค์น˜

๋งฅ์šฉ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ ํ”„๋กœ๊ทธ๋žจ brew ์„ค์น˜

https://brew.sh

 

Homebrew

The Missing Package Manager for macOS (or Linux).

brew.sh

์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜์—ฌ ์„ค์น˜ ๋ช…๋ น์–ด๋ฅผ ๋ณต์‚ฌํ•˜๊ฑฐ๋‚˜ ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ๋ณต์‚ฌํ•ด์„œ iTerm2์— ๋ถ™์—ฌ๋„ฃ์–ด ์„ค์น˜ํ•ด์ฃผ์„ธ์š”

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

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋œ ์ดํ›„ iTerm2์—์„œ brew -v ์„ ์ž…๋ ฅํ•ด์„œ ์—”ํ„ฐ๋ฅผ ์น˜๋ฉด zsh: command not found: brew ๋ผ๊ณ  ๋‚˜์˜จ๋‹ค

๋งฅ๋ถm1์˜ ๊ฒฝ๋กœ๊ฐ€ ๋ฐ”๋€Œ์–ด์„œ ๊ทธ๋ ‡๋‹ค

# ์•„๋ž˜์™€ ๊ฐ™์ด ์…‹ํŒ…
$echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/{๊ณ„์ •๋ช…}/.zprofile
$eval "$(/opt/homebrew/bin/brew shellenv)"

$/opt/homebrew/bin/brew -v
$brew -v
#์šฐ์„  ์œ„์™€ ๊ฐ™์ด ํ™•์ธํ•ด์ฃผ์ž

zsh ์„ค์น˜

ํ„ฐ๋ฏธ๋„ shell ํ™˜๊ฒฝ์˜ ์‚ฌ์šฉ์„ฑ์„ ํฌ๊ฒŒ ๊ฐœ์„ ํ•ด์ฃผ๋Š” zsh ์„ค์น˜

# zsh ์„ค์น˜
brew install zsh

# zsh ์„ค์น˜๊ฒฝ๋กœ ํ™•์ธํ•˜๊ธฐ
which zsh

# ๊ธฐ๋ณธ shell ๋ณ€๊ฒฝํ•˜๊ธฐ
chsh -s $(which zsh)

Oh my ZSH ์„ค์น˜

zsh๋ฅผ ๋”์šฑ ํŽธํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋„๋ก ๋„์™€์ฃผ๋Š” oh-my-zsh ์„ค์น˜

$sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

.zshrc ์„ค์ •

brew ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์ถ”๊ฐ€

vi ~/.zshrc

#๊ฐ€์žฅ ํ•˜๋‹จ์— ์ถ”๊ฐ€
#brew ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถ”๊ฐ€
eval $(/opt/homebrew/bin/brew shellenv)

source ~/.zshrc

zsh_theme ๋ณ€๊ฒฝ

๊ธฐ๋ณธ ํ…Œ๋งˆ agnoster๋กœ ๋ณ€๊ฒฝ

vi ~/.zshrc

#์ฐพ๊ธฐ
#ZSH_THEME="robyrussell" #๊ธฐ์กด
ZSH_THEME="agnoster" #๋ณ€๊ฒฝ

#๊ฐ€์žฅ ํ•˜๋‹จ์— ๋„ฃ์–ด์ฃผ๊ธฐ ์‰˜์— ์ด๋ฆ„ ์˜† macbook๋‹‰๋„ค์ž„ ์—†์–ด์ง
prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
  fi
}

source ~/.zshrc

zsh plugin ์ ์šฉํ•˜๊ธฐ

#์„ค์น˜
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# .zshrc ์—์„œ ํ”Œ๋กœ๊ธด ์ถ”๊ฐ€ํ•˜๊ธฐ
vi ./.zshrc

#์ถ”๊ฐ€
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

#.zshrc์—์„œ ๋‚˜์˜จ ์ดํ›„์— source๋กœ ์ ์šฉ
source ~/.zshrc

Syntax Hightlight ์ ์šฉํ•˜๊ธฐ

Syntax Hightlight๊ธฐ๋Šฅ์„ ์ ์šฉํ•˜๋ฉด ์‹คํ–‰ํ• ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น์–ด๋Š” ์ดˆ๋ก์ƒ‰์œผ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

#zsh-syntax-highlighting ์„ค์น˜
$brew install zsh-syntax-highlighting

vi ~/.zshrc
#์ œ์ผ ํ•˜๋‹จ์— ์ถ”๊ฐ€
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

source ~/.zshrc

vim ์„ค์น˜

$brew install vim

vim ํ…Œ๋งˆ ์ ์šฉํ•˜๊ธฐ

ํ…Œ๋งˆ colors ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ

mkdir ~/.vim
mkdir ~/.vim/colors

ํ…Œ๋งˆ ๋‹ค์šด๋ฐ›๊ธฐ

์•„๋ž˜ ์‚ฌ์ดํŠธ์—์„œ ์›ํ•˜๋Š” ํ…Œ๋งˆ๋ฅผ ๋‹ค์šด ๋ฐ›์œผ์„ธ์š”

https://www.slant.co/topics/480/~best-vim-color-schemes

์ €๋Š” https://github.com/danilo-augusto/vim-afterglow ์ด ํ…Œ๋งˆ๊ฐ€ ๋งˆ์Œ์— ๋“ค์–ด์„œ ์ด๊ฑธ๋กœ ์„ค๋ช… ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

code/download zip ํ•˜์‹œ๊ณ  ์••์ถ•์„ ํ‘ธ์„ธ์š” colors ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ๋Š” afterglow.vim ํŒŒ์ผ์„

~/.vim/colors/ ๋””๋ ‰ํ† ๋ฆฌ์— ์˜ฎ๊ฒจ์ฃผ์„ธ์š”

.vimrc ๋งŒ๋“ค๊ธฐ or ์ˆ˜์ •

#ํŒŒ์ผ์ด ์—†์œผ๋ฉด ๋งŒ๋“ค๋ฉด ๋˜๊ณ  ์žˆ์œผ๋ฉด ์ˆ˜์ •ํ•˜์„ธ์š”
$vi ~/.vimrc

" Syntax Highlighting
if has("syntax")
        syntax on
endif

set hlsearch
set autoindent
set cindent
"set nu
set shiftwidth=4
set showmatch
set backspace=indent,eol,start

colo afterglow
let g:airline_theme='afterglow'

set laststatus=2
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\

์œ„์™€ ๊ฐ™์ด ๋„ฃ์œผ์‹œ๊ณ  iterm์ข…๋ฃŒ ํ›„ ๋‹ค์‹œ vi๋กœ ํ™•์ธ์„ ํ•ด๋ณด์‹œ๋ฉด ํ…Œ๋งˆ๊ฐ€ ์ ์šฉ๋œ ๋ชจ์Šต์„ ๋ณผ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

.vimrc ์˜ต์…˜ ์ฐธ๊ณ 

set hlsearch " ๊ฒ€์ƒ‰์–ด ํ•˜์ด๋ผ์ดํŒ…
set nu " ์ค„๋ฒˆํ˜ธ
set autoindent " ์ž๋™ ๋“ค์—ฌ์“ฐ๊ธฐ
set scrolloff=2
set wildmode=longest,list
set ts=4 "tag select
set sts=4 "st select
set sw=1 " ์Šคํฌ๋กค๋ฐ” ๋„ˆ๋น„
set autowrite " ๋‹ค๋ฅธ ํŒŒ์ผ๋กœ ๋„˜์–ด๊ฐˆ ๋•Œ ์ž๋™ ์ €์žฅ
set autoread " ์ž‘์—… ์ค‘์ธ ํŒŒ์ผ ์™ธ๋ถ€์—์„œ ๋ณ€๊ฒฝ๋ฌ์„ ๊ฒฝ์šฐ ์ž๋™์œผ๋กœ ๋ถˆ๋Ÿฌ์˜ด
set cindent " C์–ธ์–ด ์ž๋™ ๋“ค์—ฌ์“ฐ๊ธฐ
set bs=eol,start,indent
set history=256
set laststatus=2 " ์ƒํƒœ๋ฐ” ํ‘œ์‹œ ํ•ญ์ƒ
"set paste " ๋ถ™์—ฌ๋„ฃ๊ธฐ ๊ณ„๋‹จํ˜„์ƒ ์—†์• ๊ธฐ
set shiftwidth=4 " ์ž๋™ ๋“ค์—ฌ์“ฐ๊ธฐ ๋„ˆ๋น„ ์„ค์ •
set showmatch " ์ผ์น˜ํ•˜๋Š” ๊ด„ํ˜ธ ํ•˜์ด๋ผ์ดํŒ…
set smartcase " ๊ฒ€์ƒ‰์‹œ ๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ณ„
set smarttab
set smartindent
set softtabstop=4
set tabstop=4
set ruler " ํ˜„์žฌ ์ปค์„œ ์œ„์น˜ ํ‘œ์‹œ
set incsearch
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
" ๋งˆ์ง€๋ง‰์œผ๋กœ ์ˆ˜์ •๋œ ๊ณณ์— ์ปค์„œ๋ฅผ ์œ„์น˜ํ•จ
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "norm g`\"" |
\ endif
" ํŒŒ์ผ ์ธ์ฝ”๋”ฉ์„ ํ•œ๊ตญ์–ด๋กœ
if $LANG[0]=='k' && $LANG[1]=='o'
set fileencoding=korea
endif
" ๊ตฌ๋ฌธ ๊ฐ•์กฐ ์‚ฌ์šฉ
if has("syntax")
 syntax on
endif
" ์ปฌ๋Ÿฌ ์Šคํ‚ด ์‚ฌ์šฉ
colorscheme jellybeans
์ฐธ๊ณ 
ํ—ค๋ฆฌ์˜ ์œ ๋ชฉ์ฝ”๋”ฉ
์„ ํ˜‘์ด๊ฐ€ ์“ด ๊ธ€๋“ค
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
๊ธ€ ๋ณด๊ด€ํ•จ
๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (80)
๐Ÿ“บ Develop (0)
๐ŸŒ‹ Error Fixed (5)
๐Ÿ— Tool (5)
๐Ÿ’ป MacBook M1 (15)
๐Ÿ“ฆ ETC (1)

์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค.