On 2012-03-18, Gautier DI FOLCO wrote:
> Le 18 mars 2012 08:05, Xell Liu a  crit :
> 
>     IMHO you could use autocmd instead of &modified. Please check :h 
>     autocmd-events-abc for what you need.
> 
>  
> Hi,
> 
> Thank you for your answer but I found two problems with this method :
>  * There is no autocommand event on modified
>  * There is no way to set only the SL of one buffer

Yes there is.  You can set 'statusline' to a string that includes a
function call and have that function return a window-local or
buffer-local variable.

For example:

    let &statusline='%<%f %(%h%m%r %)%=%{TagName()}'

    function! TagName()
        if exists('w:tag_name')
            return w:tag_name
        else
            return ''
        endif
    endfunction

This technique is used in the ctags.vim plugin,
http://vim.sourceforge.net/scripts/script.php?script_id=610

If you need the statusline to show the value of &modified, just
include that value in the string returned by the function.  Vim
updates the statusline at least every time the cursor moves.

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to