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-common2: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
Comments on this entry are closed.
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?
my problem was that for some reason /usr/bin/vim pointed to -> /usr/bin/vim.gnome*
what I did was updating alternatives system:
this shows alternatives to vim
# update-alternatives –display vim
and here you can choose which version you prefere:
update-alternatives –config vim
Thanks, worked well for me.
hi
you said :
“When you do :version, if it shows “Small version without GUI“, this is your problem.”
yeah it showed me Small version without GUI
what should i do now?
i have both packages you said .
thanks
works just fine