Note that there are some explanatory texts on larger screens.

plurals
  1. POVim - change status line colours in .vimrc?
    text
    copied!<p>From this question : <a href="https://stackoverflow.com/q/9065941/364088">How can I change vim status line colour?</a> I learnt how to change the status line colouring, like this :</p> <pre><code>hi StatusLine ctermbg=3 ctermfg=4 </code></pre> <p>That's fine but how can I do that for every window, all the time rather than having to apply the command for each new window that I open. I would expect to do this in .vimrc but I can't work out how to .</p> <p>I'm running vim in a terminal not a gui; I'm using desert as a colorscheme.</p> <hr> <p>ANSWER!: After the answers offered by Ingo and Kent reassured me that I was doing the right thing it still didn't work. Then I discovered I had a line in my vimrc which read </p> <p>set background = dark</p> <p>I'm not sure why that was in there but when I commented it out I got the status line colours I wanted.</p> <hr> <p><strong>NOT THE ANSWER !</strong>: Hmm OK. I've just discovered that making that change to .vimrc does indeed give me the right colours when I was editting vimrc but when I edit python files the status colours are gone. I'm guessing this is something to do with filetypes=on ?</p> <p>Either way I'll have to re-ask this question when I have more time to think about it but it seems the 'set background = dark' thing was a problem but it's not the entire solution.</p> <p>For what's worth my vimrc looks like this :</p> <pre> colorscheme desert autocmd BufRead,BufNewFile *.py syntax on autocmd BufRead,BufNewFile *.py set ai autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,with,try,except,finally,def,class set tabstop=4 set expandtab set shiftwidth=4 filetype indent on "GLAUCON START :set ignorecase "make searches case insensitive by default :set incsearch :set hlsearch " Returns true if paste mode is enabled function! HasPaste() if &paste return 'PASTE MODE ' en return '' endfunction " Always show the status line set laststatus=2 " Format the status line set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l hi StatusLine ctermbg=3 ctermfg=4 "set background=dark "GLAUCON END </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload