Luc Hermitte (talk | contribs) m (Added to Encoding category) |
(Move categories to tip template) |
||
Line 8: | Line 8: | ||
|version=5.7 |
|version=5.7 |
||
|rating=15/6 |
|rating=15/6 |
||
+ | |category1=Encoding |
||
+ | |category2= |
||
}} |
}} |
||
The (long) line below comes from my vimrc. It adds, at the left of the right-hand part of the status line, a pair of square brackets containing the value of 'fileencoding' for the file you are editing (or that of 'encoding' if 'fileencoding' is empty). The file's encoding is followed by a comma and B if 'bomb' is functional and has the value 1 (TRUE). |
The (long) line below comes from my vimrc. It adds, at the left of the right-hand part of the status line, a pair of square brackets containing the value of 'fileencoding' for the file you are editing (or that of 'encoding' if 'fileencoding' is empty). The file's encoding is followed by a comma and B if 'bomb' is functional and has the value 1 (TRUE). |
||
Line 30: | Line 32: | ||
---- |
---- |
||
− | [[Category:Encoding]] |
Revision as of 04:17, 25 April 2008
Tip 735 Printable Monobook Previous Next
created May 28, 2004 · complexity basic · author Tony Mechelynck · version 5.7
The (long) line below comes from my vimrc. It adds, at the left of the right-hand part of the status line, a pair of square brackets containing the value of 'fileencoding' for the file you are editing (or that of 'encoding' if 'fileencoding' is empty). The file's encoding is followed by a comma and B if 'bomb' is functional and has the value 1 (TRUE).
Examples are [latin1], [iso-8859-15], [utf-8,B], etc.
The complexity of the value is due in large part to the necessity of (a) specifying explicitly the fields used implicitly when 'statusline' is empty (I hope I didn't forget any of them), and (b) backslash-escaping all spaces and quotation marks.
Now here it is:
if has("statusline") set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P endif