因为服务器没有管理员权限,装不了zsh,只能在conda里面装一个powerline用
注意,conda里面不要使用conda安装,要使用pip安装,这样所有环境下都可以享用
powerline安装和基本配置教程:
Powerline:给 Vim 和 Bash 提供更棒的状态行和提示信息
有时候想要在命令行输出时间,好让自己知道这个命令是什么时候跑的,搜了一下powerline show time相关的资料,没有具体教程,因此看了一下官方的文档后,解决方法如下:
直接修改
~/anaconda2/lib/python2.7/site-packages/powerline/config_files/themes/shell/default.json
default.json:
{
"segments": {
"left": [
{
"function": "powerline.segments.shell.mode"
},
{
"function": "powerline.segments.common.net.hostname",
"priority": 10
},
{
"function": "powerline.segments.common.env.user",
"priority": 30
},
{
"function": "powerline.segments.common.env.virtualenv",
"priority": 50
},
{
"function": "powerline.segments.shell.cwd",
"priority": 10
},
{
"function": "powerline.segments.shell.jobnum",
"priority": 20
}
],
"right": [
{
"function": "powerline.segments.shell.last_pipe_status",
"priority": 10
},
{
"function": "powerline.segments.common.vcs.stash",
"priority": 50
},
{
"function": "powerline.segments.common.vcs.branch",
"priority": 40
}
]
}
}
里面的字段看英文都能了解,如果需要增加时间的话,根据官方文档
在里面增加
{
"function": "powerline.segments.common.time.date",
"args": {"format":"%m-%d-%X"},
"priority": 10
},
即可。
其中format就是python datetime里使用的format,可以根据需要自行定制。
修改前:
修改后: