如何截断vim-powerline状态行中的长文件路径?

时间:2012-10-31 19:11:15

标签: vim vim-plugin statusline vim-powerline

我想将文件路径截断为ex:a/a/j/c/popularCategories.js

my powerline status

2 个答案:

答案 0 :(得分:3)

有两种选择。

尝试此选项:

    let g:Powerline_stl_path_style = 'short'

来自powerline docs:

short      Display a short path. The home directory is substituted with
           "~", the first directory is displayed with its full name, and
           subsequent directories are shortened to their first letter.
           I.e. "/home/user/foo/bar/baz.vim" becomes "~/f/b/baz.vim" and
           "long/relative/path/foo/bar/baz.vim becomes
           "long/r/p/f/b/baz.vim".

或者,如果您希望将路径截断为Vim的默认状态行,则可以创建moves the truncation point的主题。试试我的sanity theme,看看它是否适合您。

答案 1 :(得分:0)

目前无法做到这一点。我以某种方式错过了这个选项。更改powerline截断路径的方式存在问题:issue 215,而不是像我以前想的那样添加截断。