安装
pip install powerline-status
pip show powerline-status//查看安装位置
mac 修改~/.bash_profile
最后添加一行
. /.../powerline/bindings/bash/powerline.sh
若字体有问题,则安装字体 https://github.com/powerline/fonts
配置
vim ~/.config/powerline/config.json
主题
- 修改后能看到git状态
 
{
    "ext": {
        "shell": {
            "theme": "default_leftonly"
        }
    }
}
修改config_files
在想要使用的主题文件中可以增加一些内容
vim /.../powerline/config_files/themes/shell/__main__.json
shell相关的配置可以参考 https://powerline.readthedocs.io/en/latest/configuration/segments/shell.html
{
	"segment_data": {
		"hostname": {
			"args": {
				"only_if_ssh": true
			}
		},
		"cwd": {
			"args": {
				"dir_limit_depth": 2,
				"dir_shorten_len": 10
			}
		}
	}
}
dir_shorten_len (int) – shorten parent directory names to this length (e.g. /long/path/to/powerline → /l/p/t/powerline) dir_limit_depth (int) – limit directory depth to this number (e.g. /long/path/to/powerline → ⋯/to/powerline)