How to truncate long file path in vim-powerline statusline?
-
24-07-2021 - |
質問
I would like to truncate my file path to ex: a/a/j/c/popularCategories.js
.
解決
There are two options.
Try this option:
let g:Powerline_stl_path_style = 'short'
From the 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".
Or, if you want the path truncated like Vim's default statusline, then you can create a theme that moves the truncation point. Try my sanity theme and see if it works better for you.
他のヒント
There is currently no way to do this. I’ve missed this option somehow. There is an issue for changing the way powerline truncates path: issue 215, not to add truncation like I used to think.
所属していません StackOverflow