itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

background color wierd red #146

Closed JenTus closed 5 years ago

JenTus commented 5 years ago

Hi,

I'm using vim-wiki and the calendar.vim together. Thank you very much for this powerful plungin! My problem is, when I first run the :Calendar, the background shows the weird red. back1 However, if I quite the calendar(:q) and run(:Calendar) again, the weird red background disappears. back2 .

Here are my minimal .vimrc file regarding the color, vim-wiki and the calendar.vim. Thank you very much.

set nocompatible
filetype plugin on
filetype indent on
syntax on

" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
set relativenumber
call plug#begin('~/.vim/plugged')

" color
" Plug 'sheerun/vim-wombat-scheme'
Plug 'morhetz/gruvbox'

Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'vimwiki/vimwiki', { 'branch': 'dev' }
Plug 'https://github.com/itchyny/calendar.vim.git'
"Plug 'mattn/calendar-vim'

call plug#end()

set background=dark
set t_Co=256
try
  colorscheme gruvbox
catch
  echo "bad try color"
endtry

" mapleader
let mapleader=","

" vimwiki stuff "
" Run multiple wikis "
let g:vimwiki_list = [ {'path': '~/vimwiki', 'syntax': 'markdown', 'ext': '.md', 'auto_tags': 1} ]

" https://github.com/vimwiki/vimwiki
" vimwiki with markdown support
let g:vimwiki_ext2syntax = {'.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
" helppage -> :h vimwiki-syntax

" Calendar

let g:calendar_google_calendar = 1
let g:calendar_google_task = 1

function! ToggleCalendar()
  execute ":Calendar"
  if exists("g:calendar_open")
    if g:calendar_open == 1
      execute "q"
      unlet g:calendar_open
    else
      g:calendar_open = 1
    end
  else
    let g:calendar_open = 1
  end
endfunction

autocmd FileType vimwiki map <leader>c :call ToggleCalendar()<CR>

:autocmd FileType calendar nmap <buffer> <CR> :<C-u>call vimwiki#diary#calendar_action(b:calendar.day().get_day(), b:calendar.day().get_month(), b:calendar.day().get_year(), b:calendar.day().week(), "V")<CR>
itchyny commented 5 years ago

That looks like the color of trailing white space plugin. Do you have vim-trailing-whitespace plugin installed?

JenTus commented 5 years ago

That looks like the color of trailing white space plugin. Do you have vim-trailing-whitespace plugin installed?

Yes, indeed and the problem is solved. Thank you.