[wish] different statusline format for noncurrent statusline

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[wish] different statusline format for noncurrent statusline

iler.ml
We have separae highlighting,  StatusLineNC, for non-current.
I wish I had different *format*, too,  for noncurrent statusline. I do not
think differnt format for non-current statusline is supported.
Is it possible to put this request in todo. Thanks.

Yakov


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

Reply | Threaded
Open this post in threaded view
|

Re: [wish] different statusline format for noncurrent statusline

Bram Moolenaar


Yakov Lerner wrote:

> We have separae highlighting,  StatusLineNC, for non-current.
> I wish I had different *format*, too,  for noncurrent statusline. I do
> not think differnt format for non-current statusline is supported.  Is
> it possible to put this request in todo. Thanks.

I'll add it in the todo list.  Don't expect this soon though.  Still in
bug fixing mode...

--
hundred-and-one symptoms of being an internet addict:
222. You send more than 20 personal e-mails a day.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Reply | Threaded
Open this post in threaded view
|

Re: [wish] different statusline format for noncurrent statusline

Matt Wozniski-2

On Tue, Mar 17, 2009 at 4:19 PM, Bram Moolenaar <[hidden email]> wrote:

>
>
> Yakov Lerner wrote:
>
>> We have separae highlighting,  StatusLineNC, for non-current.
>> I wish I had different *format*, too,  for noncurrent statusline. I do
>> not think differnt format for non-current statusline is supported.  Is
>> it possible to put this request in todo. Thanks.
>
> I'll add it in the todo list.  Don't expect this soon though.  Still in
> bug fixing mode...

Perhaps an 'actual_curwin' like 'actual_curbuf'?

~Matt

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

Reply | Threaded
Open this post in threaded view
|

Fwd: [wish] different statusline format for noncurrent statusline

iler.ml
In reply to this post by iler.ml

On Tue, Mar 17, 2009 at 12:41, Yakov Lerner <[hidden email]> wrote:
> We have separae highlighting,  StatusLineNC, for non-current.
> I wish I had different *format*, too,  for noncurrent statusline. I do not
> think differnt format for non-current statusline is supported.
> Is it possible to put this request in todo. Thanks.

Found how to make it in current vim.
Sorry for the noise.  Took me time to figure it, works fine.

let &statusline="Your favourite statusline"
let  g:Active_statusline=&g:statusline
let g:NCstatusline = "%<%F"    " non-current statusline
au WinEnter * let &l:statusline = g:Active_statusline
au WinLeave * let &l:statusline = g:NCstatusline

Yakov

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

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [wish] different statusline format for noncurrent statusline

Tony Mechelynck

On 19/03/09 13:08, Yakov Lerner wrote:

>
> On Tue, Mar 17, 2009 at 12:41, Yakov Lerner<[hidden email]>  wrote:
>> We have separae highlighting,  StatusLineNC, for non-current.
>> I wish I had different *format*, too,  for noncurrent statusline. I do not
>> think differnt format for non-current statusline is supported.
>> Is it possible to put this request in todo. Thanks.
>
> Found how to make it in current vim.
> Sorry for the noise.  Took me time to figure it, works fine.
>
> let&statusline="Your favourite statusline"
> let  g:Active_statusline=&g:statusline
> let g:NCstatusline = "%<%F"    " non-current statusline
> au WinEnter * let&l:statusline = g:Active_statusline
> au WinLeave * let&l:statusline = g:NCstatusline
>
> Yakov

Wow! Hadn't realized it was global-local. :thumbsup:

Best regards,
Tony.
--
"Terence, this is stupid stuff:
You eat your victuals fast enough;
There can't be much amiss, 'tis clear,
To see the rate you drink your beer.
But oh, good Lord, the verse you make,
It gives a chap the belly-ache.
The cow, the old cow, she is dead;
It sleeps well the horned head:
We poor lads, 'tis our turn now
To hear such tunes as killed the cow.
Pretty friendship 'tis to rhyme
Your friends to death before their time.
Moping, melancholy mad:
Come, pipe a tune to dance to, lad."
                -- A. E. Housman

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

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [wish] different statusline format for noncurrent statusline

Dominique Pellé

Tony Mechelynck wrote:

> On 19/03/09 13:08, Yakov Lerner wrote:
>>
>> On Tue, Mar 17, 2009 at 12:41, Yakov Lerner<[hidden email]>  wrote:
>>> We have separae highlighting,  StatusLineNC, for non-current.
>>> I wish I had different *format*, too,  for noncurrent statusline. I do not
>>> think differnt format for non-current statusline is supported.
>>> Is it possible to put this request in todo. Thanks.
>>
>> Found how to make it in current vim.
>> Sorry for the noise.  Took me time to figure it, works fine.
>>
>> let&statusline="Your favourite statusline"
>> let  g:Active_statusline=&g:statusline
>> let g:NCstatusline = "%<%F"    " non-current statusline
>> au WinEnter * let&l:statusline = g:Active_statusline
>> au WinLeave * let&l:statusline = g:NCstatusline
>>
>> Yakov
>
> Wow! Hadn't realized it was global-local. :thumbsup:
>
> Best regards,
> Tony.

