Vim Tips Wiki
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 26: Line 26:
   
 
fu! FileEncoding()
 
fu! FileEncoding()
if &fileencoding == ''
+
if &fileencoding == ''
 
return "is not set"
 
return "is not set"
 
else
 
else
return &fenc
+
return &fenc
 
endif
 
endif
 
endf
 
endf
   
 
fu! GlobalEncoding()
 
fu! GlobalEncoding()
if &fileencoding == ''
+
if &fileencoding == ''
 
return "is not set"
 
return "is not set"
 
else
 
else
return &enc
+
return &enc
 
endif
 
endif
 
endf
 
endf
Line 49: Line 49:
   
 
"And we map switching on some unused key.
 
"And we map switching on some unused key.
map <F3> :call ToggleStatusLine()<CR>
+
map &lt;F3&gt; :call ToggleStatusLine()&lt;CR&gt;
   
 
"Function that switch between several statuslines
 
"Function that switch between several statuslines
Line 57: Line 57:
 
let g:StatusLinesCurrent=0
 
let g:StatusLinesCurrent=0
 
endif
 
endif
let &statusline=g:StatusLines{g:StatusLinesCurrent}
+
let &amp;statusline=g:StatusLines{g:StatusLinesCurrent}
 
endf
 
endf
   
Line 92: Line 92:
   
 
<pre>
 
<pre>
let g:StatusLines{0}='%5* %*->%7*[%*%1*%n%*%7*]%* %= %7*[%*%2*%03bD%* %7*|%* %2*%5(0x%02BH%)%*%7*]%* %7*[%*%3*%8oC%*%7*=%*%1*%3{Percent()}%%%*%7*]%* %7*[%*%4*%8c%*%7*]%*
+
let g:StatusLines{0}='%5* %*-&gt;%7*[%*%1*%n%*%7*]%* %= %7*[%*%2*%03bD%* %7*|%* %2*%5(0x%02BH%)%*%7*]%* %7*[%*%3*%8oC%*%7*=%*%1*%3{Percent()}%%%*%7*]%* %7*[%*%4*%8c%*%7*]%*
let g:StatusLines{1}='%5* %*->%7*[%*%1*%n%*%7*]%* %= %7*[%*%1*ENC%* %2*%10{strlen(&enc)?&enc:"is not set"}%*%7*]%* %7*[%*%1*FENC%* %3*%10{strlen(&fenc)?&fenc:"is not set"
+
let g:StatusLines{1}='%5* %*-&gt;%7*[%*%1*%n%*%7*]%* %= %7*[%*%1*ENC%* %2*%10{strlen(&amp;enc)?&amp;enc:"is not set"}%*%7*]%* %7*[%*%1*FENC%* %3*%10{strlen(&amp;fenc)?&amp;fenc:"is not set"
let g:StatusLines{2}='%5* %*->%7*[%*%1*%n%*%7*]%* %= %7*[%*%1*FILE%* %*%2*%t%*%7*]%*'
+
let g:StatusLines{2}='%5* %*-&gt;%7*[%*%1*%n%*%7*]%* %= %7*[%*%1*FILE%* %*%2*%t%*%7*]%*'
 
let g:StatusLinesCurrent=-1
 
let g:StatusLinesCurrent=-1
   
Line 115: Line 115:
 
let g:StatusLinesCurrent=0
 
let g:StatusLinesCurrent=0
 
endif
 
endif
let &statusline=g:StatusLines{g:StatusLinesCurrent}
+
let &amp;statusline=g:StatusLines{g:StatusLinesCurrent}
 
endf
 
endf
 
</pre>
 
</pre>
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)