hsitz / VimOrganizer

VimOrganizer is partly a clone of Emacs' Org-mode, and partly a front end to Org-mode itself. Do Org in Vim.
http://vimeo.com/31531308
518 stars 67 forks source link

Unable to set custom TODO highlight colors #53

Open colinsullivan opened 11 years ago

colinsullivan commented 11 years ago

Am I doing something wrong? My .vimrc:

let g:ft_ignore_pat = '\.org'                                                   
filetype plugin indent on " required!

...

" VimOrganizer                                                                  
au! BufRead,BufWrite,BufWritePost,BufNewFile *.org                              
au BufEnter *.org            call org#SetOrgFileType()                          
command! OrgCapture :call org#CaptureBuffer()                                   
command! OrgCaptureFile :call org#OpenCaptureFile()                             
let g:org_todo_setup='TODO STARTED WAITING NEEDS_TEST | DONE'                   

function! OrgCustomColors()                                                     
  let g:org_todo_custom_highlights =                                            
            \       { 'STARTED': { 'guifg':'#888888', 'guibg':'#222222',        
             \              'ctermfg':'gray', 'ctermbg':'darkgray'},            
             \      'WAITING': { 'guifg':'#aa3388',                             
             \                 'ctermfg':'red' } }                              
endfunction

But the STARTED, WAITING, and NEEDS_TEST options all have the same default red color. @odabrunz I tried with your fork as well.

Maybe it is MacVim?

hsitz commented 11 years ago

On Mon, Nov 12, 2012 at 10:24 AM, Colin Sullivan notifications@github.comwrote:

Am I doing something wrong? My .vimrc: But the STARTED, WAITING, and NEEDS_TEST options all have the same default red color. @odabrunz https://github.com/odabrunz I tried with your fork as well.

Maybe it is MacVim?

Hi Colin -- It looks like you've done everything right; I'm sure problem is in VimOrganizer.

In my own test it looks like the highlighting you specify does appear if a heading is folded -- if you've applied the level-dependent-highlighting patch to Vim. If you haven't patched Vim then folded headings are all same color as always.

I can confirm that I see the problem you've pointing out when a heading is unfolded.

I've implemented the fix that I'll push up to github later today. Thanks for pointing this out.

-- Herb

colinsullivan commented 11 years ago

Thanks for the prompt attention! I am quite into this tool.

Just pulled the most recent code, now the highlighting only works at the top level headers, and not the sub-level ones! Before it was working on the sub-level headings but not the top-level ones.

How would I know if I have this level-dependent-highlighting patch, and do I need it?

My .vimrc:

let g:org_todo_setup='TODO STARTED WAITING NEEDS_TEST | DONE'                   

function! OrgCustomColors()                                                     
  let g:org_todo_custom_highlights =                                            
        \ { 'TODO':       { 'guifg': '#D60000' },                               
          \ 'STARTED':    { 'guifg': '#D68B00' },                               
          \ 'WAITING':    { 'guifg': '#EDED2B' },                               
          \ 'NEEDS_TEST': { 'guifg': '#2BEAED' },                               
          \ 'DONE':       { 'guifg': '#10BD00' }                                
        \ }                                                                     
endfunction

My .org file:

* Performance System
** Dedicated tap tempo on footpedal would provide nice flexibility for 
   improving with musically relevant controls.
** TODO map midi accomp volume
** TODO bass input into accomp
** TODO synthesize a kick sound
** synthesize a higher percussive sound
** TODO markov analysis of garrett's improv!
** TODO sequence TriFlutter
** STARTED to make setup easier: figure out MIDI indexing.
** DONE button to reset analysis
** DONE control labels
** TODO parameter automation (quivering)
   done server-side, knobs just control rates and center
   show rate and quivering values on GUI !
   * TODO For running water
   * TODO For granular synth
** TODO MIDI sync control and info on clock window
* To document?:
** challenges associated with modifying a MIDI clip as it is playing
* Other ideas:
** concert like organization but markov analysis of categories.
hsitz commented 11 years ago

On Mon, Nov 12, 2012 at 6:03 PM, Colin Sullivan notifications@github.comwrote:

Thanks for the prompt attention! I am quite into this tool.

Just pulled the most recent code, now the highlighting only works at the top level headers, and not the sub-level ones! Before it was working on the sub-level headings but not the top-level ones.

How would I know if I have this level-dependent-highlighting patch, and do I need it?

Colin -- Sorry, I tried to do quick fix without fully recalling how this part of things worked. Now I see I had already done the work in different spot and I can't quite figure out what's causing the problem. I'll try to take another look today.

If you don't know whether you have the VIm patch then I'm sure you don't have it. The code for the patch is in the /contrib directory of project and you need to patch existing Vim source code and recompile Vim. The patch allows headings to retain their proper colors even when they are collapsed/folded (i.e, when text or other headings are hidden beneath them, when you see a number |xx| at right side of window). You have probably noticed that when you collapse headings the color changes and that all collapsed headings have the same color, regardless of the level of the heading. This is troublesome in many (most?) VimOrganizer documents, which can have many levels of headings with tens or hundreds of lines of text under each heading. The best way to work with such a document is to keep the structure collapsed to two or three levels of headings, but in stock Vim this has issue of making all levels the same color. With the patch the headings retain same color they had when uncollapsed so structure of document it much easier to see.

A second effect of the patch is to allow highlighting of a heading's TODO words even when the heading is collapsed. In stock Vim all words in the heading are the same color when collapsed, the patch fixes this so TODO words stand out even when document is in a collapsed state.

-- Herb