java vimrc_Vim - 更改.vimrc中的状态行颜色?

hi StatusLine ctermbg=3 ctermfg=4

这很好,但我怎么能一直为每个窗口做这个,而不是必须为我打开的每个新窗口应用命令 . 我希望在.vimrc中这样做,但我无法弄清楚如何 .

我在一个不是gui的终端上运行vim;我正在使用沙漠作为颜色方案 .

答案:在Ingo和Kent提供的答案让我确信我做的是正确的事后,它仍然无效 . 然后我发现我的vimrc中有一行读过

设置背景=黑暗

我不知道为什么会在那里,但当我评论它时,我得到了我想要的状态线颜色 .

NOT THE ANSWER ! :好的 . 我'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'猜测这与filetypes = on有什么关系?

无论哪种方式,当我有更多的时间来思考它时,我将不得不重新提出这个问题,但似乎“设置背景=黑暗”的事情是一个问题,但它不是整个解决方案 .

为什么值得我的vimrc看起来像这样:

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值