NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Using Vim - installing C script

November 26, 2011
by pfullen
pfullen's Avatar

I downloaded the C script for Vim but cannot figure a way for it to auto load each time I start up Vim.

Thanks for your help

PJF

November 29, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi pfullen,

I'm not really sure what C script is. Usually plug for plug-ins all you have to do is put them in your .vim/plugin/ folder and they get auto loaded by vim.

Humberto

November 29, 2011
by treymd
treymd's Avatar

Also, there is a file somewhere under your home directory called .vimrc In my case it is right in my home directory. You can put commands in there 1 per line and I believe vim executes them when loading.

Mine looks something like this:

:set noai
:set expandtab
:set ts=4
:syntax on
:colorscheme slate

These, in order, turn off autoindent, expand tabs to spaces, set tabs to 4 spaces per, turns on sytax highlighting, and chooses a color scheme.

December 04, 2011
by pfullen
pfullen's Avatar

Thanks a bunch I was able to get it to work

The C script was created by Fritz Mehner It allows vim to have a ton more function while programming C or C++

I edited the vimrc file as you mentioned above

I also had to add

:filetype plugin on

You download the script at http://www.vim.org/scripts/script.php?script_id=213

You will need to make a new folder called .vim with a subfolder called plugin If you unzip the cvim plugin there should be a file called c.vim
Copy this into .vim/plugin

It will then run the script when GVim starts up

Post a Reply

Please log in to post a reply.

Did you know that you can connect to certain car computers via the OBD-II port with a microcontroller? Learn more...