I occasionally use the view command, which runs vim as readonly.
Problem:
Error detected while processing /home/james/.vim/vimrc:
line 11:
E492: Not an editor command: Plugin 'gmarik/Vundle.vim'
line 14:
E492: Not an editor command: Bundle 'croaky/vim-colors-github'
Press ENTER or type command to continue
Can you post your vimrc?
On Thu, 2014-07-24 at 02:58 -0700, Yunjong Jeong wrote:
Can you post your vimrc?
" use vim settings, rather than vi settings. this setting must be as
early as
" possible, as it has side effects. this is required for vundle.
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" add other plugins here...
Plugin 'jamessan/vim-gnupg'
Bundle 'croaky/vim-colors-github'
" 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
Reply to this email directly or view it on GitHub:
https://github.com/gmarik/Vundle.vim/issues/498#issuecomment-49989087
Have you cloned Vundle into your .vim/bundle folder?
On Thu, 2014-07-24 at 03:47 -0700, Filipe Barros wrote:
Have you cloned Vundle into your .vim/bundle folder?
Vundle works fine with vim, just not with 'view'.
does the same happen when you run vim -R instead of view?
On Thu, 2014-07-24 at 03:57 -0700, Jacobo de Vera wrote:
does the same happen when you run
vim -Rinstead ofview?
vim -R works perfectly...
I'm tempted to just alias this, but the vundle people might want to fix
this... I'm guessing something is misbehaving after looking at basename
$0...
vim -R is the same as view, so perhaps your view, which is normally a symlink to vim does not actually point to vim.
Please run these commands and share the output.
readlink -m "$(which view)"
readlink -m "$(which vim)"
Also do check if any are aliases or shell functions:
alias vim
alias view
declare -F vim
declare -F view
On Thu, 2014-07-24 at 04:02 -0700, Jacobo de Vera wrote:
vim -Ris the same asview, so perhaps yourview, which is normally a symlink tovimdoes not actually point tovim.
I still think it's a vundle bug...Please run these commands and share the output.
readlink -m "$(which view)" readlink -m "$(which vim)"Output:
james@computer:~$ readlink -m "$(which view)"
/usr/bin/vi
james@computer:~$ readlink -m "$(which vim)"
/usr/bin/vim
james@computer:~$ readlink -m "$(which vi)"
/home/james/alias vi='vim'
/usr/bin/vim
james@computer:~$ sha1sum which vim
9d6b1c1e0dadac8e0f8da623909ddd7a84c70696 /usr/bin/vim
james@computer:~$ sha1sum which view
2e4c3fc3708e50fb285fb7215c0d3bccaee84cc6 /usr/bin/view
>
>
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/gmarik/Vundle.vim/issues/498#issuecomment-49994249
If both vim and view point to the same file and none are aliases or functions, then I'd like you to post your full vimrc somewhere so I can test it. I use view all the time and never had any problems.
Ok, so readlink -m with view resolved back to /usr/bin/vi, which is a completely different executable than vim. Normally vi would link to vim, but if you had a instance of vi and then compiled your own vim you might not have installed the links.
I don't know how you got there, but if you make view link to vim instead of vi, that should work.
You can try running /usr/bin/vi to see what it actually is or what files it loads.
Please let me know if linking view to vim works.
yum provides '*bin/vi'
2:vim-minimal-7.4.027-2.fc20.x86_64
So I think the issue (if anything) is that it's a packaging issue... view points to vi (not vim), and vi, tries to load vundle, which requires things not available because it's vi, not vim, and hence the error.
The fact that view points to vi, and not vim -R probably a Fedora specific issue. Whether or not it makes sense or not is another question...
Glad it's all clear.
@jdevera it's a packaging issue, but is it possible for vundle to support the packaged 'view' ?
If you have a chance to try on a Fedora machine, let me know. Thanks!
@purpleidea AFAIK, it's a completely different piece of software. So no. Vundle needs Vim. But fixing your problem is simple, you just to put a symlink to vim called view somewhere in your path before the official one.
Why does vi even source your viMrc file? That seems strange to me.
On Fri, Aug 1, 2014 at 3:02 AM, Lucas Hoffmann [email protected]
wrote:
Why does vi even source your vimrc file? That seems strange to me.
No idea.
Hey folks, what about a good old conditional to handle this sort of problem?
"" If we're not in vi-compatible mode, then load advanced VIM code
"" like Bundles and colors
if !has("compatible")
" Vundle code here
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
... etc
" Other non-vi code here
" End Vundle
endif
"" Regular vi-compatible code here
" Show the mode, like Insert, Replace or Visual mode
set showmode
Not sure if this will help anyone, but I figured I would put it out there since I recently experienced this problem. I was also using Vundle. Following Vundle's installation instructions I set my rtp. Except I had been messing around with my dot file/system structure pointing it to place that was valid until I moved it. Once I pointed it to the correct location (default as it turns out :)) the errors went away. I don't know if there is anyway for Vundle to not require setting rtp. But I wouldn't personally call my scenario a Vundle bug. I'm just glad it didn't take me too long to find it since I was focused for 5 minutes on where I might have set $MYVIMRC.
Cheers
Most helpful comment
Hey folks, what about a good old conditional to handle this sort of problem?