How To Fix Vi / Vim Editor Error — E319: Sorry, the command is not available in this version

by Ramesh Natarajan on September 4, 2009

Question: I’m getting the following error message in my Vim editor. How do I fix this issue?

E319: Sorry, the command is not available in this version: filetype plugin on

Answer: For the impatient, here is the quick answer. If you like to understand details on how to install this package, read further.

  • Problem: Vim Editor E319 Error Message.
  • Solution: Install vim-gui-common

1. Reproduce E319 Vim Editor Error

Add the following line to your ~/.vimrc file

# cat ~/.vimrc
filetype plugin on

Now, try to open any file in Vi editor, you should get the following error message.

# vim new-file.txt
Error detected while processing /home/ramesh/.vimrc:
line    1:
E319: Sorry, the command is not available in this version: filetype plugin on
Press ENTER or type command to continue

2. Check Your Vim Editor Version

Launch the Vim editor and give :version to see whether you are running Small version without GUI or full version of Vim editor with GUI.

When you do :version, if it shows “Small version without GUI“, this is your problem.

# vim
:version

Small version without GUI.

3. Check whether vim-gui-common is Installed

On Ubuntu and Debian, use dpkg command to see whether vim-gui-common is installed on your system. In this example, it is not installed.

# dpkg -l | grep -i vim
ii  vim-common
2:7.2.079-1ubuntu5  Vi IMproved - Common files ii  vim-tiny 2:7.2.079-1ubuntu5 Vi IMproved - enhanced vi editor - compact v

4. Search vim-gui-common and vim-runtime packages in Your OS Respository

Search your OS repository to make sure vim-gui-common package is available. Also, it is advisable to install vim-runtime package, which will help you to solve some other issues that you may encounter in the future. So, it is better to install both these packages.

In the following example, we can notice that these two packages are available in the OS repository.

# apt-cache search ^vim-gui-common
vim-gui-common - Vi IMproved - Common GUI files

# apt-cache search ^vim-runtime
vim-runtime - Vi IMproved - Runtime files

4. Install vim-gui-common and vim-runtime packages from the respository

Install both these packages using apt-get command as shown below.

# apt-get install vim-gui-common

# apt-get install vim-runtime

5. Verify that vim-gui-common and vim-runtime packages are installed

Execute the dpkg command to make sure these packages are installed.

# dpkg -l | grep -i vim
ii  vim-common                                 2:7.2.079-1ubuntu5                        Vi IMproved - Common files
ii  vim-gnome                                  2:7.2.079-1ubuntu5                        Vi IMproved - enhanced vi editor - with GNOM
ii  vim-gui-common                             2:7.2.079-1ubuntu5                        Vi IMproved - Common GUI files
ii  vim-runtime                                2:7.2.079-1ubuntu5                        Vi IMproved - Runtime files
ii  vim-tiny                                   2:7.2.079-1ubuntu5                        Vi IMproved - enhanced vi editor - compact v

6. Problem Solved !

Now, try to open any file in Vi editor, you will not get the E319 error message anymore.

# vi new-file.txt
Download Free eBook - Linux 101 Hacks

Get free Unix tutorials, tips and tricks straight to your email in-box.

If you enjoyed this article, you might also like..

  1. PPM Install Error: no suitable installation target found for package
  2. How To Install Java JDK or JRE on Ubuntu or Debian
  3. How to Fix GPG No Public Key NO_PUBKEY Error During apt-get Update
  4. How to Install and Launch emacs Editor on Debian / Ubuntu Linux
  5. How To Resolve – CPAN.pm needs tar, gzip and bzip2 installed – error message
  

Vim 101 Hacks Book

{ 1 comment… read it below or add one }

1 Priyanka Annam May 4, 2010 at 3:38 am

when I’m doing :syntax on or syntax off in vi editor .It is giving Can’t open file /home/pannam/VIM6/vim60/runtime/syntax/syntax.vim
and how the $VIMRUNTIME and $VIM varibles will set?
Can any one please help me on it?

Leave a Comment

Previous post:

Next post: