On Mon, Jun 15, 2009 at 8:14 PM, <[email protected]> wrote:
> Hi,
>
> is it possible to have two different formatted statuslines simultaneously
> visible for two different files?
> And -- if yes -- how?
> Thank you very much for any help in advance!
> mcc
I do use a different status lines for the current window being
edited and the other windows. Perhaps you may find it useful.
Here is a snippet from my ~/.vimrc file:
if has('statusline')
if version >= 700
" Fancy status line.
set statusline =
set statusline+=%#User1# " highlighting
set statusline+=%-2.2n\ " buffer number
set statusline+=%#User2# " highlighting
set statusline+=%f\ " file name
set statusline+=%#User1# " highlighting
set statusline+=%h%m%r%w\ " flags
set statusline+=%{(&key==\"\"?\"\":\"encr,\")} " encrypted?
set statusline+=%{strlen(&ft)?&ft:'none'}, " file type
set statusline+=%{(&fenc==\"\"?&enc:&fenc)}, " encoding
set statusline+=%{((exists(\"+bomb\")\ &&\ &bomb)?\"B,\":\"\")} " BOM
set statusline+=%{&fileformat}, " file format
set statusline+=%{&spelllang}, " spell language
set statusline+=%{SyntaxItem()} " syntax group under cursor
set statusline+=%= " indent right
set statusline+=%#User2# " highlighting
set statusline+=%{ShowUtf8Sequence()}\ " utf-8 sequence
set statusline+=%#User1# " highlighting
set statusline+=0x%B\ " char under cursor
set statusline+=%-6.(%l,%c%V%)\ %<%P " position
" Use different colors for statusline in current and non-current window.
let g:Active_statusline=&g:statusline
let g:NCstatusline=substitute(
\ substitute(g:Active_statusline,
\ 'User1', 'User3', 'g'),
\ 'User2', 'User4', 'g')
au WinEnter * let&l:statusline = g:Active_statusline
au WinLeave * let&l:statusline = g:NCstatusline
endif
endif
...
" My ~/.vimrc uses User1 and User2 in active statusline.
hi User1 guifg=#66ff66 guibg=#008000 gui=bold term=standout cterm=bold
ctermfg=lightgreen ctermbg=lghtgreen
hi User2 guifg=#ffff60 guibg=#008000 gui=bold term=none cterm=bold
ctermfg=yellow ctermbg=lightgreen
" My ~/.vimrc uses User3 and User4 in non-active statusline.
hi User3 guifg=#66ff66 guibg=#008000 gui=bold term=standout cterm=bold
ctermfg=lightgreen ctermbg=lightgreen
hi User4 guifg=#66ff66 guibg=#008000 gui=bold term=none cterm=bold
ctermfg=lightgreen ctermbg=lightgreen
-- Dominique
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---