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

Undefined variable: b:v in VimOrganizer/syntax/org.vim #54

Closed brookhong closed 11 years ago

brookhong commented 11 years ago

line 53: E121: Undefined variable: b:v E15: Invalid expression: "syntax match DONETODO '" . b:v.todoDoneMatch[1:] . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6" line 54: E121: Undefined variable: b:v E15: Invalid expression: "syntax match NOTDONETODO '" . b:v.todoNotDoneMatch[1:] . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6" Exception thrown: Vim(highlight):E420: BG color unknown Exception caught: Vim(highlight):E420: BG color unknown Exception finished: Vim(highlight):E420: BG color unknown

hsitz commented 11 years ago

On Sun, Jan 27, 2013 at 10:08 PM, brookhong notifications@github.comwrote:

line 53: E121: Undefined variable: b:v E15: Invalid expression: "syntax match DONETODO '" . b:v.todoDoneMatch[1:] . "' containedin=OL1,OL2,OL3,OL4,OL5,OL6" line 54:

Some questions:

Are you using latest VimOrganizer version from github?

What sort of a setup (Linux, Windows / gvim /console vim) are you using?

If on console Vim are you sure you're set up for 256 colors?

-- Herb

brookhong commented 11 years ago

Yes, I'm using latest code from github. The error occurs in MacVim/gVim/console vim. I found that the error seems to be caused by gmarik/vundle.

I installed VimOrganizer with vundle, and vundle needs filetype off before Bundle 'hsitz/VimOrganizer'.

VimOrganizer defines b:v in ftplugin, I can't figure out a way to avoid the conflict.

hsitz commented 11 years ago

On Mon, Jan 28, 2013 at 5:45 PM, brookhong notifications@github.com wrote:

I found that the error seems to be caused by gmarik/vundle.

I installed VimOrganizer with vundle, and vundle needs filetype off before Bundle 'hsitz/VimOrganizer'.

VimOrganizer defines b:v in ftplugin, I can't figure out a way to avoid the conflict.

I use vundle myself. I just put a 'filetype plugin indent on' line after the Bundle commands and before the au commands for VimOrganizer (You may

need to move Bundle commands up earlier in your vimrc to do this):

" all Vundle/Bundle stuff above here . . . filetype plugin indent on " (or just filetype plugin on) au! BufRead,BufWrite,BufWritePost,BufNewFile *.org

au BufEnter *.org call org#SetOrgFileType()

brookhong commented 11 years ago

yes, I'm using vundle/VimOrgnizer in the way as you, please see https://raw.github.com/brookhong/vimfiles/master/vimrc.

I simplified my vimrc more as below, the error still happens.


filetype off let $brookvim_root="/works/vimfiles" let &runtimepath = $brookvim_root."/bundle/vundle/,".&runtimepath call vundle#rc() let g:bundle_dir = $brookvim_root."/bundle/" Bundle 'gmarik/vundle' Bundle 'hsitz/VimOrganizer' " VimOrganizer setup let g:ft_ignore_pat = '.org' au! BufRead,BufWrite,BufWritePost,BufNewFile .org au BufEnter .org call org#SetOrgFileType() command! OrgCapture :call org#CaptureBuffer() command! OrgCaptureFile :call org#OpenCaptureFile() " }}}


hsitz commented 11 years ago

On Tue, Jan 29, 2013 at 12:18 AM, brookhong notifications@github.comwrote:

yes, I'm using vundle/VimOrgnizer in the way as you, please see https://raw.github.com/brookhong/vimfiles/master/vimrc.

I don't see the command 'filetype plugin indent on' after your Bundle commands. You have to turn that on back on. 'filetype off' turns it off for Bundle commands. After Bundle you need to turn back on.. . .

filetype off

let $brookvim_root="/works/vimfiles" let &runtimepath = $brookvim_root."/bundle/vundle/,".&runtimepath call vundle#rc() let g:bundle_dir = $brookvim_root."/bundle/" Bundle 'gmarik/vundle' Bundle 'hsitz/VimOrganizer' " VimOrganizer setup

"***** " need line below after Bundle commands. . . "** filetype plugin indent on

let g:ft_ignore_pat = '.org'

au! BufRead,BufWrite,BufWritePost,BufNewFile .org au BufEnter .org call org#SetOrgFileType() command! OrgCapture :call org#CaptureBuffer() command! OrgCaptureFile :call org#OpenCaptureFile()

" }}}

— Reply to this email directly or view it on GitHubhttps://github.com/hsitz/VimOrganizer/issues/54#issuecomment-12824554.

brookhong commented 11 years ago

Oops, I missed that important line in the short vimrc. But the root cause finally for me is that there is a line syntax on before Bundle 'hsitz/VimOrganizer'


syntax on filetype off let $brookvim_root="/works/vimfiles" let &runtimepath = $brookvim_root."/bundle/vundle/,".&runtimepath call vundle#rc() let g:bundle_dir = $brookvim_root."/bundle/" Bundle 'gmarik/vundle' Bundle 'hsitz/VimOrganizer' filetype plugin indent on

" VimOrganizer setup let g:ft_ignore_pat = '.org' au! BufRead,BufWrite,BufWritePost,BufNewFile .org au BufEnter .org call org#SetOrgFileType() command! OrgCapture :call org#CaptureBuffer() command! OrgCaptureFile :call org#OpenCaptureFile()


So for VimOrganizer, syntax must be off before Bundling it.