masukomi / vim-markdown-folding

Fold markdown documents by section.
248 stars 43 forks source link

Undefined variable: b:undo_ftplugin #12

Closed wolfv6 closed 10 years ago

wolfv6 commented 10 years ago

This error displays at bottom of gVim when I open a markdown file: Error detected while processing C:\Users\wolf\vimfiles\bundle\vim-markdown-folding\after\ftplugin\markdown\folding.vim line:20 E121: Undefined variable: b:undo_ftplugin E121: Undefined variable: b:undo_ftplugin

I press Enter to continue and folding works fine. I am running Vim 7.4 with Vundle on Windows 7. This is in my _vimrc file:

set nocompatible if has("autocmd") filetype plugin indent on endif Plugin 'nelstrom/vim-markdown-folding'

wolfv6 commented 10 years ago

Another plugin was conflicting with this one. Problem solved.

nelstrom commented 10 years ago

Which plugin?

wolfv6 commented 10 years ago

Sorry, I changed many things in my vimrc file and can't reproduce the error now. Now I get this error at bottom of gVim when I open a .markdown file:

Error detected wile processing function 8_LoadFTPlugin: line 2: E184: No such user-defined command: FoldToggle

Here is my _vimrc file:

"code for Vundle **************************************
" https://github.com/gmarik/Vundle.vim/wiki/Vundle-for-Windows
" https://github.com/gmarik/Vundle.vim#quick-start

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/vimfiles/bundle/Vundle.vim/
let path='~/vimfiles/bundle'

" Keep Plugin commands between vundle#begin/end.
" alternatively, pass a path where Vundle should install plugins
"   call vundle#begin('~/some/path/here')
" for example formats see https://github.com/gmarik/Vundle.vim#quick-start
"   step 3. Confuguar Plugins
" from https://github.com/gmarik/Vundle.vim/wiki
" Until bug #430 is resolved, put the following line after each Plugin call:
"   call vundle#config#require(g:bundles) 
call vundle#begin(path)

    " let Vundle manage Vundle, required
    Plugin 'gmarik/Vundle.vim'
    call vundle#config#require(g:bundles)

    " vim-markdown-folding from https://github.com/nelstrom/vim-markdown-folding
    if has("autocmd")
      filetype plugin indent on
    endif
    Plugin 'nelstrom/vim-markdown-folding'
    call vundle#config#require(g:bundles) 

    " vim-markdown from https://github.com/gabrielelana/vim-markdown
    " does highlighting and folding
    "Bundle 'gabrielelana/vim-markdown'

    " vim-misc from https://github.com/xolox/vim-shell   Vim scripts used by vim-shell
    "Plugin 'file://C:\Users\wolf\vimfiles\vim-misc\autoload\xolox\misc.vim'
    "call vundle#config#require(g:bundles) 

    " vim-shell from https://github.com/xolox/vim-shell <F6> opens links in browser
    "Plugin 'file://C:\Users\wolf\vimfiles\shell\autoload\xolox\shell.vim'
    "call vundle#config#require(g:bundles) 

" All of your Plugins must be added before the following line
call vundle#end()            " required

filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList          - list configured plugins
" :PluginInstall(!)    - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

"code from default vimrc file *************************
set nocompatible
source $VIMRUNTIME/vimrc_example.vim

" from https://groups.yahoo.com/neo/groups/vim/conversations/messages/128040
" remove the FileType autocommands for filetype text, i.e. textwidth=78 in vimrc_example.vim
autocmd! vimrcEx FileType text

source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '"' . $VIMRUNTIME . '\diff"'
      let eq = '""'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

"User Preferences set by wolf *************************

" only do this part when compiled with support for autocommands.
if has("autocmd")
    " set filetype
    autocmd BufRead,BufNewFile
    \ {*.markdown,*.mdown,*.mkdn,*.md,*.mkd,*.mdwn,*.mdtxt,*.mdtext,*.text,*.txt}
    \ set filetype=markdown

    " if text file, turn on spell checking
    autocmd BufRead,BufNewFile FileType text setlocal spell

    " if text file, set widths
    " with Consolas:9 font, taskbar on top, HD monitor, max lines is 72
    " with Verdana 10 font, paper is typically 100 chars wide
    autocmd FileType markdown setlocal textwidth=100 columns=100 lines=50 shiftwidth=8

    " if text file, wrap with 2-space indent
    autocmd FileType markdown set showbreak=\ \ 

    " if Arduino file, use C color syntax highlighting
    autocmd BufRead,BufNewFile *.ino setlocal syn=c
endif

" set search options
setlocal ignorecase
setlocal smartcase

" set font in buffer, see ##fonts
setlocal guifont=Consolas:h9:cANSI
samumist commented 8 years ago

I had the same error code after installed the 'gabrielelana/vim-markdown' plugin.

I don't like the folding coming with 'gabrielelana/vim-markdown' as it is really a performance hit.