Created
April 16, 2016 14:10
-
-
Save KentaYamada/6fbdb4fa6f840a82849732c3081e8390 to your computer and use it in GitHub Desktop.
Vimのステータスバーにファイル情報を表示する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vimの改行コード表示がちと変わっているので、 | |
" 一般的な改行コードに変換してステータスバーに表示するようにカスタマイズ | |
" 改行コード対応表 | |
" CRLF: dos | |
" CR: unix | |
" LF: mac | |
set statusline = 2 "ステータスバーの表示行数を設定 | |
let dic_line = { 'dos': 'CRLF', 'unix': 'CR', 'mac': 'LF'} | |
let f = &fileformat " 改行コード取得 | |
let s = '' | |
if has_key(dic_line, f) | |
let s = dic_line[f] | |
else | |
let s = 'unkwown' | |
endif | |
set statusline=%t\ %m%r%h%w[%Y][%{&fenc}][%{s}]%=%c,%l%11p%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment