Centos7 의 Bash에 Powerline 추가하기(with vim)

저는 현재 서버 업체에 재직중으로 서버 접근 및 작업시 순정(?) Shell인 bash로만 작업을 하고 있습니다. 또 VSCode 및 SecureCRT에서 이용하는 폰트는 D2Coding을 이용중이기도 합니다. 저는 개발보다는 시스템에 대한 작업이 많다보니 Powerline에 대한 존재를 모르고 있었습니다. 얼마 전 D2Coding의 버전을 업로드하니 Powerline을 지원한다고 나와있었습니다. 이에 찾아보니 Bash에서도 Powerline을 이용할 수 있다고 해서 다음과 같은 작업으로 설정했습니다.

기본적으로 설치하는 패키지

yum install epel-release -y
yum install wget sysstat lrzsz lsof bzip2 unzip iftop -y

설정에 필요한 패키지

yum install python python-pip git fontconfig
pip install --upgrade pip

Powerline 설치 및 폰트 적용

pip install git+git://github.com/Lokaltog/powerline
wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf 
wget https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf

mv PowerlineSymbols.otf /usr/share/fonts/
mv 10-powerline-symbols.conf /etc/fonts/conf.d/
fc-cache -vf /usr/share/fonts/

Bash 컬러 설정 및 적용

vi ~/.bashrc
export TERM="screen-256color"

pip show powerline-status
Name: powerline-status
Version: 2.6.dev9999-git.6257332372bf9f64d928b6a3b53d2842d9c7e01f
Summary: The ultimate statusline/prompt utility.
Home-page: https://github.com/powerline/powerline
Author: Kim Silkebaekken
Author-email: kim.silkebaekken+vim@gmail.com
License: MIT
Location: /usr/lib/python2.7/site-packages
Requires: 
Required-by: 

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh

로그인시 자동 적용

vi ~/.bashrc

if [ -f /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
        source /usr/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi

vim 적용

vi ~/.vimrc

set rtp+=/usr/lib/python2.7/site-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256

해당 적용을 통해 다음과 같이 잘 보여지게 됩니다. Bash 적용시

vim 적용시