Agreed, that's quite a nice tip.

I ended up using it to change the colors of the active vs inactive
statusline in my already fancy statusline settings:

" Colors of active statusline
hi User1  guifg=#66ff66 guibg=#008000 gui=bold term=standout
cterm=bold ctermfg=lightgreen ctermbg=lightgreen
hi User2  guifg=#ffff60 guibg=#008000 gui=bold term=none cterm=bold
ctermfg=yellow     ctermbg=lightgreen

" Colors or inactive 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

" Function used to display syntax group.
function! SyntaxItem()
  return synIDattr(synID(line("."),col("."),1),"name")
endfunction

" Function used to display utf-8 sequence.
function! ShowUtf8Sequence()
  let p = getpos('.')
  redir => utfseq
  sil normal! g8
  redir End
  call setpos('.', p)
  return substitute(matchstr(utfseq, '\x\+ .*\x'), '\<\x', '0x&', 'g')
endfunction

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

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

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [wish] different statusline format for noncurrent statusline

Yegappan Lakshmanan
In reply to this post by Tony Mechelynck

On Sat, Mar 21, 2009 at 12:02 AM, Tony Mechelynck
<[hidden email]> wrote:

>
> On 19/03/09 13:08, Yakov Lerner wrote:
>>
>> On Tue, Mar 17, 2009 at 12:41, Yakov Lerner<[hidden email]>  wrote:
>>> We have separae highlighting,  StatusLineNC, for non-current.
>>> I wish I had different *format*, too,  for noncurrent statusline. I do not
>>> think differnt format for non-current statusline is supported.
>>> Is it possible to put this request in todo. Thanks.
>>
>> Found how to make it in current vim.
>> Sorry for the noise.  Took me time to figure it, works fine.
>>
>> let&statusline="Your favourite statusline"
>> let  g:Active_statusline=&g:statusline
>> let g:NCstatusline = "%<%F"    " non-current statusline
>> au WinEnter * let&l:statusline = g:Active_statusline
>> au WinLeave * let&l:statusline = g:NCstatusline
>>
>> Yakov
>
> Wow! Hadn't realized it was global-local. :thumbsup:
>

Yes. This change ( 'statusline' option can be local to a window) was
made in 7.0.

- Yegappan

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

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: [wish] different statusline format for noncurrent statusline

iler.ml
In reply to this post by Dominique Pellé


On Sat, Mar 21, 2009 at 11:22, Dominique Pelle <[hidden email]> wrote:

Tony Mechelynck wrote:

> On 19/03/09 13:08, Yakov Lerner wrote:
>>
>> On Tue, Mar 17, 2009 at 12:41, Yakov Lerner<iler.ml@gmail.com>  wrote:
>>> We have separae highlighting,  StatusLineNC, for non-current.
>>> I wish I had different *format*, too,  for noncurrent statusline. I do not
>>> think differnt format for non-current statusline is supported.
>>> Is it possible to put this request in todo. Thanks.
>>
>> Found how to make it in current vim.
>> Sorry for the noise.  Took me time to figure it, works fine.
>>
>> let&statusline="Your favourite statusline"
>> let  g:Active_statusline=&g:statusline
>> let g:NCstatusline = "%<%F"    " non-current statusline
>> au WinEnter * let&l:statusline = g:Active_statusline
>> au WinLeave * let&l:statusline = g:NCstatusline
>>
>> Yakov
>
> Wow! Hadn't realized it was global-local. :thumbsup:
>
> Best regards,
> Tony.

Agreed, that's quite a nice tip.

I ended up using it to change the colors of the active vs inactive
statusline in my already fancy statusline settings:

" Colors of active statusline
hi User1  guifg=#66ff66 guibg=#008000 gui=bold term=standout
cterm=bold ctermfg=lightgreen ctermbg=lightgreen
hi User2  guifg=#ffff60 guibg=#008000 gui=bold term=none cterm=bold
ctermfg=yellow     ctermbg=lightgreen

" Colors or inactive 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

" Function used to display syntax group.
function! SyntaxItem()
 return synIDattr(synID(line("."),col("."),1),"name")
endfunction

" Function used to display utf-8 sequence.
function! ShowUtf8Sequence()
 let p = getpos('.')
 redir => utfseq
 sil normal! g8
 redir End
 call setpos('.', p)
 return substitute(matchstr(utfseq, '\x\+ .*\x'), '\<\x', '0x&', 'g')
endfunction

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
 
Different highlighting for non-active statusline is trivial due to
'hi StatusLineNC', as opposed to different contents/format of statusline.
But I've got to try out your statusline code. It's hideousest statusline I've seen.


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