On 15/07/09 13:02, Matt Wozniski wrote:
>
> On Wed, Jul 15, 2009 at 4:19 AM, TheLonelyStar wrote:
>>
>>
>> Hi,
>>
>> I have some startup function, which dis- or enables "expandtab" depending on
>> some scan of the file.
>> I know I can change the statusbar by setting "statusbar".
>> Can I somehow show "tab" is expandtab is disabled or "space" if expandtab is
>> enabled in the statusbar?
>
> Something like
>
>      :set statusline+=[%{&expandtab?'space':'tab'}]
>
> should do the trick.
>
> ~Matt

This, however, will remove everything else (filename, line number, ...) 
on the status line.

I would recommend setting your own custom status line (there is an 
example under ":help 'statusline'" and adding something similar to the 
above as part of it. Here is a somewhat fancier example:

if has("statusline")
        set statusline=%<%f\ 
%h%m%r%{&et?((&shm?'[et]':',EXPANDTAB'):\"\")}%=%k\ %-12.(%l,%c%V%)\ %P
endif

This is one ong line between two short ones. Read the help for 
'statusline' and have fun!

An alternate possibility would be to use the 'list' and 'listchars' 
options to show you where there are spaces and where there are hard 
tabs. Here's what I use:

set list listchars=eol:¶,tab:\|_
silent! set listchars+=nbsp:~

This shows the tabs as | and _ , the end-of-line as ¶ , no-break spaces 
as tildes (all of that usually in blue).



Best regards,
Tony.
-- 
You have acquired a scroll entitled 'irk gleknow mizk'(n).--More--

This is an IBM Manual scroll.--More--

You are permanently confused.
                -- Dave Decot

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to