VIM¿ª·¢C£¯C£«£«²å¼þcvimµÄ°²×°¼°Ê¹ÓÃ
ÀûÓÃc.vim²å¼þ£¬Äã¿ÉÒÔʵÏÖ
Ìí¼ÓÎļþÍ·
Ìí¼Ó×¢ÊÍ
²åÈëһЩ´úÂëÆ¬¶Î
Óï·¨¼ì²é
¶Áº¯ÊýÎĵµ
×¢ÊÍ´úÂë¿é
ÕâÒ»²å¼þµÄ×÷ÕßÊÇ Fritz Mehner, Ä¿±ê¾ÍÊÇ´òÔì³ÌÐòÔ±Á÷³©µÄ±à¼»·¾³¡£
ÕâÒ»²å¼þ»¹ÄÜÍê³É:
Statement oriented editing of C / C++ programs
Speed up writing new code considerably.
Write code and comments with a professional appearance from the beginning.
Use code snippets
½ÓÏÂÀ´ÎÒÃǶÔÕâÒ»²å¼þÏêϸ½éÉÜ.
3 °²×°²å¼þ
Step 1: ÏÂÔØc.vim
$ cd /usr/src
$ wget http://www.vim.org/scripts/download_script.php?src_id=9679
Step 2: °²×°
$ mkdir ~/.vim
$ cd ~/.vim
$ unzip /usr/src/cvim.zip
Step 3: ÆôÓÃÕâÒ»²å¼þ
$ vim ~/.vimrc
filetype plugin on
8 c.vimµÄʹÓÃ
Feature 1: Add Automatic Header to *.c file
µ±Äãн¨Ò»¸öÀ©Õ¹Ãû.cµÄÎļþʱºò£¬×Ô¶¯ÔÚÎļþÍ·²¿Ôö¼ÓÍ·²¿×¢ÊÍ
$ vim myprogram.c
/*
* =================================================
* Filename: myprogram.c
*
* Description:
*
* Version: 1.0
* Created: 01/19/09 20:23:25
* Revision: none
* Compiler: gcc
*
* Author: Dr. Fritz Mehner (mn),
mehner@fh-swf.de
Ϊ·À±¸µç×ÓÓʼþµØÖ·ÊÕ¼¯Æ÷£¬Õâ¸ö E-mail µØÖ·±»Òþ²Ø£¬ÄãµÄä¯ÀÀÆ÷±ØÐëÖ§³Ö Javascript ²Å¿É¿´µ½Õâ¸öÓʼþµØÖ·
* Company: FH Südwestfalen, Iserlohn
*
* =================================================
*/
ÆäÖÐÈç¹ûÄãÒª¸Ä±ä AUTHOR ºÍ COMPANYµÄÖµ, ÒªÐÞ¸ÄÄ£°åÎļþ ~/.vim/c-support/templates/Templates
$ vim ~/.vim/c-support/templates/Templates
|AUTHOR| = geekstuff
|AUTHORREF| = gk
|EMAIL| = subscribe@geekstuff
|COMPANY| = thegeekstuff.com
ÏÖÔÚ±à¼Ò»¸öÐÂÎļþ£¬¿´¿´ÄãµÄ×÷Õߺ͹«Ë¾Ãû³Æ¸Ä±äÁËûÓС£
$ vim myprogram.c
/*
* =================================================
*
* Filename: myprogram.c
*
* Description:
*
* Version: 1.0
* Created: 01/19/09 20:26:43
* Revision: none
* Compiler: gcc
*
* Author: geekstuff (gk), subscribe@geekstuff
* Company: thegeekstuff.com
*
* =========================================
Ïà¹ØÎĵµ£º
Äõ½Õâ±¾µç×ÓÊé¿´ÁËÁÖ²©Ê¿Ð´µÄǰÑÔ£¬½²ÊöµÄʲôÊDZà³ÌÀÏÊÖÓë±à³Ì¸ßÊÖ£¬´ËʱÎÒ²ÅÖªÎÒÖ»ÄܳƵÃÉÏÊÇÒµÓà±à³Ì°®ºÃÕß¶øÒÑ,ÁÖ²©Ê¿¶Ô±à³ÌÀÏÊÖÓë±à³Ì¸ßÊÖ×öÁËÈçÏµĶ¨Ò壺
¶¨Òå 1£ºÄܳ¤ÆÚÎȶ¨µØ±àд³ö¸ßÖÊÁ¿³ÌÐòµÄ³ÌÐòÔ±³ÆÎª±à³ÌÀÏÊÖ¡£
¶¨Òå 2£ºÄܳ¤ÆÚÎȶ¨µØ±àд³ö¸ßÄѶȡ¢¸ßÖÊÁ¿³ÌÐòµÄ³ÌÐòÔ±³ÆÎª±à³Ì¸ßÊÖ¡£ ......
ʵÏÖÒ»¸öÁ´±í£¬Íê³ÉÁ´±íµÄ²åÈ룬²éÕÒ£¬É¾³ý
typedef struct _FIFO_M{
void *pdata;
struct _FIFO_M *pNext;
}FIFO_M,* pFIFO_M;
typedef struct _FIFO{
pFIFO_M head;
pFIFO_M tail;
pFIFO_M pos;
int mcount;//½Úµã¸öÊý
int max_count;//½Úµã×î´ó¸öÊý¡£
}FIFO,* pFIFO;
......
/*
title£ºÔ¼Éª·òÎÊÌâµÄÑ»·Á´±í½â·¨
author£ºcoolsky600
date£º2010 04 22
notice£ºcÓïÑÔ ÃæÏò¹ý³Ì
*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int num; //È«¾Ö±äÁ¿Î§È¦ÈËÊý
int out; & ......
Ôںܴó³Ì¶ÈÉÏ,±ê×¼C++ÊDZê×¼CµÄ³¬¼¯.ʵ¼ÊÉÏ,ËùÓÐC³ÌÐòÒ²ÊÇC++³ÌÐò,È»¶ø,Á½ÕßÖ®¼äÓÐÉÙÁ¿Çø±ð.ÏÂÃæ¼òÒª½éÉÜÒ»ÏÂ×îÖØÒªµÄÇø±ð.
ÔÚC++ÖÐ,Ãñ,¾Ö²¿±äÁ¿¿ÉÒÔÔÚÒ»¸ö³ÌÐò¿éÄÚÔÚÈκεط½ÉùÃ÷,ÔÚCÖÐ,¾Ö²¿±äÁ¿±ØÐëÔÚ³ÌÐò¿éµÄ¿ªÊ¼²¿·Ö,¼´ÔÚËùÓÐ"²Ù×÷"Óï¾ä֮ǰÉùÃ÷,Çë×¢Òâ,C99±ê×¼ÖÐÈ¡ÏûÁËÕâÖÖÏÞÖÆ.
&nb ......
extern cµÄ×÷Óá¾×ª¡¿
2009-12-18 13:10
1.ÒýÑÔ
C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³Ì ʽÓïÑÔµÄÌØµã£¨±»ÊÀÈ˳ÆÎª“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓ ......