[Mac] Powerline 세팅하기

pip3 install powerline-status

일단 시작은 이렇게 ㅎ

 

그리고 나서
https://github.com/powerline/fonts

 

GitHub - powerline/fonts: Patched fonts for Powerline users.

Patched fonts for Powerline users. Contribute to powerline/fonts development by creating an account on GitHub.

github.com

이 짝을 통해서 온갖 powerline을 지원하는 폰트를 설치해주고 (install.sh를 활용하자)

 

pip3 show powerline-status

욤마를 통해 알게 된 python 경로를 얻은 뒤

.bash_profile 파일 안에 아래처럼 꾸겨 넣어보자

# Powerline
export PATH=$PATH:$HOME/Library/Python/3.6/bin
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /Users/yourUserName/Library/Python/3.6/lib/python/site-packages/powerline/bindings/bash/powerline.sh

(각자 python 경로 다름 주의)

 

아 그리고 나만의 theme를 위해 default config 파일들을 끌어와 오버라이딩 하자스라

$ mkdir ~/.config/powerline
$ cp -r /usr/local/lib/python3.6/site-packages/powerline/config_files/ ~/.config/powerline/

(요기도 각자 python 경로 다름 주의)

~/.config/powerline/ 안에 있는 config 파일들이 이제 나만의 theme 되시겠다

 

vim에도 powerline을 적용하고 싶다면 .vimrc에도 코드를 넣어주어야 한다
(없으면 ~/ 에 맹글도록 하자)

" powerline
set rtp+=/usr/local/lib/python3.6/site-packages/powerline/bindings/vim
set laststatus=2
set t_Co=256

 

다음 powerline-gitstatus 차례

아무래도 요놈이 GIT의 상태를 더 잘 보여준다 ㅎㅎ
냅다리 pip로 설치하자

pip3 install --user powerline-gitstatus

 

그 다음 오버라이딩한 나만의 config 파일에 코드를 넣어주자

{
  "groups": {
  	....(기존 꺼 두고)...
    "gitstatus":                 { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch":          { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_clean":    { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_dirty":    { "fg": "gray8",           "bg": "gray2", "attrs": [] },
    "gitstatus_branch_detached": { "fg": "mediumpurple",    "bg": "gray2", "attrs": [] },
    "gitstatus_tag":             { "fg": "darkcyan",        "bg": "gray2", "attrs": [] },
    "gitstatus_behind":          { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_ahead":           { "fg": "gray10",          "bg": "gray2", "attrs": [] },
    "gitstatus_staged":          { "fg": "green",           "bg": "gray2", "attrs": [] },
    "gitstatus_unmerged":        { "fg": "brightred",       "bg": "gray2", "attrs": [] },
    "gitstatus_changed":         { "fg": "mediumorange",    "bg": "gray2", "attrs": [] },
    "gitstatus_untracked":       { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
    "gitstatus_stashed":         { "fg": "darkblue",        "bg": "gray2", "attrs": [] },
    "gitstatus:divider":         { "fg": "gray8",           "bg": "gray2", "attrs": [] }
  }
}

( .config/powerline/colorschemes/default.json 에 groups 안에 추가하도록 하자 )

....(기존꺼 두고)....
{
    "function": "powerline_gitstatus.gitstatus",
    "priority": 40
}
....(기존꺼 두고)....

( .config/powerline/themes/shell/default.json 에 한 쪽에 추가하다 -> 대충 보면 뭔 이야기인지 안다. 넣고 싶은 side에 넣자 )

 

 

그 다음에 주의 ㅋㅋ

바로 iterm이나 shell을 껏켰한다고 해서 달라지는 것이 없을 것이다

source ./.bash_profile (또는 ./.bashrc)

하고 나서

powerline-daemon --replace

요놈을 해줘야 껏켯하지 않아도 반영/재실행 된다 ㅎㅎ

 

 

이뿌다잉

이제 시간도 넣고 배터리도 넣고 개인적인 theme을 꾸려보자 ㅎㅎ