# Problem with vim and SimpleFold

**URL:** <https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001>\
**Category:** Ruby\
**Created:** [January 2, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001 "2007-01-02T23:06:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Guido](https://www.ruby-forum.com/u/Guido)\
**Post date:** [January 2, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001/1 "2007-01-02T23:06:24Z")

</div>

Hi,

I just started using the SimpleFold [1] plugin with vim 6.4.  
When I start vim I get the following error:

E518: Unknown option: completefunc=10\_RCT\_completion

My .vimrc contains  
map f SimpleFold\_Foldsearch  
" fold when switching to that buffer  
“au Filetype ruby call SimpleFold\_Foldsearch(”")

Question 1: What do I have to do to make that annoying error go away?

Question 2: If I uncomment the last line, the plugin should be used on  
each freshly loaded ruby file. However vim complains, that the plugin is  
unknown. How do I change that?

Happy rubying,  
Guido

[1] [eigenclass.org](http://eigenclass.org/hiki.rb?simplefold+plugin+0.4.0)

---

<div class="post-metadata">

**Author:** ![Guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Guido](https://www.ruby-forum.com/u/Guido)\
**Post date:** [January 3, 2007, 12:40am UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001/2 "2007-01-03T00:40:37Z")

</div>

On Wed, Jan 03, 2007 at 07:05:09AM +0900, Guido wrote:

> I just started using the SimpleFold [1] plugin with vim 6.4.  
> When I start vim I get the following error:
> 
> E518: Unknown option: completefunc=10\_RCT\_completion

This comes from the rcodetools plugin. completefunc was added in vim 7.0  
and  
isn’t thus available in 6.4. You can get rid of the error by commenting  
the  
corresponding line in ~/.vim/plugin/rcodetools.vim:

"execute “au Filetype ruby setlocal completefunc=” . s:sid .  
“RCT\_completion”

> My .vimrc contains  
> map f SimpleFold\_Foldsearch  
> " fold when switching to that buffer  
> “au Filetype ruby call SimpleFold\_Foldsearch(”")
> 
> Question 1: What do I have to do to make that annoying error go away?

For the time being just edit rcodetools.vim; I’ll add some code to  
detect the  
vim version and skip the completefunc for vim \< 7.0 in the next release.

> Question 2: If I uncomment the last line, the plugin should be used on  
> each freshly loaded ruby file. However vim complains, that the plugin is  
> unknown. How do I change that?

This should do (it works for me) if you’re using the f mapping.

" fold when loading Ruby files  
au Filetype ruby execute "normal " . mapleader .“f”

HTH,

---

<div class="post-metadata">

**Author:** ![Guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Guido](https://www.ruby-forum.com/u/Guido)\
**Post date:** [January 3, 2007, 10:45am UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001/3 "2007-01-03T10:45:49Z")

</div>

Thanks a lot for your help!

Am Wed, 03 Jan 2007 08:38:29 +0900 schrieb Mauricio F.:

> > Question 1: What do I have to do to make that annoying error go away?  
> > solved 🙂

> > Question 2: If I uncomment the last line, the plugin should be used on  
> > each freshly loaded ruby file. However vim complains, that the plugin is  
> > unknown. How do I change that?
> 
> This should do (it works for me) if you’re using the f mapping.
> 
> " fold when loading Ruby files  
> au Filetype ruby execute "normal " . mapleader .“f”

Somehow this doesn’t work, vim complains that the variable mapleader is  
undefined. However it’s not much trouble to just press \f on loading, so  
maybe I’ll just go with that and hope I can get vim7 soon 🙂

Thanks!  
Guido

---

<div class="post-metadata">

**Author:** ![Guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Guido](https://www.ruby-forum.com/u/Guido)\
**Post date:** [January 8, 2007, 1:34am UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001/4 "2007-01-08T01:34:30Z")

</div>

(oops, I forgot this in +postponed)

On Wed, Jan 03, 2007 at 06:45:06PM +0900, Guido wrote:

> > This should do (it works for me) if you’re using the f mapping.
> > 
> > " fold when loading Ruby files  
> > au Filetype ruby execute "normal " . mapleader .“f”
> 
> Somehow this doesn’t work, vim complains that the variable mapleader is  
> undefined. However it’s not much trouble to just press \f on loading, so  
> maybe I’ll just go with that and hope I can get vim7 soon 🙂

Maybe an extra indirection level?  
execute “au Filetype ruby execute ‘normal " . mapleader . "f’”

works for me (but so does the above line, with vim 7)

---

<div class="post-metadata">

**Author:** ![Guido](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Guido](https://www.ruby-forum.com/u/Guido)\
**Post date:** [January 9, 2007, 3:18am UTC](https://www.ruby-forum.com/t/problem-with-vim-and-simplefold/81001/5 "2007-01-09T03:18:58Z")

</div>

Hello,  
My two cents. Install VIM 7.0.x. Here is a link that I followed  
without any problems. Works like a charm. I am assuming that you are  
on a linux/unix system?  
[http://beans.seartipy.com/2006/09/22/develop-ruby-applications-using-vim-70-editor/](http://beans.seartipy.com/2006/09/22/develop-ruby-applications-using-vim-70-editor/)  
Regards,  
Bharat
