Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I just changed my shell to ZSH. However, when I tried to edit a .py file in vim I got a strange error:

"test.py" [New File] Error detected while processing /usr/local/share/vim/vim73/ftplugin/python.vim: line 21: E492: Not an editor command: def)') line 22: E492: Not an editor command: def)') line 23: E492: Not an editor command: def)') line
24: E492: Not an editor command: def)') line 42: E10: \ should be followed by /, ? or &

However, if I comment out

filetype indent plugin on

in my .vimrc the message goes away, unfortunately so does my smart indentation. Does anyone know why vim would be effected by a change in shell? Or have a workaround?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Vim wouldn't be affected by your change in shell. If you changed your login shell to zsh, then your ~/.profile and /etc/profile aren't read any more; it's possible that vim was relying on an environment variable defined in one of these files, or that you have two version of Vim on your system and your PATH is now different so you're running a different version of Vim.

You can make ~/.zprofile execute ~/.profile. Zsh's syntax isn't completely compatible with sh, so you need to put zsh in compatibility mode.

read_profiles () {
  emulate -LR sh
  if [ -r /etc/profile ]; then . /etc/profile; fi
  if [ -r ~/.profile ]; then . ~/.profile; fi
}
read_profiles
share|improve this answer
    
This was in fact the issue, an old version of vim leftover from who knows when was taking precedence over a newer version of vim. –  user10667 Sep 18 '11 at 23:37

I don't think its zsh put rather your plugin. It looks like your missing something from the beginning of line 21. Try pulling down python.vim again and see if that clears your issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.