Stephen Weber's picture

I do a lot of development with Turnkey appliances inside VirtualBox virtual machines. I really ought to edit the code in normal-space since I've tuned many of my development tools the way I want them, but today I was being lazy and working on a Django appliance.

Using VIM I kept getting frustrated by little things: no syntax highlighting, couldn't switch between buffers... I kept getting the error "E319: Sorry, the command is not available in this version". I noticed that the install only had vim-tiny, which takes up a lot less space so it makes sense for Turnkey to assume the appliance is a production environment.

So the man pages suggest installing vim-runtime, so I did. Still got the E319 errors for the features I wanted. On a whim I decided to update and upgrade (erroneously thinking I was upgrading vim-common) and this yielded no change.

Basically, VIM is the wrong version to do what I want it to do. Other than compiling it from source, what options do I have?

Forum: 
Alon Swartz's picture

As you mentioned, the appliances include vimtiny to save space, as well as letting the user choose his preferred editor as needed.

You can install the full version of vim like this:
apt-get update
apt-get install vim
And turn on syntax highlighting like this:
:syntax on
Hope this helps.
Keyturns's picture

I executed the command:

apt-get install vim

and now in vim when I do   :syntax on   I do get highlighting so that's cool!

But how do I set it up so that highlighting is always on by default? Each time I go into vim I do not want to have to enter the command   :syntax on   each time.

I am using Wordpress appliance 14.2.

 

Jeremy Davis's picture

Any settings you want to make default, need to go in your ~/.vimrc file. Please note that if you don't already have a .vimrc file in your home directory (/root when running as the root user, /home/USERNAME when running as a normal user). it will override the current defaults. So you may wish to copy the existing defaults and edit/add config to it.

I forget where the default is on a new system as I just have a .vimrc which I copy to a new server. IIRC the default is /etc/vim/vimrc but YMMV. The vim wiki covers how to configure vimrc in detail.

Add new comment