mirror of
https://github.com/amix/vimrc
synced 2025-07-06 07:55:00 +08:00
add various usefull plugins from vim.org and sourfeforge
This commit is contained in:
242
vim_plugins_src/cvim/README.csupport
Normal file
242
vim_plugins_src/cvim/README.csupport
Normal file
@ -0,0 +1,242 @@
|
||||
README for c.vim (Version 5.17) / December 27 2011
|
||||
|
||||
* DESCRIPTION
|
||||
* INSTALLATION
|
||||
* RELEASE NOTES
|
||||
* FILES
|
||||
* ADDITIONAL TIPS
|
||||
* CREDITS
|
||||
|
||||
================================================================================
|
||||
DESCRIPTION
|
||||
================================================================================
|
||||
C/C++-IDE for Vim/gVim. It is written to considerably speed up writing code in
|
||||
a consistent style. This is done by inserting complete statements, idioms,
|
||||
code snippets, templates, and comments. Syntax checking, compiling, running a
|
||||
program, running indent or code checkers can be done with a keystroke. There
|
||||
are many additional hints and options which can improve speed and comfort when
|
||||
writing C/C++. See the help file csupport.txt for more information.
|
||||
|
||||
================================================================================
|
||||
INSTALLATION
|
||||
================================================================================
|
||||
|
||||
(1) LINUX
|
||||
----------
|
||||
|
||||
The subdirectories in the zip archive cvim.zip mirror the directory structure
|
||||
which is needed below the local installation directory $HOME/.vim/ (find the
|
||||
value of $HOME with ":echo $HOME" from inside Vim).
|
||||
|
||||
(1.0) Save the template files in '$HOME/.vim/c-support/templates/Templates' if
|
||||
you have changed any of them.
|
||||
|
||||
(1.1) Copy the zip archive cvim.zip to $HOME/.vim and run
|
||||
|
||||
unzip cvim.zip
|
||||
|
||||
If you have already an older version of c-support and you have modified
|
||||
the template files you may want to save your templates first and suppress
|
||||
overwriting them with
|
||||
|
||||
unzip cvim.zip -x *Templates *.template
|
||||
|
||||
(1.2) Loading of plugin files must be enabled. If not use
|
||||
|
||||
:filetype plugin on
|
||||
|
||||
This is the minimal content of the file '$HOME/.vimrc'. Create one if there
|
||||
is none or use the files in $HOME/.vim/c-support/rc as a starting point.
|
||||
|
||||
(1.3) Set at least some personal details in the file
|
||||
'$HOME/.vim/c-support/templates/Templates'
|
||||
Here is the minimal personalization (my settings as an example):
|
||||
|
||||
|AUTHOR| = Dr. Fritz Mehner
|
||||
|AUTHORREF| = fgm
|
||||
|EMAIL| = mehner@fh-swf.de
|
||||
|COMPANY| = FH Südwestfalen, Iserlohn
|
||||
|COPYRIGHT| = Copyright (c) |YEAR|, |AUTHOR|
|
||||
|
||||
(Read more about the template system in the plugin documentation)
|
||||
|
||||
(1.4) Make the plugin help accessable by typing the following command on the
|
||||
Vim command line:
|
||||
|
||||
:helptags $HOME/.vim/doc/
|
||||
|
||||
(1.5) Consider additional settings in the file '$HOME/.vimrc'. The files
|
||||
customization.vimrc and customization.gvimrc are replacements or extensions
|
||||
for your .vimrc and .gvimrc. You may want to use parts of them. The files
|
||||
are documented.
|
||||
|
||||
|
||||
(2) WINDOWS
|
||||
------------
|
||||
|
||||
The subdirectories in the zip archive cvim.zip mirror the directory structure
|
||||
which is needed below the local installation directory $HOME/vimfiles/ (find
|
||||
the value of $HOME with ":echo $HOME" from inside Vim).
|
||||
|
||||
(2.0) Save the template files in '$HOME/vimfiles/c-support/templates/Templates' if
|
||||
you have changed any of them.
|
||||
|
||||
(2.1) Copy the zip archive cvim.zip to $HOME/vimfiles and run
|
||||
|
||||
unzip cvim.zip
|
||||
|
||||
If you have already an older version of c-support and you have modified
|
||||
the template files you may want to save your templates first and suppress
|
||||
overwriting them with
|
||||
|
||||
unzip cvim.zip -x *Templates *.template
|
||||
|
||||
(2.2) Loading of plugin files must be enabled. If not use
|
||||
|
||||
:filetype plugin on
|
||||
|
||||
This is the minimal content of the file '$HOME/_vimrc'. Create one if there
|
||||
is none or use the files in $HOME/vimfiles/c-support/rc as a starting point.
|
||||
|
||||
(2.3) Set at least some personal details in the file
|
||||
'$HOME/vimfiles/c-support/templates/Templates'
|
||||
Here is the minimal personalization (my settings as an example):
|
||||
|
||||
|AUTHOR| = Dr. Fritz Mehner
|
||||
|AUTHORREF| = fgm
|
||||
|EMAIL| = mehner@fh-swf.de
|
||||
|COMPANY| = FH Südwestfalen, Iserlohn
|
||||
|COPYRIGHT| = Copyright (c) |YEAR|, |AUTHOR|
|
||||
|
||||
(Read more about the template system in the plugin documentation)
|
||||
|
||||
(2.4) Make the plugin help accessable by typing the following command on the
|
||||
Vim command line:
|
||||
|
||||
:helptags $HOME\vimfiles\doc\
|
||||
|
||||
(2.5) Consider additional settings in the file '$HOME/_vimrc'. The files
|
||||
customization.vimrc and customization.gvimrc are replacements or extensions
|
||||
for your _vimrc and _gvimrc. You may want to use parts of them. The files
|
||||
are documented.
|
||||
|
||||
There are a lot of features and options which can be used and influenced:
|
||||
|
||||
* use of template files and tags
|
||||
* surround marked blocks with statements
|
||||
* using and managing personal code snippets
|
||||
* generate/remove multiline comments
|
||||
* picking up prototypes
|
||||
* C/C++ dictionaries for keyword completion
|
||||
* (re)moving the root menu
|
||||
|
||||
Look at csupport help with
|
||||
|
||||
:help csupport
|
||||
|
||||
or use the 'help' item in the root menu of this plug-in.
|
||||
|
||||
+-----------------------------------------------+
|
||||
| +-------------------------------------------+ |
|
||||
| | ** PLEASE READ THE DOCUMENTATION ** | |
|
||||
| | Actions differ for different modes! | |
|
||||
| +-------------------------------------------+ |
|
||||
+-----------------------------------------------+
|
||||
|
||||
Any problems ? See the TROUBLESHOOTING section at the end of the help file
|
||||
'doc/csupport.txt'.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.17
|
||||
================================================================================
|
||||
- Two new plugin tags: LICENSE,ORGANIZATION
|
||||
- System-wide installation: minimal Template file for a user will automatically
|
||||
be added.
|
||||
- New menu item and hotkey: choose a makefile.
|
||||
- New idiom: realloc.
|
||||
- New preprocessor item: #if #endif.
|
||||
- New hotkeys: \ire, \ifs, \ifp, \pif.
|
||||
|
||||
OLDER RELEASE NOTES : see file 'ChangeLog'
|
||||
|
||||
================================================================================
|
||||
FILES
|
||||
================================================================================
|
||||
|
||||
README.csupport This file.
|
||||
|
||||
doc/csupport.txt The help file for the local on-line help.
|
||||
|
||||
ftplugin/c.vim A file type plug-in. Define hotkeys, creates a
|
||||
local dictionary for each C/C++ file.
|
||||
ftplugin/make.vim Access hotkeys for make(1) in makefiles.
|
||||
|
||||
plugin/c.vim The C/C++ plug-in for GVIM.
|
||||
|
||||
c-support/scripts/wrapper.sh The wrapper script for the use of a xterm.
|
||||
c-support/templates/* C-style and C++-style template files
|
||||
(see csupport.txt on how to adapt the templates).
|
||||
|
||||
|
||||
c-support/wordlists/c-c++-keywords.list All C and C++ keywords (also in word.list).
|
||||
c-support/wordlists/k+r.list K&R-Book: Words from the table of content.
|
||||
They appear frequently in comments.
|
||||
c-support/wordlists/stl_index.list STL: method and type names.
|
||||
|
||||
|
||||
-------------------------- ---------------------------------------------------
|
||||
The following files and extensions are for
|
||||
convenience only. c.vim will work without them.
|
||||
---------------------------------------------------
|
||||
c-support/doc/c-hotkeys.pdf Hotkey reference card.
|
||||
c-support/doc/ChangeLog The change log.
|
||||
|
||||
rc/customization.ctags Additional settings I use in .ctags to enable
|
||||
navigation through makefiles ans qmake files with
|
||||
the plug-in taglist.vim.
|
||||
|
||||
rc/customization.gvimrc Additional settings I use in .gvimrc :
|
||||
hot keys, mouse settings, ... The file is
|
||||
commented. Append it to your .gvimrc if you like.
|
||||
|
||||
rc/customization.indent.pro Additional settings I use in .indent.pro :
|
||||
See the indent manual.
|
||||
|
||||
rc/customization.vimrc Additional settings I use in .vimrc : incremental
|
||||
search, tabstop, hot keys, font, use of
|
||||
dictionaries, ... The file is commented. Append
|
||||
it to your .vimrc if you like.
|
||||
|
||||
================================================================================
|
||||
CREDITS
|
||||
================================================================================
|
||||
|
||||
Most of the people who have contributed ideas, patches, and bug reports, is
|
||||
thanked in the file ChangeLog.
|
||||
I would like to especially thank my son Wolfgang Mehner, who has repeatedly
|
||||
proposed improvements and introduced new ideas.
|
||||
|
||||
Some ideas are taken from the following documents:
|
||||
1. Recommended C Style and Coding Standards (Indian Hill Style Guide)
|
||||
www.doc.ic.ac.uk/lab/secondyear/cstyle/cstyle.html
|
||||
2. Programming in C++, Ellemtel Telecommunication Systems Laboratories
|
||||
www.it.bton.ac.uk/burks/burks/language/cpp/cppstyle/ellhome.htm
|
||||
3. C++ Coding Standard, Todd Hoff
|
||||
www.possibility.com/Cpp/CppCodingStandard.html
|
||||
|
||||
The splint error format is taken from the file splint.vim (Vim standard
|
||||
distribution).
|
||||
|
||||
------------------
|
||||
|
||||
... finally
|
||||
|
||||
Johann Wolfgang von Goethe (1749-1832), the greatest of the German poets,
|
||||
about LINUX, Vim/gVim and other great tools (Ok, almost.) :
|
||||
|
||||
Ein Mann, der recht zu wirken denkt, Who on efficient work is bent,
|
||||
Muß auf das beste Werkzeug halten. Must choose the fittest instrument.
|
||||
|
||||
Faust, Teil 1, Vorspiel auf dem Theater Faust, Part 1, Prologue for the Theatre
|
||||
|
||||
================================================================================
|
204
vim_plugins_src/cvim/c-support/codesnippets/Makefile
Normal file
204
vim_plugins_src/cvim/c-support/codesnippets/Makefile
Normal file
@ -0,0 +1,204 @@
|
||||
#===============================================================================
|
||||
#
|
||||
# Filename: Makefile
|
||||
# Description:
|
||||
#
|
||||
# Usage: make (generate executable )
|
||||
# make clean (remove objects, executable, prerequisits )
|
||||
# make tarball (generate compressed archive )
|
||||
# make zip (generate compressed archive )
|
||||
#
|
||||
# Version: 1.0
|
||||
# Created:
|
||||
# Revision: ---
|
||||
#
|
||||
# Author:
|
||||
# Company:
|
||||
# Email:
|
||||
#
|
||||
# Notes: This is a GNU make (gmake) makefile.
|
||||
# C extension : c
|
||||
# C++ extensions : cc cpp C
|
||||
# C and C++ sources can be mixed.
|
||||
# Prerequisites are generated automatically; makedepend is not
|
||||
# needed (see documentation for GNU make Version 3.81, April 2006,
|
||||
# section 4.13). The utility sed is used.
|
||||
#========================================== makefile template version 1.9 ======
|
||||
|
||||
# DEBUG can be set to YES to include debugging info, or NO otherwise
|
||||
DEBUG := YES
|
||||
|
||||
# PROFILE can be set to YES to include profiling info, or NO otherwise
|
||||
PROFILE := NO
|
||||
|
||||
# ------------ name of the executable ----------------------------------------
|
||||
EXECUTABLE := main
|
||||
|
||||
# ------------ list of all source files --------------------------------------
|
||||
SOURCES := main.c
|
||||
|
||||
# ------------ compiler ------------------------------------------------------
|
||||
CC := gcc
|
||||
CXX := g++
|
||||
|
||||
# ------------ compiler flags ------------------------------------------------
|
||||
DEBUG_CFLAGS := -Wall -ansi -pedantic -O0 -g
|
||||
RELEASE_CFLAGS := -Wall -ansi -pedantic -O3
|
||||
|
||||
# ------------ linker flags --------------------------------------------------
|
||||
DEBUG_LDFLAGS := -g
|
||||
RELEASE_LDFLAGS :=
|
||||
|
||||
ifeq (YES, ${DEBUG})
|
||||
CFLAGS := ${DEBUG_CFLAGS}
|
||||
CXXFLAGS := ${DEBUG_CXXFLAGS}
|
||||
LDFLAGS := ${DEBUG_LDFLAGS}
|
||||
else
|
||||
CFLAGS := ${RELEASE_CFLAGS}
|
||||
CXXFLAGS := ${RELEASE_CXXFLAGS}
|
||||
LDFLAGS := ${RELEASE_LDFLAGS}
|
||||
endif
|
||||
|
||||
ifeq (YES, ${PROFILE})
|
||||
CFLAGS := ${CFLAGS} -pg -O3
|
||||
CXXFLAGS := ${CXXFLAGS} -pg -O3
|
||||
LDFLAGS := ${LDFLAGS} -pg
|
||||
endif
|
||||
|
||||
# ------------ additional system include directories -------------------------
|
||||
GLOBAL_INC_DIR =
|
||||
|
||||
# ------------ private include directories -----------------------------------
|
||||
LOCAL_INC_DIR = $(HOME)/include
|
||||
|
||||
# ------------ system libraries (e.g. -lm ) ---------------------------------
|
||||
SYS_LIBS = -lm
|
||||
|
||||
# ------------ additional system library directories -------------------------
|
||||
GLOBAL_LIB_DIR =
|
||||
|
||||
# ------------ additional system libraries -----------------------------------
|
||||
GLOBAL_LIBS =
|
||||
|
||||
# ------------ private library directories -----------------------------------
|
||||
LOCAL_LIB_DIR = $(HOME)/lib
|
||||
|
||||
# ------------ private libraries (e.g. libxyz.a ) ---------------------------
|
||||
LOCAL_LIBS =
|
||||
|
||||
# ------------ archive generation ---------------------------------------------
|
||||
TARBALL_EXCLUDE = *.{o,gz,zip}
|
||||
ZIP_EXCLUDE = *.{o,gz,zip}
|
||||
|
||||
# ------------ run executable out of this Makefile (yes/no) -----------------
|
||||
# ------------ cmd line parameters for this executable -----------------------
|
||||
EXE_START = no
|
||||
EXE_CMDLINE =
|
||||
|
||||
#===============================================================================
|
||||
# The following statements usually need not to be changed
|
||||
#===============================================================================
|
||||
|
||||
C_SOURCES = $(filter %.c, $(SOURCES))
|
||||
CPP_SOURCES = $(filter-out %.c, $(SOURCES))
|
||||
ALL_INC_DIR = $(addprefix -I, $(LOCAL_INC_DIR) $(GLOBAL_INC_DIR))
|
||||
ALL_LIB_DIR = $(addprefix -L, $(LOCAL_LIB_DIR) $(GLOBAL_LIB_DIR))
|
||||
GLOBAL_LIBSS = $(addprefix $(GLOBAL_LIB_DIR)/, $(GLOBAL_LIBS))
|
||||
LOCAL_LIBSS = $(addprefix $(LOCAL_LIB_DIR)/, $(LOCAL_LIBS))
|
||||
ALL_CFLAGS = $(CFLAGS) $(ALL_INC_DIR)
|
||||
ALL_LFLAGS = $(LDFLAGS) $(ALL_LIB_DIR)
|
||||
BASENAMES = $(basename $(SOURCES))
|
||||
|
||||
# ------------ generate the names of the object files ------------------------
|
||||
OBJECTS = $(addsuffix .o,$(BASENAMES))
|
||||
|
||||
# ------------ generate the names of the hidden prerequisite files -----------
|
||||
PREREQUISITES = $(addprefix .,$(addsuffix .d,$(BASENAMES)))
|
||||
|
||||
# ------------ make the executable (the default goal) ------------------------
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
ifeq ($(strip $(CPP_SOURCES)),)
|
||||
$(CC) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS)
|
||||
else
|
||||
$(CXX) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS)
|
||||
endif
|
||||
ifeq ($(EXE_START),yes)
|
||||
./$(EXECUTABLE) $(EXE_CMDLINE)
|
||||
endif
|
||||
|
||||
# ------------ include the automatically generated prerequisites -------------
|
||||
# ------------ if target is not clean, tarball or zip -------------
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(MAKECMDGOALS),tarball)
|
||||
ifneq ($(MAKECMDGOALS),zip)
|
||||
-include $(PREREQUISITES)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# ------------ make the objects ----------------------------------------------
|
||||
%.o: %.c
|
||||
$(CC) -c $(ALL_CFLAGS) $<
|
||||
|
||||
%.o: %.cc
|
||||
$(CXX) -c $(ALL_CFLAGS) $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(ALL_CFLAGS) $<
|
||||
|
||||
%.o: %.C
|
||||
$(CXX) -c $(ALL_CFLAGS) $<
|
||||
|
||||
# ------------ make the prerequisites ----------------------------------------
|
||||
#
|
||||
.%.d: %.c
|
||||
@$(make-prerequisite-c)
|
||||
|
||||
.%.d: %.cc
|
||||
@$(make-prerequisite-cplusplus)
|
||||
|
||||
.%.d: %.cpp
|
||||
@$(make-prerequisite-cplusplus)
|
||||
|
||||
.%.d: %.C
|
||||
@$(make-prerequisite-cplusplus)
|
||||
|
||||
# canned command sequences
|
||||
# echoing of the sed command is suppressed by the leading @
|
||||
|
||||
define make-prerequisite-c
|
||||
@$(CC) -MM $(ALL_CFLAGS) $< > $@.$$$$; \
|
||||
sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$;
|
||||
endef
|
||||
|
||||
define make-prerequisite-cplusplus
|
||||
@$(CXX) -MM $(ALL_CFLAGS) $< > $@.$$$$; \
|
||||
sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$;
|
||||
endef
|
||||
|
||||
# ------------ remove generated files ----------------------------------------
|
||||
# ------------ remove hidden backup files ------------------------------------
|
||||
clean:
|
||||
-rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES) *~
|
||||
|
||||
# ------------ tarball generation ----------------------------------------------
|
||||
tarball:
|
||||
@lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \
|
||||
rm --force $$lokaldir.tar.gz; \
|
||||
tar --exclude=$(TARBALL_EXCLUDE) \
|
||||
--create \
|
||||
--gzip \
|
||||
--verbose \
|
||||
--file $$lokaldir.tar.gz *
|
||||
|
||||
# ------------ zip -------------------------------------------------------------
|
||||
zip:
|
||||
@lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \
|
||||
zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE)
|
||||
|
||||
.PHONY: clean tarball zip
|
||||
|
||||
# ==============================================================================
|
||||
# vim: set tabstop=2: set shiftwidth=2:
|
@ -0,0 +1,70 @@
|
||||
#===============================================================================
|
||||
#
|
||||
# File: Makefile
|
||||
# Description:
|
||||
#
|
||||
# Usage: make (generate executable(s) )
|
||||
# make clean (remove objects, executables, prerequisits )
|
||||
# make tarball (generate compressed archive )
|
||||
# make zip (generate compressed archive )
|
||||
#
|
||||
# Author: Dr.-Ing. Fritz Mehner
|
||||
# Email: mehner@mfh-iserlohn.de
|
||||
# Created:
|
||||
#
|
||||
#===============================================================================
|
||||
|
||||
|
||||
CC = gcc
|
||||
CCP = g++
|
||||
CFLAGS = -c -g -Wall
|
||||
LFLAGS = -g
|
||||
SYS_LIBS = -lm
|
||||
TARBALL_EXCLUDE = "*.{o,gz,zip}"
|
||||
ZIP_EXCLUDE = *.o *.gz *.zip
|
||||
|
||||
TARGETS = target_1 target_2
|
||||
|
||||
#---------- targets --------------------------------------
|
||||
all: $(TARGETS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $*.c
|
||||
|
||||
%.o: %.cc
|
||||
$(CCP) $(CFLAGS) $*.cc
|
||||
|
||||
#---------- target 1 -------------------------------------
|
||||
# C target
|
||||
target_1: target_1.o
|
||||
$(CC) $(LFLAGS) -o $@ $@.o $(SYS_LIBS)
|
||||
|
||||
#---------- target 2 -------------------------------------
|
||||
# C++ target
|
||||
target_2: target_2.o
|
||||
$(CCP) $(LFLAGS) -o $@ $@.o $(SYS_LIBS)
|
||||
|
||||
|
||||
#---------- target 3 -------------------------------------
|
||||
|
||||
|
||||
|
||||
#---------- tarball --------------------------------------
|
||||
tarball:
|
||||
lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \
|
||||
rm --force $$lokaldir.tar.gz; \
|
||||
tar --exclude=$(TARBALL_EXCLUDE) \
|
||||
--create \
|
||||
--gzip \
|
||||
--verbose \
|
||||
--file $$lokaldir.tar.gz *
|
||||
|
||||
#---------- zip ------------------------------------------
|
||||
zip:
|
||||
lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \
|
||||
zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE)
|
||||
|
||||
#---------- clear up -------------------------------------
|
||||
clean:
|
||||
rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES)
|
||||
|
@ -0,0 +1,36 @@
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: calloc_double_matrix
|
||||
* Description: Allocate a dynamic double-matrix of size rows*columns;
|
||||
* return a pointer.
|
||||
* =====================================================================================
|
||||
*/
|
||||
double**
|
||||
calloc_double_matrix ( int rows, int columns )
|
||||
{
|
||||
int i;
|
||||
double **m;
|
||||
m = calloc ( rows, sizeof(double*) ); /* allocate pointer array */
|
||||
assert( m != NULL ); /* abort if allocation failed */
|
||||
*m = calloc ( rows*columns, sizeof(double) );/* allocate data array */
|
||||
assert(*m != NULL ); /* abort if allocation failed */
|
||||
for ( i=1; i<rows; i+=1 ) /* set pointers */
|
||||
m[i] = m[i-1] + columns;
|
||||
return m;
|
||||
} /* ---------- end of function calloc_double_matrix ---------- */
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: free_matrix_double
|
||||
* Description: Free a dynamic double-matrix.
|
||||
* =====================================================================================
|
||||
*/
|
||||
void
|
||||
free_double_matrix ( double **m )
|
||||
{
|
||||
free(*m); /* free data array */
|
||||
free( m); /* free pointer array */
|
||||
return ;
|
||||
} /* ---------- end of function free_double_matrix ---------- */
|
||||
|
@ -0,0 +1,35 @@
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: calloc_int_matrix
|
||||
* Description: Allocate a dynamic int-matrix of size rows*columns; return a pointer.
|
||||
* =====================================================================================
|
||||
*/
|
||||
int**
|
||||
calloc_int_matrix ( int rows, int columns )
|
||||
{
|
||||
int i;
|
||||
int **m;
|
||||
m = calloc ( rows, sizeof(int*) ); /* allocate pointer array */
|
||||
assert( m != NULL ); /* abort if allocation failed */
|
||||
*m = calloc ( rows*columns, sizeof(int) ); /* allocate data array */
|
||||
assert(*m != NULL ); /* abort if allocation failed */
|
||||
for ( i=1; i<rows; i+=1 ) /* set pointers */
|
||||
m[i] = m[i-1] + columns;
|
||||
return m;
|
||||
} /* ---------- end of function calloc_int_matrix ---------- */
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: free_int_matrix
|
||||
* Description: Free a dynamic int-matrix.
|
||||
* =====================================================================================
|
||||
*/
|
||||
void
|
||||
free_int_matrix ( int **m )
|
||||
{
|
||||
free(*m); /* free data array */
|
||||
free( m); /* free pointer array */
|
||||
return ;
|
||||
} /* ---------- end of function free_int_matrix ---------- */
|
||||
|
20
vim_plugins_src/cvim/c-support/codesnippets/main.c
Normal file
20
vim_plugins_src/cvim/c-support/codesnippets/main.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: main
|
||||
* Description: main function
|
||||
* =====================================================================================
|
||||
*/
|
||||
int
|
||||
main ( int argc, char *argv[] )
|
||||
{
|
||||
printf ("\nProgram %s\n\n", argv[0] );
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
} /* ---------- end of function main ---------- */
|
||||
|
19
vim_plugins_src/cvim/c-support/codesnippets/main.cc
Normal file
19
vim_plugins_src/cvim/c-support/codesnippets/main.cc
Normal file
@ -0,0 +1,19 @@
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// === FUNCTION ======================================================================
|
||||
// Name: main
|
||||
// Description: main function
|
||||
// =====================================================================================
|
||||
int
|
||||
main ( int argc, char *argv[] )
|
||||
{
|
||||
cout << "\nProgram " << argv[0] << endl << endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
} // ---------- end of function main ----------
|
||||
|
@ -0,0 +1,28 @@
|
||||
// === FUNCTION ======================================================================
|
||||
// Name: print_array
|
||||
// Description: Print an array with one dimension.
|
||||
// Use
|
||||
// print_array<T,width,precision>( *matrix, n1*n2, n2, "matrix" );
|
||||
// for
|
||||
// T matrix[n1][n2];
|
||||
// =====================================================================================
|
||||
template < class T, unsigned width, unsigned precision >
|
||||
void print_array ( T *array, // array to print
|
||||
int n, // number of elements to print
|
||||
int nrow, // number of elements per row
|
||||
string arrayname // array name
|
||||
)
|
||||
{
|
||||
string line(" index | content\n ------+-");
|
||||
|
||||
cout << "\n\n array \"" << arrayname << "\", length " << n << endl << endl;
|
||||
cout << line.append(width*nrow, '-');
|
||||
for ( int i=0; i<n; i+=1 ) {
|
||||
if( i%nrow == 0 )
|
||||
cout << endl << setw(6) << i << " | ";
|
||||
cout << setw(width) << fixed << setprecision(precision) << array[i];
|
||||
}
|
||||
cout << endl << endl;
|
||||
return ;
|
||||
} // ---------- end of function print_double_array ----------
|
||||
|
@ -0,0 +1,35 @@
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: print_double_array
|
||||
* Description: Print a double-array with one dimension.
|
||||
* Use
|
||||
* print_double_array( *matrix, n1*n2, n2, "matrix" );
|
||||
* for
|
||||
* double matrix[n1][n2];
|
||||
* =====================================================================================
|
||||
*/
|
||||
static void
|
||||
print_double_array ( double array[], /* array to print */
|
||||
int n, /* number of elements to print */
|
||||
int nrow, /* number of elements per row */
|
||||
char *arrayname /* array name */
|
||||
)
|
||||
{
|
||||
int i, width = 8, precision = 4;
|
||||
char frmt[10];
|
||||
sprintf( frmt, " %%%d.%dlf", width, precision );
|
||||
printf ("\n\n array \"%s\", length %d\n", arrayname, n );
|
||||
printf ("\n index | content\n" );
|
||||
printf ( " ------+-" );
|
||||
for ( i = 0; i < nrow*( 1+width ); i += 1 )
|
||||
putchar('-');
|
||||
for ( i=0; i<n; i+=1 )
|
||||
{
|
||||
if( i%nrow == 0 )
|
||||
printf ("\n%6d | ", i );
|
||||
printf ( frmt, array[i] );
|
||||
}
|
||||
printf ("\n\n");
|
||||
return ;
|
||||
} /* ---------- end of function print_double_array ---------- */
|
@ -0,0 +1,36 @@
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: print_int_array
|
||||
* Description: Print an int-array with one dimension.
|
||||
* Use
|
||||
* print_int_array( *matrix, n1*n2, n2, "matrix" );
|
||||
* for
|
||||
* int matrix[n1][n2];
|
||||
* =====================================================================================
|
||||
*/
|
||||
static void
|
||||
print_int_array ( int array[], /* array to print */
|
||||
int n, /* number of elements to print */
|
||||
int nrow, /* number of elements per row */
|
||||
char *arrayname /* array name */
|
||||
)
|
||||
{
|
||||
int i, width = 4;
|
||||
char frmt[10];
|
||||
sprintf( frmt, " %%%dd", width );
|
||||
printf ("\n\n array \"%s\", length %d\n", arrayname, n );
|
||||
printf ("\n index | content\n" );
|
||||
printf ( " ------+-" );
|
||||
for ( i = 0; i < nrow*( 2+width ); i += 1 )
|
||||
putchar('-');
|
||||
for ( i=0; i<n; i+=1 )
|
||||
{
|
||||
if( i%nrow == 0 )
|
||||
printf ( "\n%6d | ", i );
|
||||
printf ( frmt, array[i] );
|
||||
}
|
||||
printf ("\n\n");
|
||||
return ;
|
||||
} /* ---------- end of function print_int_array ---------- */
|
||||
|
470
vim_plugins_src/cvim/c-support/doc/ChangeLog
Normal file
470
vim_plugins_src/cvim/c-support/doc/ChangeLog
Normal file
@ -0,0 +1,470 @@
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.16.1
|
||||
================================================================================
|
||||
- Bugfix: problem with a system-wide installation under Windows (thanks to Ricardo Vrech).
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.16
|
||||
================================================================================
|
||||
- Plugin loads faster: loading the templates is delayed until the first use.
|
||||
- Plugin now works with pathogen.vim.
|
||||
- Menus will always be generated (for the use with :emenu).
|
||||
- Bugfix: no local templates available with a system-wide installation (thanks to Iain Arnell).
|
||||
- Several improvements.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.15
|
||||
================================================================================
|
||||
- New hotkey \cx C to C++ comments and vice versa.
|
||||
- Several hotkeys allow a range, e.g. '3\cl' (see help text and c-hotkey.pdf).
|
||||
- Improved prototype picking: \nf, \np picks up a function prototype,
|
||||
\nm picks up a method prototype (see documentation for more).
|
||||
- include-statements will now be inserted in the actual line (before: new line
|
||||
below the actual line).
|
||||
- Several minor improvements.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.14
|
||||
================================================================================
|
||||
- A makefile can be run with C-F9
|
||||
- Linking ( Run menu, \rl, \rr ) will be suppressed if buffer contains no main function.
|
||||
- Bugfix: correctly deactivate unwanted compiler messages in a quickfix buffer.
|
||||
- Several minor improvements
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.13
|
||||
================================================================================
|
||||
- New hotkeys \rmc (run 'make clean') and \rme (executable to run).
|
||||
- Hotkeys for make are working when in a makefile.
|
||||
- Linker errors and errors during a make will be shown in a quickfix buffer.
|
||||
- Bugfix: detection of a systemwide installation can fail.
|
||||
- Bugfix: preprocessor directive '#if 0 #endif' not working.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.12
|
||||
================================================================================
|
||||
- New hotkeys \+" .
|
||||
- Windows: user installation now possible.
|
||||
- Bugfixe: for-idiom shows part of type definition as variable name in some cases.
|
||||
- Bugfixe: wrong cursor position for some templates.
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.11
|
||||
================================================================================
|
||||
- New tag {CURSOR} to avoid indent problems in a few cases.
|
||||
- Three hotkeys renamed \rg -> \rma , \ri -> \rpa , \re -> \rka (better to remember).
|
||||
- 'long long' added to the for-idioms.
|
||||
- Bugfixes: for-idiom shows type as variable name if no variable name was given.
|
||||
- Bugfixes: for-idiom inserts standard types with 2+ words wrong.
|
||||
- Bugfixes: multiline end-of-line comments have wrong position in some cases.
|
||||
- Bugfixes: local installation looks like a system-wide installation in seldom cases.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.10
|
||||
================================================================================
|
||||
- The plugin now handles different template styles without editing and
|
||||
reloading the main template file.
|
||||
- The number of template styles is not limited.
|
||||
- New hotkey and ex-command to switch template styles.
|
||||
- Template styles can automatically be related to file extensions.
|
||||
- indent(1) errors will be presented in a quickfix error window.
|
||||
- Comment alignment improved.
|
||||
- Minor improvements.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.9
|
||||
================================================================================
|
||||
+ Two additional hotkeys (+ ex commands) for preprocessor statements.
|
||||
+ Compile-link-run: improved error detection.
|
||||
+ Menu Run: hardcopy can print any buffer.
|
||||
+ Several minor improvements and bugfixes.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.8
|
||||
================================================================================
|
||||
+ Hotkeys are shown in the menus.
|
||||
+ File browser for code snippets and templates choosable (2 global variables).
|
||||
+ Two new hotkeys: include file description (implementation, header).
|
||||
+ New menu item: namespace alias
|
||||
+ Bugfix: wrapper script for use of a xterm could not handle parameters containing blanks.
|
||||
+ Several minor improvements.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.7
|
||||
================================================================================
|
||||
+ 4 new hotkeys : insert file section comments (C/C++/H), special comments,
|
||||
keyword comments.
|
||||
+ Adjusting end-of-line comment adjustment improved.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.6
|
||||
================================================================================
|
||||
+ Jump targets (templates) and mapping Ctrl-j can be switched off.
|
||||
+ Yet unused jump targets will be highlighted after a file is opened.
|
||||
+ Statements menu: else block (key mapping \se).
|
||||
+ Handling of <SPLIT> improved (templates).
|
||||
+ Minor improvements.
|
||||
|
||||
================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.5
|
||||
================================================================================
|
||||
+ Additional plugin-tags (jump targets in templates): <+text+>, <-text->.
|
||||
+ Additional mapping Ctrl-j : jump to these new targets.
|
||||
+ Template-file: additional macro |STYLE| and IF-ENDIF-construct to easily
|
||||
choose between sets of templates.
|
||||
+ Additional mapping: auto-complete classical C comment (also multi-line).
|
||||
+ Additional mapping: auto-complete open block starting with {<CR> .
|
||||
+ Visual mode for date and time insertion (menu 'Comments').
|
||||
+ Visual mode for tags (submenu 'Comments->tags (plugin)').
|
||||
+ Bugfix: hotkey \ica not working
|
||||
+ Bugfix: hotkey Shift-F2 for the alternate-plugin disappeared.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.4
|
||||
=======================================================================================
|
||||
+ New hotkey \+co inserts ' cout << << endl;'
|
||||
+ New menu item C++-menu: 'cout' replaces 'cout variable' and 'cout string'.
|
||||
+ Hotkey \c/ removed ( \cc does the same).
|
||||
+ Bugfix: after an unsuccessful compilation screen sometimes garbled.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.3
|
||||
=======================================================================================
|
||||
+ Insertions work properly when folding is used.
|
||||
+ Menu items Idioms->for(...) : type declaration for loop variable possible (tab completion).
|
||||
+ Specification of command line arguments (Run->cmd. line arg.): filename completion active.
|
||||
+ New main menu item 'show manual' (hotkey \hm): read manual for word under cursor.
|
||||
+ One hotkey renamed: \h -> \hp (help plugin)
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.2.1
|
||||
=======================================================================================
|
||||
+ Bugfix: stray characters whith three dialogs
|
||||
+ Bugfix: Missing parameter in 2 internal function calls
|
||||
+ Menu items 'Snippets->edit local/global templates' start an file browser (convenience).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.2
|
||||
=======================================================================================
|
||||
+ Superfluous control characters for mode switching (menus, hotkeys) removed. Caused beeps.
|
||||
+ Template files (local/global) can be opened from the snippet menu.
|
||||
+ Three new preprocessor statements.
|
||||
+ v-mode for RTTI-entries.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.1
|
||||
=======================================================================================
|
||||
+ Definition and implementation of classes have now different templates and menu entries.
|
||||
+ Accessor methods (get/set) can be generated.
|
||||
+ New templates: everything other than language keywords comes from a template
|
||||
(and is user changeable).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0.5
|
||||
=======================================================================================
|
||||
+ Bugfix: on a few systems doubling of path components in the run command (F9).
|
||||
Skip this upgrade if you do not have this problem.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0.4
|
||||
=======================================================================================
|
||||
+ Format for the macros |DATE|, |TIME|, and |YEAR| can be defined by the user.
|
||||
+ Help text improved.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0.3
|
||||
=======================================================================================
|
||||
+ Code snippets can now be used in the console mode (Vim without GUI).
|
||||
+ Bugfix: Possible conflict with 'indent' removed when inserting templates.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0.2
|
||||
=======================================================================================
|
||||
+ Bugfix: Prototype picker did not alway delete no longer used prototypes.
|
||||
+ Bugfix: Prototype picker removed template specializations from parameter lists.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0.1
|
||||
=======================================================================================
|
||||
+ Bugfix: autocmd setting can influence autocmd settings of OTHER plugins.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 5.0
|
||||
=======================================================================================
|
||||
+ Completely new template system. Now every menu item is user definable.
|
||||
+ Changes to allow a system-wide installation.
|
||||
+ A few hotkeys added and renamed.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.6.1
|
||||
=======================================================================================
|
||||
+ New global variable to control the filetype of *.h header files (default is now 'cpp').
|
||||
+ Bugfix: properly resetting 'compiler' after using make, splint, and CodeCheck.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.6
|
||||
=======================================================================================
|
||||
+ New insert mode mappings (comments, statements, preprocessing, idioms, C++).
|
||||
+ Some mappings renamed (easier to remember).
|
||||
+ New tag (basename of a file reduced to characters allowed in names).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.5
|
||||
=======================================================================================
|
||||
+ New menu item and hotkey for the (re)alignement of end-of-line comments.
|
||||
+ Hotkey \cn removed. Only one menu item for end-of-line comments left.
|
||||
+ Changed hotkeys: \ce -> \cl and \cl -> \cs .
|
||||
+ Three new tags (giving the basename of a file) for writing template files.
|
||||
+ Prototype picker handles template methods.
|
||||
+ Bugfix: splint works now under Windows.
|
||||
+ Minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.4
|
||||
=======================================================================================
|
||||
+ Plugin directories rearranged.
|
||||
+ main- and for-idiom have a visual mode now.
|
||||
+ Four new commands (command line) to control the comment style.
|
||||
+ Comment style (C/C++) can automatically follow the filetype.
|
||||
+ Bugfix: empty new file after removing the header template can't be closed.
|
||||
+ Bugfix : Tools entry missing when root menu not shown from the start.
|
||||
+ Minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.3
|
||||
=======================================================================================
|
||||
+ CodeCheck (TM) integrated (source code analysing tool).
|
||||
+ New key mappings for preprocessor statements.
|
||||
+ New preprocessor menu.
|
||||
+ Bugfix: indent under Windows.
|
||||
+ Minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.2.1
|
||||
=======================================================================================
|
||||
+ Bugfix: change needed for some menu names after patch 7.0.054 .
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.2
|
||||
=======================================================================================
|
||||
+ Setting the starting column for trailing comments improved.
|
||||
+ Small bug in block uncommenting fixed.
|
||||
+ Mac OS X : circumvent a Vim bug which caused a crash when loading plugin version 4.1.
|
||||
+ File syntax/c.vim removed (but see help in csupport.txt).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.1
|
||||
=======================================================================================
|
||||
+ A complete switch statement can be made from a list of labels.
|
||||
+ Additional cases can be made from a list of labels.
|
||||
+ Small bug in line end commenting fixed.
|
||||
+ Some minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 4.0
|
||||
=======================================================================================
|
||||
|
||||
+ Kernighan & Ritchie style for block statements can be enabled.
|
||||
+ Changes to make it compatible with Vim 7.
|
||||
+ Set C/C++ file type for source files which should not be preprocessed (*.i, *.ii).
|
||||
+ Some minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.11
|
||||
=======================================================================================
|
||||
|
||||
+ Hotkeys and an accompanying reference card added.
|
||||
+ Preparation for syntax based folding.
|
||||
+ Some minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.10
|
||||
=======================================================================================
|
||||
|
||||
+ Remove "#if 0 ... #endif" from the inside.
|
||||
+ Change C comments to C++ comments and vice versa.
|
||||
+ try..catch / catch / catch(...) now can be set surround a marked area.
|
||||
+ Prototype picking improved (for C++).
|
||||
+ A hardcopy shows the localized date and time in the header line.
|
||||
+ New help menu entry in the main menu of this plugin (shows the plugin documentation).
|
||||
+ Switch between corresponding source and header files with <S-F2> if the plugin a.vim
|
||||
is present.
|
||||
+ Plugin can be used with autocompletion for (, [, and { .
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.9.1
|
||||
=======================================================================================
|
||||
|
||||
+ Doubling of file header for new c- and h-files under Windows fixed (Thanks to
|
||||
Fabricio C A Oliveira).
|
||||
+ Tiny bug in the file open idioms fixed.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.9
|
||||
=======================================================================================
|
||||
|
||||
+ Formatter 'indent' integrated.
|
||||
+ Bugfix in the automatic header insertion.
|
||||
+ Assert idiom added.
|
||||
+ #if 0 ... #endif statement for blocking out code added.
|
||||
+ Minor stylistic improvements in some idioms.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.8.2
|
||||
=======================================================================================
|
||||
|
||||
+ Screen update problem solved: color inversion under FC4 (Thanks to Bernie Barton).
|
||||
+ RTTI menu : additional v-mode.
|
||||
+ Statement menu and C++ menu rearranged.
|
||||
+ Include guard : name generation improved.
|
||||
+ File header templates will be included for additional file extensions (cp, cxx, c++, ...).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.8.1
|
||||
=======================================================================================
|
||||
|
||||
+ More C++ output manipulators, manipulator insertion more intuitive.
|
||||
+ Output into buffer: cursor goes to top of file.
|
||||
+ Makefile template improved (code snippet).
|
||||
+ Some internal improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.8
|
||||
=======================================================================================
|
||||
|
||||
+ Windows support. Most features are now available under Windows.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.7.2
|
||||
=======================================================================================
|
||||
|
||||
+ Run buffer through splint (A tool for statically checking C programs; see
|
||||
http://www.splint.org). An error window will be opened; quickfix commands can be used.
|
||||
+ Set buffer related command line arguments for splint.
|
||||
+ Line end comments start in a fixed column (can be set from the menu).
|
||||
+ Spaces in path names and file names are now possible.
|
||||
+ Template files and snippet files are no longer kept in the list of alternate files.
|
||||
+ Some minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.7.1
|
||||
=======================================================================================
|
||||
|
||||
+ Bug fixed (command line arguments not passed to the executable).
|
||||
+ File extension for executables can be set.
|
||||
+ Minor improvements.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.7
|
||||
=======================================================================================
|
||||
|
||||
+ Running a program:
|
||||
(1) Run program from the gVim command line.
|
||||
(2) Run program and direct the output into a window with name "C-Output".
|
||||
This buffer and its content will disappear when closing the window.
|
||||
The buffer is reused when still open.
|
||||
(3) Run program in an xterm (adjustable).
|
||||
+ Command line arguments are now buffer related (each buffer can have its own arguments).
|
||||
+ Code snippets can be protected from being indented during insertion.
|
||||
+ Picked up prototypes will be deleted after insertion.
|
||||
+ A code snippet with the file name extension "ni" or "noindent" will not be
|
||||
indented on insertion.
|
||||
+ for- and calloc-/malloc-idioms improved.
|
||||
+ Bug fixed (word list handling).
|
||||
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.6
|
||||
=======================================================================================
|
||||
|
||||
+ Installation simplified.
|
||||
+ for-loop-idiom asks for control variable, initial value, ...
|
||||
+ malloc-idiom asks for pointer variable and size.
|
||||
+ Toggling the comment style works correct again.
|
||||
+ Empty error windows will be closed.
|
||||
+ Prototype picker removes trailing parts of the function body if marked.
|
||||
+ The dialog windows (GUI) have been replaced by more flexible command line inputs.
|
||||
+ The undocumented and unnecessary hot key F12 has been removed.
|
||||
+ Extension to ctags + taglist shows makefile targets and qmake targets.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.5
|
||||
=======================================================================================
|
||||
|
||||
+ Aligned line end comments for consecutive lines.
|
||||
+ Improved prototype picker removes comments.
|
||||
+ Picked up prototypes can be shown.
|
||||
+ Uncomment more than one block at once.
|
||||
+ 3 new idioms.
|
||||
+ Help file improved .
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.4
|
||||
=======================================================================================
|
||||
|
||||
+ Two new global variables: C_Dictionary_File, C_MenuHeader .
|
||||
+ The preprocessor statements #if... and the function idiom include marked
|
||||
lines when invoked in visual mode.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.3
|
||||
=======================================================================================
|
||||
|
||||
+ The C/C++ root menu can be disabled.
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.2
|
||||
=======================================================================================
|
||||
|
||||
+ Only one C/C++ entry in the gVim root menu.
|
||||
+ All hotkeys are only defined for C/C++ files (file type plugin added).
|
||||
+ The following constructs are now read as templates from files:
|
||||
class, class using new,
|
||||
template class, template class using new,
|
||||
error class
|
||||
+ Install script added.
|
||||
+ Customization improved.
|
||||
+ Documentation improved (help file added).
|
||||
+ Bug fix (template file handling)
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.1
|
||||
=======================================================================================
|
||||
|
||||
+ When the comment style "C" is active the menu entry "Comments.code->comment"
|
||||
turns a marked region in one multiline C-comment.
|
||||
+ The menu entry "Comments.comment->code" turns marked multiline C-comment
|
||||
back into code.
|
||||
+ A marked region can be surrounded by a for-, if, if-else, while-, do-while-statement
|
||||
(with indentation).
|
||||
+ The menu entry "Snippets.make prototype" makes a C- or C++-prototype from
|
||||
the current line or marked region and puts it in an internal buffer.
|
||||
+ The menu entry "Snippets.add prototype" also makes a C- or C++-prototype from
|
||||
the current line or a marked region and adds it to the internal buffer.
|
||||
+ The menu entry "Snippets.put prototype" inserts all gathered prototypes
|
||||
below the current line.
|
||||
+ Tag substitution rewritten (Some characters in a substitution text for a tag
|
||||
prevented the tag from being substituted).
|
||||
|
||||
=======================================================================================
|
||||
RELEASE NOTES FOR VERSION 3.0
|
||||
=======================================================================================
|
||||
|
||||
+ C-style comments AND C++-style comments are supported now.
|
||||
+ The menu entry 'Comments->Comment style ..' switches the styles (toggle).
|
||||
+ Block comments are now read as templates or skeletons from files:
|
||||
Frame Block, Function Description, Method Description,
|
||||
Class Description, H+file header, C/C++-file header
|
||||
+ These templates can contain tags like |FILENAME|, |AUTHOR| etc. which are replaced
|
||||
after reading (KDevelop templates can be used without any change).
|
||||
+ indentation: multiline inserts and code snippets will be indented after insertion.
|
||||
+ Most menu entries are now also active in normal mode.
|
||||
+ new menu items:
|
||||
includes for the C99 header,
|
||||
includes for the standard C++ header,
|
||||
includes for the C++ version of the Standard C Library header,
|
||||
multiline C comment
|
||||
vim modeline
|
||||
+ Reading the templates is done in one function which can be called in an autocmd.
|
||||
+ Code cleanup: register z no longer used. Most function calls are silent now.
|
||||
|
||||
|
BIN
vim_plugins_src/cvim/c-support/doc/c-hotkeys.pdf
Normal file
BIN
vim_plugins_src/cvim/c-support/doc/c-hotkeys.pdf
Normal file
Binary file not shown.
355
vim_plugins_src/cvim/c-support/doc/c-hotkeys.tex
Normal file
355
vim_plugins_src/cvim/c-support/doc/c-hotkeys.tex
Normal file
@ -0,0 +1,355 @@
|
||||
%%=====================================================================================
|
||||
%%
|
||||
%% File: c-hotkeys.tex
|
||||
%%
|
||||
%% Description: c-support.vim : Key mappings for Vim without GUI.
|
||||
%%
|
||||
%%
|
||||
%% Author: Dr.-Ing. Fritz Mehner
|
||||
%% Email: mehner@fh-swf.de
|
||||
%% Copyright: Copyright (C) 2006-2010 Dr.-Ing. Fritz Mehner (mehner@fh-swf.de)
|
||||
%% Version: 1.0
|
||||
%% Created: 10.11.2006
|
||||
%% Revision: $Id: c-hotkeys.tex,v 1.48 2011/12/27 21:09:44 mehner Exp $
|
||||
%%
|
||||
%% Notes:
|
||||
%%
|
||||
%%=====================================================================================
|
||||
|
||||
\documentclass[oneside,11pt,landscape,DIV17]{scrartcl}
|
||||
|
||||
\usepackage[english]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{times}
|
||||
\usepackage{lastpage}
|
||||
\usepackage{multicol}
|
||||
\usepackage{setspace}
|
||||
|
||||
\setlength\parindent{0pt}
|
||||
|
||||
\newcommand{\Pluginversion}{5.17}
|
||||
\newcommand{\ReleaseDate}{ December 2011}
|
||||
\newcommand{\Rep}{{\tiny{[n]}}}
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
%% luximono : Type1-font
|
||||
%% Makes keyword stand out by using semibold letters.
|
||||
%%----------------------------------------------------------------------
|
||||
\usepackage[scaled]{luximono}
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
%% fancyhdr
|
||||
%%----------------------------------------------------------------------
|
||||
\usepackage{fancyhdr}
|
||||
\pagestyle{fancyplain}
|
||||
\fancyfoot[L]{\small \ReleaseDate}
|
||||
\fancyfoot[C]{c-support.vim}
|
||||
\fancyfoot[R]{\small \textbf{Page \thepage{} / \pageref{LastPage}}}
|
||||
\renewcommand{\headrulewidth}{0.0pt}
|
||||
|
||||
%%----------------------------------------------------------------------
|
||||
%% hyperref
|
||||
%%----------------------------------------------------------------------
|
||||
\usepackage[ps2pdf]{hyperref}
|
||||
\hypersetup{pdfauthor={Dr.-Ing. Fritz Mehner, FH Südwestfalen, Iserlohn, Germany}}
|
||||
\hypersetup{pdfkeywords={Vim, C/C++}}
|
||||
\hypersetup{pdfsubject={Vim-plugin, c-support.vim, hot keys}}
|
||||
\hypersetup{pdftitle={Vim-plugin, c-support.vim, hot keys}}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% START OF DOCUMENT
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\begin{document}%
|
||||
|
||||
\begin{multicols}{3}
|
||||
%
|
||||
%%======================================================================
|
||||
%% title
|
||||
%%======================================================================
|
||||
\begin{center}
|
||||
\textbf{\textsc{\small{Vim-Plugin}}}\\
|
||||
\textbf{\LARGE{c-support.vim}}\\
|
||||
\textbf{\textsc{\small{Version \Pluginversion}}}\\
|
||||
\textbf{\textsc{\Huge{Hot keys}}}\\
|
||||
Key mappings for Vim with and without GUI.\\
|
||||
Plugin: http://vim.sourceforge.net\\
|
||||
\vspace{3.0mm}
|
||||
{\normalsize (i)} insert mode, {\normalsize (n)} normal mode, {\normalsize (v)} visual mode\\
|
||||
\vspace{5.0mm}
|
||||
%
|
||||
%%======================================================================
|
||||
%% SIDE 1
|
||||
%%======================================================================
|
||||
%%~~~~~ TABULAR : begin ~~~~~~~~~~
|
||||
\begin{tabular}[]{|p{10mm}|p{60mm}|}
|
||||
%
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{C}omments}} \\
|
||||
\hline \Rep\verb'\cl' & end-of-line comment \hfill (n,v,i)\\
|
||||
\hline \Rep\verb'\cj' & adjust end-of-line comment \hfill (n,v,i)\\
|
||||
\hline \verb'\cs' & set end-of-line comment column \hfill (n) \\
|
||||
\hline \Rep\verb'\c*' & code $\Rightarrow$ comment \verb'/* */' \hfill (n,v) \\
|
||||
\hline \Rep\verb'\cc' & code $\Rightarrow$ comment \verb'//' \hfill (n,v,o)\\
|
||||
\hline \Rep\verb'\co' & comment $\Rightarrow$ code \hfill (n,v,o)\\
|
||||
|
||||
\hline \verb'\cfr' & frame comment \hfill (n,i)\\
|
||||
\hline \verb'\cfu' & function comment \hfill (n,i)\\
|
||||
\hline \verb'\cme' & method description \hfill (n,i)\\
|
||||
\hline \verb'\ccl' & class description \hfill (n,i)\\
|
||||
\hline \verb'\cfdi'& file description (implementation) \hfill (n,i)\\
|
||||
\hline \verb'\cfdh'& file description (header) \hfill (n,i)\\
|
||||
|
||||
\hline \verb'\ccs'& C/C++--file sections\hspace{3mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\
|
||||
\hline \verb'\chs'& H--file sections\hspace{10mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\
|
||||
\hline \verb'\ckc'& keyword comment\hspace{5mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\
|
||||
\hline \verb'\csc'& special comment\hspace{7,5mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\
|
||||
|
||||
\hline \verb'\cd' & date \hfill (n,v,i)\\
|
||||
\hline \verb'\ct' & date \& time \hfill (n,v,i)\\
|
||||
\hline \Rep\verb'\cx' & toggle comments: C $\leftrightarrow$ C++ \hfill (n,v,i)\\
|
||||
\hline
|
||||
\end{tabular}\\
|
||||
%%~~~~~ TABULAR : end ~~~~~~~~~~
|
||||
%
|
||||
%%======================================================================
|
||||
%% table, middle part
|
||||
%%======================================================================
|
||||
%
|
||||
%%~~~~~ TABULAR : begin ~~~~~~~~~~
|
||||
\begin{tabular}[]{|p{15mm}|p{55mm}|}
|
||||
%%----------------------------------------------------------------------
|
||||
%% menu statements
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{S}tatements}} \\
|
||||
\hline \verb'\sd' & \verb'do { } while' \hfill (n,v,i)\\
|
||||
\hline \verb'\sf' & \verb'for' \hfill (n,i)\\
|
||||
\hline \verb'\sfo' & \verb'for { }' \hfill (n,v,i)\\
|
||||
\hline \verb'\si' & \verb'if' \hfill (n,i)\\
|
||||
\hline \verb'\sif' & \verb'if { }' \hfill (n,v,i)\\
|
||||
\hline \verb'\sie' & \verb'if else' \hfill (n,v,i)\\
|
||||
\hline \verb'\sife'& \verb'if { } else { }' \hfill (n,v,i)\\
|
||||
\hline \verb'\se' & \verb'else { }' \hfill (n,v,i)\\
|
||||
\hline \verb'\sw' & \verb'while' \hfill (n,i)\\
|
||||
\hline \verb'\swh' & \verb'while { }' \hfill (n,v,i)\\
|
||||
\hline \verb'\ss' & \verb'switch' \hfill (n,v,i)\\
|
||||
\hline \verb'\sc' & \verb'case' \hfill (n,i)\\
|
||||
\hline \verb'\s{ \sb' & \verb'{ }' \hfill (n,v,i)\\
|
||||
\hline
|
||||
%%----------------------------------------------------------------------
|
||||
%% preprocessor menu
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{P}reprocessor}} \\
|
||||
\hline \verb'\ps' & choose a Std. Lib. include \hfill (n,i)\\
|
||||
\hline \verb'\pc' & choose a C99 include \hfill (n,i)\\
|
||||
\hline \verb'\p<' & \verb$#include<...>$ \hfill (n,i)\\
|
||||
\hline \verb'\p"' & \verb$#include"..."$ \hfill (n,i)\\
|
||||
\hline \verb'\pd' & \verb'#define' \hfill (n,i)\\
|
||||
\hline \verb'\pu' & \verb'#undef' \hfill (n,i)\\
|
||||
\hline \verb'\pif' & \verb'#if #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pie' & \verb'#if #else #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pid' & \verb'#ifdef #else #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pin' & \verb'#ifndef #else #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pind' & \verb'#ifndef #def #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pi0' & \verb'#if 0 #endif' \hfill (n,v,i)\\
|
||||
\hline \verb'\pr0' & remove \verb'#if 0 #endif' \hfill (n,i)\\
|
||||
\hline \verb'\pe' & \verb'#error ' \hfill (n,i)\\
|
||||
\hline \verb'\pl' & \verb'#line ' \hfill (n,i)\\
|
||||
\hline \verb'\pp' & \verb'#pragma' \hfill (n,i)\\
|
||||
\hline
|
||||
\end{tabular} \\
|
||||
%%~~~~~ TABULAR : end ~~~~~~~~~~
|
||||
|
||||
%%======================================================================
|
||||
%% table, right part
|
||||
%%======================================================================
|
||||
%
|
||||
%%~~~~~ TABULAR : begin ~~~~~~~~~~
|
||||
\begin{tabular}[]{|p{11mm}|p{60mm}|}
|
||||
%%----------------------------------------------------------------------
|
||||
%% snippet menu
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{S\textbf{n}ippet}} \\
|
||||
\hline \verb'\nr' & read code snippet \hfill (n,i)\\
|
||||
\hline \verb'\nw' & write code snippet \hfill (n,v,i)\\
|
||||
\hline \verb'\ne' & edit code snippet \hfill (n,i)\\
|
||||
\hline \Rep\verb'\nf' \Rep\verb'\np' & pick up function prototype \hfill (n,v,i)\\
|
||||
\hline \Rep\verb'\nm' & pick up method prototype \hfill (n,v,i)\\
|
||||
\hline \verb'\ni' & insert prototype(s) \hfill (n,i)\\
|
||||
\hline \verb'\nc' & clear prototype(s) \hfill (n,i)\\
|
||||
\hline \verb'\ns' & show prototype(s) \hfill (n,i)\\
|
||||
%
|
||||
\hline \verb'\ntl' & edit local templates \hfill (n,i)\\
|
||||
\hline \verb'\ntg' & edit global templates$^1$ \hfill (n,i)\\
|
||||
\hline \verb'\ntr' & reread the templates \hfill (n,i)\\
|
||||
\hline \verb'\nts' & change templates style \hfill (n,i)\\
|
||||
\hline
|
||||
%%----------------------------------------------------------------------
|
||||
%% idioms menu
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{I}dioms}} \\
|
||||
\hline \verb'\if' & function \hfill (n,v,i)\\
|
||||
\hline \verb'\isf' & static function \hfill (n,v,i)\\
|
||||
\hline \verb'\im' & \verb'main()' \hfill (n,v,i)\\
|
||||
\hline \Rep\verb'\i0' & \verb'for( x=0; x<n; x+=1 )' \hfill (n,v,i)\\
|
||||
\hline \Rep\verb'\in' & \verb'for( x=n-1; x>=0; x-=1 )' \hfill (n,v,i)\\
|
||||
\hline \verb'\ie' & \verb'enum' + \verb'typedef' \hfill (n,v,i)\\
|
||||
\hline \verb'\is' & \verb'struct' + \verb'typedef' \hfill (n,v,i)\\
|
||||
\hline \verb'\iu' & \verb'union' + \verb'typedef' \hfill (n,v,i)\\
|
||||
\hline \verb'\ip' & \verb'printf()' \hfill (n,i)\\
|
||||
\hline \verb'\isc' & \verb'scanf()' \hfill (n,i)\\
|
||||
\hline \verb'\ica' & \verb'p=calloc()' \hfill (n,i)\\
|
||||
\hline \verb'\ima' & \verb'p=malloc()' \hfill (n,i)\\
|
||||
\hline \verb'\ire' & \verb'p=realloc()' \hfill (n,i)\\
|
||||
\hline \verb'\isi' & \verb'sizeof()' \hfill (n,v,i)\\
|
||||
\hline \verb'\ias' & \verb'assert()' \hfill (n,v,i)\\
|
||||
\hline \verb'\ii' & open input file \hfill (n,v,i)\\
|
||||
\hline \verb'\io' & open output file \hfill (n,v,i)\\
|
||||
\hline \verb'\ifs' & fscanf \hfill (n,i)\\
|
||||
\hline \verb'\ifp' & fprintf \hfill (n,i)\\
|
||||
\hline
|
||||
\end{tabular}\\
|
||||
%
|
||||
\begin{minipage}[b]{64mm}%
|
||||
\scriptsize{%
|
||||
\vspace{1mm}
|
||||
%\hrulefill\\
|
||||
$^1$ {system-wide installation only}\\
|
||||
}%
|
||||
\end{minipage}
|
||||
%
|
||||
%
|
||||
%%======================================================================
|
||||
%% SIDE 2
|
||||
%%======================================================================
|
||||
%
|
||||
%%~~~~~ TABULAR : begin ~~~~~~~~~~
|
||||
\begin{tabular}[]{|p{12mm}|p{60mm}|}
|
||||
%%----------------------------------------------------------------------
|
||||
%% C++ menu
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{C\textbf{++}}} \\
|
||||
\hline \verb'\+co' & \verb'cout << << endl; ' \hfill (n,i)\\
|
||||
\hline \verb'\+"' & \verb'<< ""' \hfill (n,i)\\
|
||||
\hline \verb'\+c' & class \hfill (n,i)\\
|
||||
\hline \verb'\+ps' & \verb$#include<...> STL$ \hfill (n,i)\\
|
||||
\hline \verb'\+pc' & \verb$#include<c..> C$ \hfill (n,i)\\
|
||||
\hline \verb'\+cn' & class (using \verb'new') \hfill (n,i)\\
|
||||
\hline \verb'\+ci' & class implementation \hfill (n,i)\\
|
||||
\hline \verb'\+cni' & class (using \verb'new') implementation \hfill (n,i)\\
|
||||
\hline \verb'\+mi' & method implementation \hfill (n,i)\\
|
||||
\hline \verb'\+ai' & accessor implementation \hfill (n,i)\\
|
||||
\hline \verb'\+tc' & template class \hfill (n,i)\\
|
||||
\hline \verb'\+tcn' & template class (using \verb'new') \hfill (n,i)\\
|
||||
\hline \verb'\+tci' & template class implementation \hfill (n,i)\\
|
||||
\hline \verb'\+tcni'& template class (using \verb'new') impl. \hfill (n,i)\\
|
||||
\hline \verb'\+tmi' & template method implementation \hfill (n,i)\\
|
||||
\hline \verb'\+tai' & template accessor implementation \hfill (n,i)\\
|
||||
\hline \verb'\+tf' & template function \hfill (n,i)\\
|
||||
\hline \verb'\+ec' & error class \hfill (n,i)\\
|
||||
\hline \verb'\+tr' & \verb'try' \dots \verb'catch' \hfill (n,v,i)\\
|
||||
\hline \verb'\+ca' & \verb'catch' \hfill (n,v,i)\\
|
||||
\hline \verb'\+c.' & \verb'catch(...)' \hfill (n,v,i)\\
|
||||
\hline
|
||||
%%
|
||||
%%----------------------------------------------------------------------
|
||||
%% show plugin help
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{H}elp and Menus}}\\
|
||||
\hline \verb'\hm' & show manual \hfill (n,i)\\
|
||||
\hline \verb'\hp' & help (c-support) \hfill (n,i)\\
|
||||
\hline \verb'\lcs' & load Menus\hfill \scriptsize{(n \& GUI only)}\\
|
||||
\hline \verb'\ucs' & unload Menus\hfill \scriptsize{(n \& GUI only)}\\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\vspace{100mm}
|
||||
%%~~~~~ TABULAR : begin ~~~~~~~~~~
|
||||
\begin{tabular}[]{|p{12mm}|p{58mm}|}
|
||||
%%----------------------------------------------------------------------
|
||||
%% run menu
|
||||
%%----------------------------------------------------------------------
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textsl{\textbf{R}un}} \\
|
||||
\hline \verb'\rc' & save and compile \hfill (n,i)\\
|
||||
\hline \verb'\rl' & link \hfill (n,i)\\
|
||||
\hline \verb'\rr' & run \hfill (n,i)\\
|
||||
\hline \verb'\ra' & set comand line arguments \hfill (n,i)\\
|
||||
\hline \verb'\rm' & run \texttt{ make}$^1$ \hfill (n,i)\\
|
||||
\hline \verb'\rmc' & run \texttt{ make clean}$^1$ \hfill (n,i)\\
|
||||
\hline \verb'\rcm' & choose a makefile $^1$ \hfill (n,i)\\
|
||||
\hline \verb'\rme' & executable\ to\ run$^1$ \hfill (n,i)\\
|
||||
\hline \verb'\rma' & cmd.\ line arg.\ for \texttt{make}$^1$ \hfill (n,i)\\
|
||||
%
|
||||
\hline \verb'\rp' & run \texttt{ splint}$^2$ \hfill (n,i)\\
|
||||
\hline \verb'\rpa' & cmd.\ line arg.\ for \texttt{splint} \hfill (n,i)\\
|
||||
%
|
||||
\hline \verb'\rk' & run \texttt{ CodeCheck}$^3$ \hfill (n,i)\\
|
||||
\hline \verb'\rka' & cmd.\ line arg.\ for \texttt{CodeCheck} \hfill (n,i)\\
|
||||
%
|
||||
\hline \verb'\rd' & run \texttt{ indent} \hfill (n,i)\\
|
||||
\hline \Rep\verb'\rh' & hardcopy buffer \hfill (n,i,v)\\
|
||||
\hline \verb'\rs' & show plugin settings \hfill (n,i)\\
|
||||
\hline \verb'\rx' & set xterm size \hfill (n,i, only Unix \& GUI)\\
|
||||
\hline \verb'\ro' & change output destination \hfill (n,i)\\
|
||||
\hline
|
||||
%\end{tabular}
|
||||
%\begin{spacing}{1.2}
|
||||
%\begin{tabular}[]{|p{12mm}|p{58mm}|}
|
||||
\hline
|
||||
\multicolumn{2}{|r|}{\textbf{Additional Mappings}}\\
|
||||
\hline
|
||||
\hline \textbf{typing} & \textbf{expansion}\\
|
||||
\hline \verb'/*' & \verb'/* */' \hfill (i)\\
|
||||
\hline \verb'/*' & \verb'/* '\fbox{\small{(multiline) marked text}}\verb' */' \hfill (v)\\
|
||||
\hline \verb'/*<CR>' & \verb'/*'\hfill (i)\newline\verb' * |'\newline\verb' */'\\
|
||||
\hline \verb'{<CR>' & \verb'{'\hfill (i)\newline\verb' |'\newline\verb'}' \\
|
||||
\hline \verb'{<CR>' & \verb'{'\hfill (v)\newline\verb' '\fbox{\small{(multiline) marked text}}\newline\verb'}'\\
|
||||
\hline
|
||||
\end{tabular}
|
||||
%\end{spacing}
|
||||
%%~~~~~ TABULAR : end ~~~~~~~~~~
|
||||
%\vspace{60mm}
|
||||
%
|
||||
%
|
||||
\begin{minipage}[b]{60mm}%
|
||||
%\vspace{10mm}
|
||||
%
|
||||
\begin{flushleft}
|
||||
%
|
||||
\textit{Ex commands:}
|
||||
\begin{description}
|
||||
%
|
||||
\item [CFileSection] C/C++--file sections (same as \verb'\ccs')
|
||||
\item [HFileSection] H--file sections (same as \verb'\chs')
|
||||
\item [KeywordComment] keyword comment (same as \verb'\ckc')
|
||||
\item [SpecialComment] special comment (same as \verb'\csc')
|
||||
\item [IncludeStdLibrary] standard library includes (same as \verb'\ps')
|
||||
\item [IncludeC99Library] C99 includes (same as \verb'\pc')
|
||||
\item [IncludeCppLibrary] STL includes (same as \verb'\+ps')
|
||||
\item [IncludeCppCLibrary] C includes (same as \verb'\+pc')
|
||||
\item [CStyle] C99 include (same as \verb'\nts')
|
||||
%
|
||||
\end{description}
|
||||
%
|
||||
\scriptsize{Use tab expansion to show the items to choose from.}
|
||||
%
|
||||
\end{flushleft}
|
||||
\scriptsize{%
|
||||
%\vspace{10mm}
|
||||
\hrulefill\\
|
||||
$^1$ also working for filetype \textbf{make}\\
|
||||
$^2$ \textit{www.splint.org}\\
|
||||
$^3$ \textbf{CodeCheck}$^{TM}$ is a product of Abraxas Software, Inc.
|
||||
}%
|
||||
%
|
||||
\end{minipage}
|
||||
%
|
||||
\end{center}
|
||||
\end{multicols}
|
||||
\end{document}
|
8
vim_plugins_src/cvim/c-support/rc/customization.ctags
Normal file
8
vim_plugins_src/cvim/c-support/rc/customization.ctags
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
--regex-make=/^([^:# \t]+)[ \t]*:($|[^=]+)/\1/t,targets/
|
||||
--regex-make=/^include[ \t]+(.+)/\1/i,includes/
|
||||
|
||||
--langdef=qmake
|
||||
--langmap=qmake:+.pro
|
||||
--regex-qmake=/^([[:upper:]_]+)/\1/t,SystemVariables/
|
||||
|
57
vim_plugins_src/cvim/c-support/rc/customization.gvimrc
Normal file
57
vim_plugins_src/cvim/c-support/rc/customization.gvimrc
Normal file
@ -0,0 +1,57 @@
|
||||
"===================================================================================
|
||||
" FILE: .gvimrc
|
||||
" DESCRIPTION: suggestion for a personal configuration file ~/.gvimrc
|
||||
" AUTHOR: Dr.-Ing. Fritz Mehner
|
||||
" VERSION: 1.0
|
||||
" CREATED: 04.04.2009
|
||||
" REVISION: $Id: customization.gvimrc,v 1.3 2009/04/04 08:26:21 mehner Exp $
|
||||
"===================================================================================
|
||||
"
|
||||
"===================================================================================
|
||||
" GENERAL SETTINGS
|
||||
"===================================================================================
|
||||
set cmdheight=2 " Make command line two lines high
|
||||
set mousehide " Hide the mouse when typing text
|
||||
|
||||
highlight Normal guibg=grey90
|
||||
highlight Cursor guibg=Blue guifg=NONE
|
||||
highlight lCursor guibg=Cyan guifg=NONE
|
||||
highlight NonText guibg=grey80
|
||||
highlight Constant gui=NONE guibg=grey95
|
||||
highlight Special gui=NONE guibg=grey95
|
||||
"
|
||||
let c_comment_strings=1 " highlight strings inside C comments
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Moving cursor to other windows
|
||||
"
|
||||
" shift down : change window focus to lower one (cyclic)
|
||||
" shift up : change window focus to upper one (cyclic)
|
||||
" shift left : change window focus to one on left
|
||||
" shift right : change window focus to one on right
|
||||
"-------------------------------------------------------------------------------
|
||||
nmap <s-down> <c-w>w
|
||||
nmap <s-up> <c-w>W
|
||||
nmap <s-left> <c-w>h
|
||||
nmap <s-right> <c-w>l
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" some additional hot keys
|
||||
"-------------------------------------------------------------------------------
|
||||
" S-F3 - call gvim file browser
|
||||
"-------------------------------------------------------------------------------
|
||||
map <silent> <s-F3> :silent browse confirm e<CR>
|
||||
imap <silent> <s-F3> <Esc>:silent browse confirm e<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" toggle insert mode <--> 'normal mode with the <RightMouse>-key
|
||||
"-------------------------------------------------------------------------------
|
||||
"
|
||||
nmap <RightMouse> <Insert>
|
||||
imap <RightMouse> <ESC>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" use font with clearly distinguishable brackets : ()[]{}
|
||||
"-------------------------------------------------------------------------------
|
||||
"set guifont=Luxi\ Mono\ 14
|
||||
"
|
@ -0,0 +1,8 @@
|
||||
--blank-lines-after-procedures
|
||||
--brace-indent0
|
||||
--comment-indentation49
|
||||
--declaration-comment-column49
|
||||
--declaration-indentation10
|
||||
--space-after-parentheses
|
||||
--swallow-optional-blank-lines
|
||||
--tab-size2
|
222
vim_plugins_src/cvim/c-support/rc/customization.vimrc
Normal file
222
vim_plugins_src/cvim/c-support/rc/customization.vimrc
Normal file
@ -0,0 +1,222 @@
|
||||
"===================================================================================
|
||||
" FILE: .vimrc
|
||||
" DESCRIPTION: suggestion for a personal configuration file ~/.vimrc
|
||||
" AUTHOR: Dr.-Ing. Fritz Mehner
|
||||
" CREATED: 04.04.2009
|
||||
" REVISION: $Id: customization.vimrc,v 1.6 2009/10/03 12:24:30 mehner Exp $
|
||||
"===================================================================================
|
||||
"
|
||||
"===================================================================================
|
||||
" GENERAL SETTINGS
|
||||
"===================================================================================
|
||||
|
||||
"-------------------------------------------------------------------------------
|
||||
" Use Vim settings, rather then Vi settings.
|
||||
" This must be first, because it changes other options as a side effect.
|
||||
"-------------------------------------------------------------------------------
|
||||
set nocompatible
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Enable file type detection. Use the default filetype settings.
|
||||
" Also load indent files, to automatically do language-dependent indenting.
|
||||
"-------------------------------------------------------------------------------
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Switch syntax highlighting on.
|
||||
"-------------------------------------------------------------------------------
|
||||
syntax on
|
||||
"
|
||||
" Platform specific items:
|
||||
" - central backup directory (has to be created)
|
||||
" - default dictionary
|
||||
" Uncomment your choice.
|
||||
if has("win16") || has("win32") || has("win64") ||
|
||||
\ has("win95") || has("win32unix")
|
||||
"
|
||||
" runtime mswin.vim
|
||||
" set backupdir =$VIM\vimfiles\backupdir
|
||||
" set dictionary=$VIM\vimfiles\wordlists/german.list
|
||||
else
|
||||
" set backupdir =$HOME/.vim.backupdir
|
||||
" set dictionary=$HOME/.vim/wordlists/german.list
|
||||
endif
|
||||
"
|
||||
" Using a backupdir under UNIX/Linux: you may want to include a line similar to
|
||||
" find $HOME/.vim.backupdir -name "*" -type f -mtime +60 -exec rm -f {} \;
|
||||
" in one of your shell startup files (e.g. $HOME/.profile)
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Various settings
|
||||
"-------------------------------------------------------------------------------
|
||||
set autoindent " copy indent from current line
|
||||
set autoread " read open files again when changed outside Vim
|
||||
set autowrite " write a modified buffer on each :next , ...
|
||||
set backspace=indent,eol,start " backspacing over everything in insert mode
|
||||
set backup " keep a backup file
|
||||
set browsedir=current " which directory to use for the file browser
|
||||
set complete+=k " scan the files given with the 'dictionary' option
|
||||
set history=50 " keep 50 lines of command line history
|
||||
set hlsearch " highlight the last used search pattern
|
||||
set incsearch " do incremental searching
|
||||
set listchars=tab:>.,eol:\$ " strings to use in 'list' mode
|
||||
set mouse=a " enable the use of the mouse
|
||||
set nowrap " do not wrap lines
|
||||
set popt=left:8pc,right:3pc " print options
|
||||
set ruler " show the cursor position all the time
|
||||
set shiftwidth=2 " number of spaces to use for each step of indent
|
||||
set showcmd " display incomplete commands
|
||||
set smartindent " smart autoindenting when starting a new line
|
||||
set tabstop=2 " number of spaces that a <Tab> counts for
|
||||
set visualbell " visual bell instead of beeping
|
||||
set wildignore=*.bak,*.o,*.e,*~ " wildmenu: ignore these extensions
|
||||
set wildmenu " command-line completion in an enhanced mode
|
||||
"
|
||||
"===================================================================================
|
||||
" BUFFERS, WINDOWS
|
||||
"===================================================================================
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" The current directory is the directory of the file in the current window.
|
||||
"-------------------------------------------------------------------------------
|
||||
if has("autocmd")
|
||||
autocmd BufEnter * :lchdir %:p:h
|
||||
endif
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" close window (conflicts with the KDE setting for calling the process manager)
|
||||
"-------------------------------------------------------------------------------
|
||||
noremap <C-Esc> :close<CR>
|
||||
inoremap <C-Esc> <C-C>:close<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Fast switching between buffers
|
||||
" The current buffer will be saved before switching to the next one.
|
||||
" Choose :bprevious or :bnext
|
||||
"-------------------------------------------------------------------------------
|
||||
noremap <silent> <s-tab> :if &modifiable && !&readonly &&
|
||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
||||
inoremap <silent> <s-tab> <C-C>:if &modifiable && !&readonly &&
|
||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Leave the editor with Ctrl-q (KDE): Write all changed buffers and exit Vim
|
||||
"-------------------------------------------------------------------------------
|
||||
nnoremap <C-q> :wqall<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" When editing a file, always jump to the last known cursor position.
|
||||
" Don't do it when the position is invalid or when inside an event handler
|
||||
" (happens when dropping a file on gvim).
|
||||
"-------------------------------------------------------------------------------
|
||||
if has("autocmd")
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
endif " has("autocmd")
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" some additional hot keys
|
||||
"-------------------------------------------------------------------------------
|
||||
" F2 - write file without confirmation
|
||||
" F3 - call file explorer Ex
|
||||
" F4 - show tag under curser in the preview window (tagfile must exist!)
|
||||
" F5 - open quickfix error window
|
||||
" F6 - close quickfix error window
|
||||
" F7 - display previous error
|
||||
" F8 - display next error
|
||||
"-------------------------------------------------------------------------------
|
||||
"
|
||||
map <silent> <F2> :write<CR>
|
||||
map <silent> <F3> :Explore<CR>
|
||||
nmap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR>
|
||||
map <silent> <F5> :copen<CR>
|
||||
map <silent> <F6> :cclose<CR>
|
||||
map <silent> <F7> :cp<CR>
|
||||
map <silent> <F8> :cn<CR>
|
||||
"
|
||||
imap <silent> <F2> <Esc>:write<CR>
|
||||
imap <silent> <F3> <Esc>:Explore<CR>
|
||||
imap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR>
|
||||
imap <silent> <F5> <Esc>:copen<CR>
|
||||
imap <silent> <F6> <Esc>:cclose<CR>
|
||||
imap <silent> <F7> <Esc>:cp<CR>
|
||||
imap <silent> <F8> <Esc>:cn<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Fast switching between buffers
|
||||
" The current buffer will be saved before switching to the next one.
|
||||
" Choose :bprevious or :bnext
|
||||
"-------------------------------------------------------------------------------
|
||||
"
|
||||
map <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
|
||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
||||
imap <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
|
||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Leave the editor with Ctrl-q : Write all changed buffers and exit Vim
|
||||
"-------------------------------------------------------------------------------
|
||||
nmap <C-q> :wqa<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" comma always followed by a space
|
||||
"-------------------------------------------------------------------------------
|
||||
inoremap , ,<Space>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" autocomplete parenthesis, brackets and braces
|
||||
"-------------------------------------------------------------------------------
|
||||
inoremap ( ()<Left>
|
||||
inoremap [ []<Left>
|
||||
inoremap { {}<Left>
|
||||
"
|
||||
vnoremap ( s()<Esc>P<Right>%
|
||||
vnoremap [ s[]<Esc>P<Right>%
|
||||
vnoremap { s{}<Esc>P<Right>%
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" autocomplete quotes (visual and select mode)
|
||||
"-------------------------------------------------------------------------------
|
||||
xnoremap ' s''<Esc>P<Right>
|
||||
xnoremap " s""<Esc>P<Right>
|
||||
xnoremap ` s``<Esc>P<Right>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" Change the working directory to the directory containing the current file
|
||||
"-------------------------------------------------------------------------------
|
||||
if has("autocmd")
|
||||
autocmd BufEnter * :lchdir %:p:h
|
||||
endif " has("autocmd")
|
||||
"
|
||||
"===================================================================================
|
||||
" VARIOUS PLUGIN CONFIGURATIONS
|
||||
"===================================================================================
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" c.vim
|
||||
"-------------------------------------------------------------------------------
|
||||
"
|
||||
" --empty --
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" taglist.vim : toggle the taglist window
|
||||
" taglist.vim : define the title texts for make
|
||||
" taglist.vim : define the title texts for qmake
|
||||
"-------------------------------------------------------------------------------
|
||||
noremap <silent> <F11> <Esc><Esc>:Tlist<CR>
|
||||
inoremap <silent> <F11> <Esc><Esc>:Tlist<CR>
|
||||
|
||||
let Tlist_GainFocus_On_ToggleOpen = 1
|
||||
let Tlist_Close_On_Select = 1
|
||||
|
||||
let tlist_make_settings = 'make;m:makros;t:targets'
|
||||
let tlist_qmake_settings = 'qmake;t:SystemVariables'
|
||||
|
||||
if has("autocmd")
|
||||
" ---------- qmake : set filetype for *.pro ----------
|
||||
autocmd BufNewFile,BufRead *.pro set filetype=qmake
|
||||
endif " has("autocmd")
|
||||
|
30
vim_plugins_src/cvim/c-support/scripts/wrapper.sh
Normal file
30
vim_plugins_src/cvim/c-support/scripts/wrapper.sh
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
#===============================================================================
|
||||
# FILE: wrapper.sh
|
||||
# USAGE: ./wrapper.sh executable [cmd-line-args]
|
||||
# DESCRIPTION: Wraps the execution of a programm or script.
|
||||
# Use with xterm: xterm -e wrapper.sh executable cmd-line-args
|
||||
# This script is used by the plugins c.vim
|
||||
# OPTIONS: ---
|
||||
# REQUIREMENTS: ---
|
||||
# BUGS: ---
|
||||
# NOTES: ---
|
||||
# AUTHOR: Dr.-Ing. Fritz Mehner (Mn), mehner@fh-swf.de
|
||||
# COMPANY: Fachhochschule Südwestfalen, Iserlohn
|
||||
# CREATED: 23.11.2004 18:04:01 CET
|
||||
# REVISION: $Id: wrapper.sh,v 1.5 2009/06/03 17:47:06 mehner Exp $
|
||||
#===============================================================================
|
||||
|
||||
executable="${1}" # name of the executable
|
||||
|
||||
if [ ${#} -ge 1 ] && [ -x "$executable" ]
|
||||
then
|
||||
"${@}"
|
||||
returncode=$?
|
||||
[ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n"
|
||||
else
|
||||
printf "\n !! file \"${executable}\" does not exist or is not executable !!\n"
|
||||
returncode=126 # command invoked cannot execute
|
||||
fi
|
||||
read -p " ... press return key ... " dummy
|
||||
exit $returncode
|
30
vim_plugins_src/cvim/c-support/templates/Templates
Normal file
30
vim_plugins_src/cvim/c-support/templates/Templates
Normal file
@ -0,0 +1,30 @@
|
||||
$
|
||||
$ =============================================================
|
||||
$ ========== USER MACROS ======================================
|
||||
$ =============================================================
|
||||
$
|
||||
|AUTHOR| = YOUR NAME
|
||||
|AUTHORREF| =
|
||||
|EMAIL| =
|
||||
|COMPANY| =
|
||||
|COPYRIGHT| = Copyright (c) |YEAR|, |AUTHOR|
|
||||
|STYLE| = default
|
||||
$
|
||||
$ =============================================================
|
||||
$ ========== FILE INCLUDES ====================================
|
||||
$ =============================================================
|
||||
$
|
||||
|includefile| = c.comments.template
|
||||
|includefile| = c.cpp.template
|
||||
|includefile| = c.idioms.template
|
||||
|includefile| = c.preprocessor.template
|
||||
|includefile| = c.statements.template
|
||||
$
|
||||
== IF |STYLE| IS CPP ==
|
||||
|includefile| = cpp.comments.template
|
||||
|includefile| = cpp.cpp.template
|
||||
|includefile| = cpp.idioms.template
|
||||
|includefile| = cpp.preprocessor.template
|
||||
|includefile| = cpp.statements.template
|
||||
== ENDIF ==
|
||||
$
|
179
vim_plugins_src/cvim/c-support/templates/c.comments.template
Normal file
179
vim_plugins_src/cvim/c-support/templates/c.comments.template
Normal file
@ -0,0 +1,179 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.end-of-line-comment == append ==
|
||||
/* <CURSOR> */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.frame ==
|
||||
/*-----------------------------------------------------------------------------
|
||||
* <CURSOR>
|
||||
*-----------------------------------------------------------------------------*/
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.function ==
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: |?FUNCTION_NAME|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.method ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME|
|
||||
* Method: |?CLASSNAME| :: |?METHODNAME|
|
||||
* Description: <CURSOR>
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.class ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-description == start ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: |FILENAME|
|
||||
*
|
||||
* Description: <CURSOR>
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: |DATE| |TIME|
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
||||
* Organization: |ORGANIZATION|
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-description-header == start ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: |FILENAME|
|
||||
*
|
||||
* Description: <CURSOR>
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: |DATE| |TIME|
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
||||
* Organization: |ORGANIZATION|
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-header-includes ==
|
||||
/* ##### HEADER FILE INCLUDES ################################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-macros ==
|
||||
/* ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-typedefs ==
|
||||
/* ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-data-types ==
|
||||
/* ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ############################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-defs ==
|
||||
/* ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################## */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-local-variables ==
|
||||
/* ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################ */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-prototypes ==
|
||||
/* ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ############################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-function-defs-exported ==
|
||||
/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-function-defs-local ==
|
||||
/* ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ##################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-implementations-exported ==
|
||||
/* ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES ############################# */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-implementations-local ==
|
||||
/* ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################ */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-header-includes ==
|
||||
/* ##### HEADER FILE INCLUDES ################################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-macros ==
|
||||
/* ##### EXPORTED MACROS ######################################################## */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-typedefs ==
|
||||
/* ##### EXPORTED TYPE DEFINITIONS ############################################## */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-data-types ==
|
||||
/* ##### EXPORTED DATA TYPES #################################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-class-defs ==
|
||||
/* ##### EXPORTED CLASS DEFINITIONS ############################################# */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-variables ==
|
||||
/* ##### EXPORTED VARIABLES ##################################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-function-declarations ==
|
||||
/* ##### EXPORTED FUNCTION DECLARATIONS ######################################### */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.keyword-bug == append ==
|
||||
/* :BUG:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-compiler == append ==
|
||||
/* :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-todo == append ==
|
||||
/* :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-tricky == append ==
|
||||
/* :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-warning == append ==
|
||||
/* :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-workaround == append ==
|
||||
/* :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
== comment.keyword-keyword == append ==
|
||||
/* :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.special-empty == append ==
|
||||
/* EMPTY */<CURSOR>
|
||||
== comment.special-fall-through == append ==
|
||||
/* FALL THROUGH */<CURSOR>
|
||||
== comment.special-implicit-type-conversion == append ==
|
||||
/* IMPLICIT TYPE CONVERSION */<CURSOR>
|
||||
== comment.special-no-return == append ==
|
||||
/* NO RETURN */<CURSOR>
|
||||
== comment.special-not-reached == append ==
|
||||
/* NOT REACHED */<CURSOR>
|
||||
== comment.special-remains-to-be-implemented == append ==
|
||||
/* REMAINS TO BE IMPLEMENTED */<CURSOR>
|
||||
== comment.special-constant-type-is-long == append ==
|
||||
/* constant type is long */<CURSOR>
|
||||
== comment.special-constant-type-is-unsigned == append ==
|
||||
/* constant type is unsigned */<CURSOR>
|
||||
== comment.special-constant-type-is-unsigned-long == append ==
|
||||
/* constant type is unsigned long */<CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
484
vim_plugins_src/cvim/c-support/templates/c.cpp.template
Normal file
484
vim_plugins_src/cvim/c-support/templates/c.cpp.template
Normal file
@ -0,0 +1,484 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
$
|
||||
== cpp.cin ==
|
||||
cin >> <CURSOR>;
|
||||
$
|
||||
== cpp.cout == insert ==
|
||||
cout << <CURSOR> << endl;
|
||||
$
|
||||
== cpp.cout-operator == insert ==
|
||||
<< "<CURSOR>"
|
||||
$
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.output-manipulator-boolalpha == insert ==
|
||||
<< boolalpha <CURSOR>
|
||||
== cpp.output-manipulator-dec == insert ==
|
||||
<< dec <CURSOR>
|
||||
== cpp.output-manipulator-endl == insert ==
|
||||
<< endl <CURSOR>
|
||||
== cpp.output-manipulator-fixed == insert ==
|
||||
<< fixed <CURSOR>
|
||||
== cpp.output-manipulator-flush == insert ==
|
||||
<< flush <CURSOR>
|
||||
== cpp.output-manipulator-hex == insert ==
|
||||
<< hex <CURSOR>
|
||||
== cpp.output-manipulator-internal == insert ==
|
||||
<< internal <CURSOR>
|
||||
== cpp.output-manipulator-left == insert ==
|
||||
<< left <CURSOR>
|
||||
== cpp.output-manipulator-oct == insert ==
|
||||
<< oct <CURSOR>
|
||||
== cpp.output-manipulator-right == insert ==
|
||||
<< right <CURSOR>
|
||||
== cpp.output-manipulator-scientific == insert ==
|
||||
<< scientific <CURSOR>
|
||||
== cpp.output-manipulator-setbase == insert ==
|
||||
<< setbase(10<CURSOR>)
|
||||
== cpp.output-manipulator-setfill == insert ==
|
||||
<< setfill(<CURSOR>)
|
||||
== cpp.output-manipulator-setiosflag == insert ==
|
||||
<< setiosflags(<CURSOR>)
|
||||
== cpp.output-manipulator-setprecision == insert ==
|
||||
<< setprecision(6<CURSOR>)
|
||||
== cpp.output-manipulator-setw == insert ==
|
||||
<< setw(0<CURSOR>)
|
||||
== cpp.output-manipulator-showbase == insert ==
|
||||
<< showbase <CURSOR>
|
||||
== cpp.output-manipulator-showpoint == insert ==
|
||||
<< showpoint <CURSOR>
|
||||
== cpp.output-manipulator-showpos == insert ==
|
||||
<< showpos <CURSOR>
|
||||
== cpp.output-manipulator-uppercase == insert ==
|
||||
<< uppercase <CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.method-implementation ==
|
||||
void<CURSOR>
|
||||
|?CLASSNAME|::|?METHODNAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} /* ----- end of method |CLASSNAME|::|?METHODNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.accessor-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME|
|
||||
* Method: get_|?ATTRIBUTE|
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
inline |?RETURNTYPE|
|
||||
|CLASSNAME|::get_|ATTRIBUTE| ( ) const
|
||||
{
|
||||
return |ATTRIBUTE|;
|
||||
} /* ----- end of method |CLASSNAME|::get_|ATTRIBUTE| ----- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: set_|ATTRIBUTE|
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
inline void
|
||||
|CLASSNAME|::set_|ATTRIBUTE| ( |RETURNTYPE| value )
|
||||
{
|
||||
|ATTRIBUTE| = value;
|
||||
return ;
|
||||
} /* ----- end of method |CLASSNAME|::set_|ATTRIBUTE| ----- */
|
||||
<CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-definition ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
/* ==================== LIFECYCLE ======================================= */
|
||||
|CLASSNAME| (); /* constructor */
|
||||
|
||||
/* ==================== ACCESSORS ======================================= */
|
||||
|
||||
/* ==================== MUTATORS ======================================= */
|
||||
|
||||
/* ==================== OPERATORS ======================================= */
|
||||
|
||||
protected:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
private:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
}; /* ----- end of class |CLASSNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Method: |CLASSNAME|
|
||||
* Description: constructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|CLASSNAME|::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-using-new-definition ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
/* ==================== LIFECYCLE ======================================= */
|
||||
|CLASSNAME| (); /* constructor */
|
||||
|CLASSNAME| ( const |CLASSNAME| &other ); /* copy constructor */
|
||||
~|CLASSNAME| (); /* destructor */
|
||||
|
||||
/* ==================== ACCESSORS ======================================= */
|
||||
|
||||
/* ==================== MUTATORS ======================================= */
|
||||
|
||||
/* ==================== OPERATORS ======================================= */
|
||||
|
||||
|CLASSNAME|& operator = ( const |CLASSNAME| &other ); /* assignment operator */
|
||||
|
||||
protected:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
private:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
}; /* ----- end of class |CLASSNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-using-new-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Method: |CLASSNAME|
|
||||
* Description: constructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|CLASSNAME|::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: |CLASSNAME|
|
||||
* Description: copy constructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other )
|
||||
{
|
||||
} /* ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) ----- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: ~|CLASSNAME|
|
||||
* Description: destructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|CLASSNAME|::~|CLASSNAME| ()
|
||||
{
|
||||
} /* ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) ----- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: operator =
|
||||
* Description: assignment operator
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|CLASSNAME|&
|
||||
|CLASSNAME|::operator = ( const |CLASSNAME| &other )
|
||||
{
|
||||
if ( this != &other ) {
|
||||
}
|
||||
return *this;
|
||||
} /* ----- end of method |CLASSNAME|::operator = (assignment operator) ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.error-class ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public: |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg) { }
|
||||
virtual ~|CLASSNAME| ( ) { }
|
||||
virtual string what ( ) const throw ( ) { return message; }
|
||||
protected: string message;
|
||||
}; /* ----- end of class |CLASSNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-method-implementation ==
|
||||
template < class T >
|
||||
void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} /* ----- end of method |CLASSNAME|<T>::|METHODNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-accessor-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME|
|
||||
* Method: get_|?ATTRIBUTE|
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
inline |?RETURNTYPE| |CLASSNAME|<T>::get_|ATTRIBUTE| ( ) const
|
||||
{
|
||||
return |ATTRIBUTE|;
|
||||
} /* ----- end of method |CLASSNAME|<T>::get_|ATTRIBUTE| ----- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: set_|ATTRIBUTE|
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
inline void |CLASSNAME|<T>::set_|ATTRIBUTE| ( |RETURNTYPE| value )
|
||||
{
|
||||
|ATTRIBUTE| = value;
|
||||
return ;
|
||||
} /* ----- end of method |CLASSNAME|<T>::set_|ATTRIBUTE| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-definition ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
template < class T >
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
/* ==================== LIFECYCLE ======================================= */
|
||||
|CLASSNAME| (); /* constructor */
|
||||
|
||||
/* ==================== ACCESSORS ======================================= */
|
||||
|
||||
/* ==================== MUTATORS ======================================= */
|
||||
|
||||
/* ==================== OPERATORS ======================================= */
|
||||
|
||||
protected:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
private:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
}; /* ---------- end of template class |CLASSNAME| ---------- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Method: |CLASSNAME|
|
||||
* Description:
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
|CLASSNAME| < T >::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} /* ---------- end of constructor of template class |CLASSNAME| ---------- */
|
||||
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-using-new-definition ==
|
||||
/*
|
||||
* =====================================================================================
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Description: <CURSOR>
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
template < class T >
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
// ==================== LIFECYCLE =======================================
|
||||
|CLASSNAME| (); /* constructor */
|
||||
|CLASSNAME| ( const |CLASSNAME| &other ); /* copy constructor */
|
||||
~|CLASSNAME| (); /* destructor */
|
||||
|
||||
/* ==================== ACCESSORS ======================================= */
|
||||
|
||||
/* ==================== MUTATORS ======================================= */
|
||||
|
||||
/* ==================== OPERATORS ======================================= */
|
||||
|
||||
|CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
|
||||
|
||||
protected:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
private:
|
||||
/* ==================== DATA MEMBERS ======================================= */
|
||||
|
||||
}; /* ----- end of template class |CLASSNAME| ----- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-using-new-implementation ==
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |?CLASSNAME:c|
|
||||
* Method: |CLASSNAME|
|
||||
* Description: constructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
|CLASSNAME|< T >::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} /* ---------- end of constructor of template class |CLASSNAME| ---------- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: |CLASSNAME|
|
||||
* Description: copy constructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
|CLASSNAME|< T >::|CLASSNAME| ( const |CLASSNAME| &other )
|
||||
{
|
||||
} /* ---------- end of copy constructor of template class |CLASSNAME| ---------- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: ~|CLASSNAME|
|
||||
* Description: destructor
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
|CLASSNAME|< T >::~|CLASSNAME| ()
|
||||
{
|
||||
} /* ---------- end of destructor of template class |CLASSNAME| ---------- */
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------------------
|
||||
* Class: |CLASSNAME|
|
||||
* Method: operator =
|
||||
* Description: assignment operator
|
||||
*--------------------------------------------------------------------------------------
|
||||
*/
|
||||
template < class T >
|
||||
|CLASSNAME|< T >& |CLASSNAME|< T >::operator = ( const |CLASSNAME| &other )
|
||||
{
|
||||
return *this;
|
||||
} /* ---------- end of assignment operator of template class |CLASSNAME| ---------- */
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-function ==
|
||||
template <class T>
|
||||
void<CURSOR> |?TEMPALTE_FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} /* ----- end of template function |?TEMPALTE_FUNCTION_NAME| ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.operator-in ==
|
||||
ostream &
|
||||
operator << ( ostream & os, const |?CLASSNAME| & obj )
|
||||
{
|
||||
os << obj.<CURSOR> ;
|
||||
return os;
|
||||
} /* ----- end of function operator << ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.operator-out ==
|
||||
istream &
|
||||
operator >> ( istream & is, |?CLASSNAME| & obj )
|
||||
{
|
||||
is >> obj.<CURSOR> ;
|
||||
return is;
|
||||
} /* ----- end of function operator >> ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.try-catch ==
|
||||
try {
|
||||
<SPLIT>}
|
||||
catch ( const <CURSOR> &ExceptObj ) { /* handle exception: */
|
||||
}
|
||||
catch (...) { /* handle exception: unspecified */
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.catch ==
|
||||
catch ( const <CURSOR> &ExceptObj ) { /* handle exception: */
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.catch-points ==
|
||||
catch (...) { /* handle exception: unspecified */
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.extern ==
|
||||
extern "C" {<CURSOR>
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.open-input-file ==
|
||||
string ifs_file_name = "<CURSOR>"; /* input file name */
|
||||
ifstream ifs; /* create ifstream object */
|
||||
|
||||
ifs.open ( ifs_file_name.c_str() ); /* open ifstream */
|
||||
if (!ifs) {
|
||||
cerr << "\nERROR : failed to open input file " << ifs_file_name << endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
ifs.close (); /* close ifstream */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.open-output-file ==
|
||||
string ofs_file_name = "<CURSOR>"; /* input file name */
|
||||
ofstream ofs; /* create ofstream object */
|
||||
|
||||
ofs.open ( ofs_file_name.c_str() ); /* open ofstream */
|
||||
if (!ofs) {
|
||||
cerr << "\nERROR : failed to open output file " << ofs_file_name << endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
ofs.close (); /* close ofstream */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.namespace-std ==
|
||||
using namespace std;
|
||||
== cpp.namespace ==
|
||||
using namespace |?NAMESPACE|;
|
||||
== cpp.namespace-block ==
|
||||
namespace |?NAMESPACE| {<CURSOR>
|
||||
<SPLIT>} /* ----- end of namespace |NAMESPACE| ----- */
|
||||
== cpp.namespace-alias ==
|
||||
namespace |?NAMESPACE_ALIAS| = {-original namespace name-};
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.rtti-typeid == insert ==
|
||||
typeid(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-static-cast == insert ==
|
||||
static_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-const-cast == insert ==
|
||||
const_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-reinterpret-cast == insert ==
|
||||
reinterpret_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-dynamic-cast == insert ==
|
||||
dynamic_cast<>(<CURSOR><SPLIT>)
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
141
vim_plugins_src/cvim/c-support/templates/c.idioms.template
Normal file
141
vim_plugins_src/cvim/c-support/templates/c.idioms.template
Normal file
@ -0,0 +1,141 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.function ==
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: |?FUNCTION_NAME|
|
||||
* Description:
|
||||
* =====================================================================================
|
||||
*/
|
||||
void<CURSOR>
|
||||
|FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
<SPLIT> return <+return value+>;
|
||||
} /* ----- end of function |FUNCTION_NAME| ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.function-static ==
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: |?FUNCTION_NAME|
|
||||
* Description:
|
||||
* =====================================================================================
|
||||
*/
|
||||
static void<CURSOR>
|
||||
|FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
<SPLIT> return <+return value+>;
|
||||
} /* ----- end of static function |FUNCTION_NAME| ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.main ==
|
||||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
* === FUNCTION ======================================================================
|
||||
* Name: main
|
||||
* Description:
|
||||
* =====================================================================================
|
||||
*/
|
||||
int
|
||||
main ( int argc, char *argv[] )
|
||||
{<CURSOR>
|
||||
<SPLIT> return EXIT_SUCCESS;
|
||||
} /* ---------- end of function main ---------- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.enum ==
|
||||
enum |?ENUM_NAME| {<CURSOR>
|
||||
<SPLIT>}; /* ---------- end of enum |ENUM_NAME| ---------- */
|
||||
|
||||
typedef enum |ENUM_NAME| |ENUM_NAME:c|;
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.struct ==
|
||||
struct |?STRUCT_NAME| {<CURSOR>
|
||||
<SPLIT>}; /* ---------- end of struct |STRUCT_NAME| ---------- */
|
||||
|
||||
typedef struct |STRUCT_NAME| |STRUCT_NAME:c|;
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.union ==
|
||||
union |?UNION_NAME| {<CURSOR>
|
||||
<SPLIT>}; /* ---------- end of union |UNION_NAME| ---------- */
|
||||
|
||||
typedef union |UNION_NAME| |UNION_NAME:c|;
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.printf == insert ==
|
||||
printf ( "<CURSOR>\n" );
|
||||
== idioms.scanf == insert ==
|
||||
scanf ( "<CURSOR>", & );
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.calloc ==
|
||||
|?POINTER| = calloc ( (size_t)(<CURSOR><+COUNT+>), sizeof(<+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
free (|POINTER|);
|
||||
|POINTER| = NULL;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.malloc ==
|
||||
|?POINTER| = malloc ( sizeof(<CURSOR><+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
free (|POINTER|);
|
||||
|POINTER| = NULL;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.realloc ==
|
||||
|?POINTER| = realloc ( |POINTER|, sizeof(<CURSOR><+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory reallocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.sizeof == insert ==
|
||||
sizeof(<CURSOR><SPLIT>)
|
||||
== idioms.assert == insert ==
|
||||
assert(<CURSOR><SPLIT>);
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.open-input-file ==
|
||||
FILE *|?FILEPOINTER|; /* input-file pointer */
|
||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; /* input-file name */
|
||||
|
||||
|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" );
|
||||
if ( |FILEPOINTER| == NULL ) {
|
||||
fprintf ( stderr, "couldn't open file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
if( fclose(|FILEPOINTER|) == EOF ) { /* close input file */
|
||||
fprintf ( stderr, "couldn't close file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.open-output-file ==
|
||||
FILE *|?FILEPOINTER|; /* output-file pointer */
|
||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; /* output-file name */
|
||||
|
||||
|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" );
|
||||
if ( |FILEPOINTER| == NULL ) {
|
||||
fprintf ( stderr, "couldn't open file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
if( fclose(|FILEPOINTER|) == EOF ) { /* close output file */
|
||||
fprintf ( stderr, "couldn't close file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.fprintf == insert ==
|
||||
fprintf ( |?FILEPOINTER|, "<CURSOR>\n", );
|
||||
== idioms.fscanf == insert ==
|
||||
fscanf ( |?FILEPOINTER|, "<CURSOR>", & );
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
@ -0,0 +1,54 @@
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.include-global == insert ==
|
||||
#include <<CURSOR>>
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.include-local == insert ==
|
||||
#include "<CURSOR>"
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.define == insert ==
|
||||
#define <CURSOR> /* */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.undefine == insert ==
|
||||
#undef <CURSOR> /* */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.if-endif ==
|
||||
#if |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#endif /* ----- |CONDITION| ----- */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.if-else-endif ==
|
||||
#if |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else /* ----- not |CONDITION| ----- */
|
||||
<+ELSE PART+>
|
||||
#endif /* ----- not |CONDITION| ----- */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifdef-else-endif ==
|
||||
#ifdef |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else /* ----- not |CONDITION| ----- */
|
||||
<+ELSE PART+>
|
||||
#endif /* ----- not |CONDITION| ----- */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifndef-else-endif ==
|
||||
#ifndef |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else /* ----- not |CONDITION| ----- */
|
||||
<+ELSE PART+>
|
||||
#endif /* ----- not |CONDITION| ----- */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifndef-def-endif ==
|
||||
#ifndef |?BASENAME:L|_INC
|
||||
#define |BASENAME|_INC
|
||||
<CURSOR><SPLIT>
|
||||
#endif /* ----- #ifndef |BASENAME|_INC ----- */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.error ==
|
||||
#error "<CURSOR>" /* */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.line ==
|
||||
#line <CURSOR> /* */
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.pragma ==
|
||||
#pragma <CURSOR> /* */
|
||||
$-------------------------------------------------------------------------
|
@ -0,0 +1,69 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.do-while ==
|
||||
do {
|
||||
<SPLIT>} while ( <CURSOR> ); /* ----- end do-while ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.for ==
|
||||
for ( <CURSOR>; ; )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.for-block ==
|
||||
for ( <CURSOR>; ; ) {
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if ==
|
||||
if ( <CURSOR> )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-block ==
|
||||
if ( <CURSOR> ) {
|
||||
<SPLIT><-IF PART->
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-else ==
|
||||
if ( <CURSOR> )
|
||||
<SPLIT>else
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-block-else ==
|
||||
if ( <CURSOR> ) {
|
||||
<SPLIT><-IF PART->
|
||||
}
|
||||
else {
|
||||
<-ELSE PART->
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.else-block ==
|
||||
else {
|
||||
<CURSOR><SPLIT>
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.while ==
|
||||
while ( <CURSOR> )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.while-block ==
|
||||
while ( <CURSOR> ) {
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.switch ==
|
||||
switch ( <CURSOR> ) {
|
||||
case <-LABEL->:
|
||||
<SPLIT>break;
|
||||
|
||||
case <-LABEL->:
|
||||
break;
|
||||
|
||||
case <-LABEL->:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} /* ----- end switch ----- */
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.case ==
|
||||
case <CURSOR>:
|
||||
break;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.block ==
|
||||
{
|
||||
<CURSOR><SPLIT>
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
168
vim_plugins_src/cvim/c-support/templates/cpp.comments.template
Normal file
168
vim_plugins_src/cvim/c-support/templates/cpp.comments.template
Normal file
@ -0,0 +1,168 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.end-of-line-comment == append ==
|
||||
// <CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.frame ==
|
||||
//----------------------------------------------------------------------
|
||||
// <CURSOR>
|
||||
//----------------------------------------------------------------------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.function ==
|
||||
// === FUNCTION ======================================================================
|
||||
// Name: |?FUNCTION_NAME|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.method ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: |?METHODNAME|
|
||||
// Description: <CURSOR>
|
||||
//--------------------------------------------------------------------------------------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.class ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-description == start ==
|
||||
// =====================================================================================
|
||||
//
|
||||
// Filename: |FILENAME|
|
||||
//
|
||||
// Description: <CURSOR>
|
||||
//
|
||||
// Version: 1.0
|
||||
// Created: |DATE| |TIME|
|
||||
// Revision: none
|
||||
// Compiler: g++
|
||||
//
|
||||
// Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
||||
// Company: |ORGANIZATION|
|
||||
//
|
||||
// =====================================================================================
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-description-header == start ==
|
||||
// =====================================================================================
|
||||
//
|
||||
// Filename: |FILENAME|
|
||||
//
|
||||
// Description: <CURSOR>
|
||||
//
|
||||
// Version: 1.0
|
||||
// Created: |DATE| |TIME|
|
||||
// Revision: none
|
||||
// Compiler: g++
|
||||
//
|
||||
// Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
||||
// Company: |ORGANIZATION|
|
||||
//
|
||||
// =====================================================================================
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-header-includes ==
|
||||
// ##### HEADER FILE INCLUDES ###################################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-macros ==
|
||||
// ##### MACROS - LOCAL TO THIS SOURCE FILE ###################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-typedefs ==
|
||||
// ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE #########################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-data-types ==
|
||||
// ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ###############################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-defs ==
|
||||
// ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ########################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-local-variables ==
|
||||
// ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-prototypes ==
|
||||
// ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ###############################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-function-defs-exported ==
|
||||
// ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-function-defs-local ==
|
||||
// ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE #####################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-implementations-exported ==
|
||||
// ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES #############################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-cpp-class-implementations-local ==
|
||||
// ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-header-includes ==
|
||||
// ##### HEADER FILE INCLUDES ###################################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-macros ==
|
||||
// ##### EXPORTED MACROS ########################################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-typedefs ==
|
||||
// ##### EXPORTED TYPE DEFINITIONS ##############################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-data-types ==
|
||||
// ##### EXPORTED DATA TYPES ####################################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-class-defs ==
|
||||
// ##### EXPORTED CLASS DEFINITIONS #############################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-variables ==
|
||||
// ##### EXPORTED VARIABLES #####################################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.file-section-hpp-exported-function-declarations ==
|
||||
// ##### EXPORTED FUNCTION DECLARATIONS #########################################
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.keyword-bug == append ==
|
||||
// :BUG:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-compiler == append ==
|
||||
// :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-todo == append ==
|
||||
// :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-tricky == append ==
|
||||
// :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-warning == append ==
|
||||
// :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-workaround == append ==
|
||||
// :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
== comment.keyword-keyword == append ==
|
||||
// :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== comment.special-empty == append ==
|
||||
// EMPTY<CURSOR>
|
||||
== comment.special-fall-through == append ==
|
||||
// FALL THROUGH<CURSOR>
|
||||
== comment.special-implicit-type-conversion == append ==
|
||||
// IMPLICIT TYPE CONVERSION<CURSOR>
|
||||
== comment.special-no-return == append ==
|
||||
// NO RETURN<CURSOR>
|
||||
== comment.special-not-reached == append ==
|
||||
// NOT REACHED<CURSOR>
|
||||
== comment.special-remains-to-be-implemented == append ==
|
||||
// REMAINS TO BE IMPLEMENTED<CURSOR>
|
||||
== comment.special-constant-type-is-long == append ==
|
||||
// constant type is long<CURSOR>
|
||||
== comment.special-constant-type-is-unsigned == append ==
|
||||
// constant type is unsigned<CURSOR>
|
||||
== comment.special-constant-type-is-unsigned-long == append ==
|
||||
// constant type is unsigned long<CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
447
vim_plugins_src/cvim/c-support/templates/cpp.cpp.template
Normal file
447
vim_plugins_src/cvim/c-support/templates/cpp.cpp.template
Normal file
@ -0,0 +1,447 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
$
|
||||
== cpp.cin ==
|
||||
cin >> <CURSOR>;
|
||||
$
|
||||
== cpp.cout == insert ==
|
||||
cout << <CURSOR> << endl;
|
||||
$
|
||||
== cpp.cout-operator == insert ==
|
||||
<< "<CURSOR>"
|
||||
$
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.output-manipulator-boolalpha == insert ==
|
||||
<< boolalpha <CURSOR>
|
||||
== cpp.output-manipulator-dec == insert ==
|
||||
<< dec <CURSOR>
|
||||
== cpp.output-manipulator-endl == insert ==
|
||||
<< endl <CURSOR>
|
||||
== cpp.output-manipulator-fixed == insert ==
|
||||
<< fixed <CURSOR>
|
||||
== cpp.output-manipulator-flush == insert ==
|
||||
<< flush <CURSOR>
|
||||
== cpp.output-manipulator-hex == insert ==
|
||||
<< hex <CURSOR>
|
||||
== cpp.output-manipulator-internal == insert ==
|
||||
<< internal <CURSOR>
|
||||
== cpp.output-manipulator-left == insert ==
|
||||
<< left <CURSOR>
|
||||
== cpp.output-manipulator-oct == insert ==
|
||||
<< oct <CURSOR>
|
||||
== cpp.output-manipulator-right == insert ==
|
||||
<< right <CURSOR>
|
||||
== cpp.output-manipulator-scientific == insert ==
|
||||
<< scientific <CURSOR>
|
||||
== cpp.output-manipulator-setbase == insert ==
|
||||
<< setbase(10<CURSOR>)
|
||||
== cpp.output-manipulator-setfill == insert ==
|
||||
<< setfill(<CURSOR>)
|
||||
== cpp.output-manipulator-setiosflag == insert ==
|
||||
<< setiosflags(<CURSOR>)
|
||||
== cpp.output-manipulator-setprecision == insert ==
|
||||
<< setprecision(6<CURSOR>)
|
||||
== cpp.output-manipulator-setw == insert ==
|
||||
<< setw(0<CURSOR>)
|
||||
== cpp.output-manipulator-showbase == insert ==
|
||||
<< showbase <CURSOR>
|
||||
== cpp.output-manipulator-showpoint == insert ==
|
||||
<< showpoint <CURSOR>
|
||||
== cpp.output-manipulator-showpos == insert ==
|
||||
<< showpos <CURSOR>
|
||||
== cpp.output-manipulator-uppercase == insert ==
|
||||
<< uppercase <CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.method-implementation ==
|
||||
void<CURSOR>
|
||||
|?CLASSNAME|::|?METHODNAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} // ----- end of method |CLASSNAME|::|METHODNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.accessor-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: get_|?ATTRIBUTE|
|
||||
//--------------------------------------------------------------------------------------
|
||||
inline |?RETURNTYPE|
|
||||
|CLASSNAME|::get_|ATTRIBUTE| ( ) const
|
||||
{
|
||||
return |ATTRIBUTE|;
|
||||
} // ----- end of method |CLASSNAME|::get_|ATTRIBUTE| -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: set_|ATTRIBUTE|
|
||||
//--------------------------------------------------------------------------------------
|
||||
inline void
|
||||
|CLASSNAME|::set_|ATTRIBUTE| ( |RETURNTYPE| value )
|
||||
{
|
||||
|ATTRIBUTE| = value;
|
||||
return ;
|
||||
} // ----- end of method |CLASSNAME|::set_|ATTRIBUTE| -----
|
||||
<CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-definition ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME:c|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
// ==================== LIFECYCLE =======================================
|
||||
|CLASSNAME| (); // constructor
|
||||
|
||||
// ==================== ACCESSORS =======================================
|
||||
|
||||
// ==================== MUTATORS =======================================
|
||||
|
||||
// ==================== OPERATORS =======================================
|
||||
|
||||
protected:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
private:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
}; // ----- end of class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
|CLASSNAME|::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-using-new-definition ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME:c|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
// ==================== LIFECYCLE =======================================
|
||||
|CLASSNAME| (); // constructor
|
||||
|CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor
|
||||
~|CLASSNAME| (); // destructor
|
||||
|
||||
// ==================== ACCESSORS =======================================
|
||||
|
||||
// ==================== MUTATORS =======================================
|
||||
|
||||
// ==================== OPERATORS =======================================
|
||||
|
||||
|CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
|
||||
|
||||
protected:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
private:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
}; // ----- end of class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.class-using-new-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
|CLASSNAME|::|CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: copy constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other )
|
||||
{
|
||||
} // ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: ~|CLASSNAME|
|
||||
// Description: destructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
|CLASSNAME|::~|CLASSNAME| ()
|
||||
{
|
||||
} // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: operator =
|
||||
// Description: assignment operator
|
||||
//--------------------------------------------------------------------------------------
|
||||
|CLASSNAME|&
|
||||
|CLASSNAME|::operator = ( const |CLASSNAME| &other )
|
||||
{
|
||||
if ( this != &other ) {
|
||||
}
|
||||
return *this;
|
||||
} // ----- end of method |CLASSNAME|::operator = (assignment operator) -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.error-class ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME:c|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public: |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg) { }
|
||||
virtual ~|CLASSNAME| ( ) { }
|
||||
virtual string what ( ) const throw ( ) { return message; }
|
||||
protected: string message;
|
||||
}; // ---------- end of class |CLASSNAME| ----------
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-method-implementation ==
|
||||
template < class T >
|
||||
void<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} // ----- end of method |CLASSNAME|<T>::|METHODNAME| -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-accessor-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: get_|?ATTRIBUTE|
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
inline |?RETURNTYPE| |CLASSNAME|<T>::get_|ATTRIBUTE| ( ) const
|
||||
{
|
||||
return |ATTRIBUTE|;
|
||||
} // ----- end of method |CLASSNAME|<T>::get_|ATTRIBUTE| -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: set_|ATTRIBUTE|
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
inline void |CLASSNAME|<T>::set_|ATTRIBUTE| ( |RETURNTYPE| value )
|
||||
{
|
||||
|ATTRIBUTE| = value;
|
||||
return ;
|
||||
} // ----- end of method |CLASSNAME|<T>::set_|ATTRIBUTE| -----
|
||||
<CURSOR>
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-definition ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME:c|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
|
||||
template < class T >
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
// ==================== LIFECYCLE =======================================
|
||||
|CLASSNAME| (); // constructor
|
||||
|
||||
// ==================== ACCESSORS =======================================
|
||||
|
||||
// ==================== MUTATORS =======================================
|
||||
|
||||
// ==================== OPERATORS =======================================
|
||||
|
||||
protected:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
private:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
}; // ----- end of template class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
|CLASSNAME| <T>:: |CLASSNAME| ()
|
||||
{<CURSOR>
|
||||
} // ----- end of constructor of template class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-using-new-definition ==
|
||||
// =====================================================================================
|
||||
// Class: |?CLASSNAME:c|
|
||||
// Description: <CURSOR>
|
||||
// =====================================================================================
|
||||
|
||||
template < class T >
|
||||
class |CLASSNAME|
|
||||
{
|
||||
public:
|
||||
// ==================== LIFECYCLE =======================================
|
||||
|CLASSNAME| (); // constructor
|
||||
|CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor
|
||||
~|CLASSNAME| (); // destructor
|
||||
|
||||
// ==================== ACCESSORS =======================================
|
||||
|
||||
// ==================== MUTATORS =======================================
|
||||
|
||||
// ==================== OPERATORS =======================================
|
||||
|
||||
|CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator
|
||||
|
||||
protected:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
private:
|
||||
// ==================== DATA MEMBERS =======================================
|
||||
|
||||
}; // ----- end of template class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-class-using-new-implementation ==
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |?CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
|CLASSNAME|<T>::|CLASSNAME| ()
|
||||
{
|
||||
} // ----- end of constructor of template class |CLASSNAME| -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: |CLASSNAME|
|
||||
// Description: copy constructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
|CLASSNAME|<T>::|CLASSNAME| ( const |CLASSNAME| &other )
|
||||
{<CURSOR>
|
||||
} // ----- end of copy constructor of template class |CLASSNAME| -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: ~|CLASSNAME|
|
||||
// Description: destructor
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
|CLASSNAME|<T>::~|CLASSNAME| ()
|
||||
{
|
||||
} // ----- end of destructor of template class |CLASSNAME| -----
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Class: |CLASSNAME|
|
||||
// Method: operator =
|
||||
// Description: assignment operator
|
||||
//--------------------------------------------------------------------------------------
|
||||
template < class T >
|
||||
|CLASSNAME|<T>& |CLASSNAME|<T>::operator = ( const |CLASSNAME| &other )
|
||||
{
|
||||
if ( this != &other ) {
|
||||
}
|
||||
return *this;
|
||||
} // ----- end of assignment operator of template class |CLASSNAME| -----
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.template-function ==
|
||||
template <class T>
|
||||
void<CURSOR> |?TEMPALTE_FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
return ;
|
||||
} // ----- end of template function |?TEMPALTE_FUNCTION_NAME| -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.operator-in ==
|
||||
ostream &
|
||||
operator << ( ostream & os, const |?CLASSNAME| & obj )
|
||||
{
|
||||
os << obj.<CURSOR> ;
|
||||
return os;
|
||||
} // ----- end of function operator << -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.operator-out ==
|
||||
istream &
|
||||
operator >> ( istream & is, |?CLASSNAME| & obj )
|
||||
{
|
||||
is >> obj.<CURSOR> ;
|
||||
return is;
|
||||
} // ----- end of function operator >> -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.try-catch ==
|
||||
try {
|
||||
<SPLIT>}
|
||||
catch ( const <CURSOR> &ExceptObj ) { // handle exception:
|
||||
}
|
||||
catch (...) { // handle exception: unspecified
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.catch ==
|
||||
catch ( const <CURSOR> &ExceptObj ) { // handle exception:
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.catch-points ==
|
||||
catch (...) { // handle exception: unspecified
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.extern ==
|
||||
extern "C" {<CURSOR>
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.open-input-file ==
|
||||
string ifs_file_name = "<CURSOR>"; // input file name
|
||||
ifstream ifs; // create ifstream object
|
||||
|
||||
ifs.open ( ifs_file_name.c_str() ); // open ifstream
|
||||
if (!ifs) {
|
||||
cerr << "\nERROR : failed to open input file " << ifs_file_name << endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
ifs.close (); // close ifstream
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.open-output-file ==
|
||||
string ofs_file_name = "<CURSOR>"; // input file name
|
||||
ofstream ofs; // create ofstream object
|
||||
|
||||
ofs.open ( ofs_file_name.c_str() ); // open ofstream
|
||||
if (!ofs) {
|
||||
cerr << "\nERROR : failed to open output file " << ofs_file_name << endl;
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
ofs.close (); // close ofstream
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.namespace-std ==
|
||||
using namespace std;
|
||||
== cpp.namespace ==
|
||||
using namespace |?NAMESPACE|;
|
||||
== cpp.namespace-block ==
|
||||
namespace |?NAMESPACE| {<CURSOR>
|
||||
<SPLIT>} // ----- end of namespace |NAMESPACE| -----
|
||||
== cpp.namespace-alias ==
|
||||
namespace |?NAMESPACE_ALIAS| = {-original namespace name-};
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== cpp.rtti-typeid == insert ==
|
||||
typeid(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-static-cast == insert ==
|
||||
static_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-const-cast == insert ==
|
||||
const_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-reinterpret-cast == insert ==
|
||||
reinterpret_cast<>(<CURSOR><SPLIT>)
|
||||
$
|
||||
== cpp.rtti-dynamic-cast == insert ==
|
||||
dynamic_cast<>(<CURSOR><SPLIT>)
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
117
vim_plugins_src/cvim/c-support/templates/cpp.idioms.template
Normal file
117
vim_plugins_src/cvim/c-support/templates/cpp.idioms.template
Normal file
@ -0,0 +1,117 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.function ==
|
||||
void<CURSOR>
|
||||
|?FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
<SPLIT> return <+return value+>;
|
||||
} // ----- end of function |FUNCTION_NAME| -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.function-static ==
|
||||
static void<CURSOR>
|
||||
|?FUNCTION_NAME| ( <+argument list+> )
|
||||
{
|
||||
<SPLIT> return <+return value+>;
|
||||
} // ----- end of static function |FUNCTION_NAME| -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.main ==
|
||||
#include <cstdlib>
|
||||
|
||||
int
|
||||
main ( int argc, char *argv[] )
|
||||
{<CURSOR>
|
||||
<SPLIT> return EXIT_SUCCESS;
|
||||
} // ---------- end of function main ----------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.enum ==
|
||||
enum |?ENUM_NAME| {<CURSOR>
|
||||
<SPLIT>}; // ---------- end of enum |ENUM_NAME| ----------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.struct ==
|
||||
struct |?STRUCT_NAME| {<CURSOR>
|
||||
<SPLIT>}; // ---------- end of struct |STRUCT_NAME| ----------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.union ==
|
||||
union |?UNION_NAME| {<CURSOR>
|
||||
<SPLIT>}; // ---------- end of union |UNION_NAME| ----------
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.printf == insert ==
|
||||
printf ( "<CURSOR>\n" );
|
||||
== idioms.scanf == insert ==
|
||||
scanf ( "<CURSOR>", & );
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.calloc ==
|
||||
|?POINTER| = calloc ( (size_t)(<CURSOR><+COUNT+>), sizeof(<+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
free (|POINTER|);
|
||||
|POINTER| = NULL;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.malloc ==
|
||||
|?POINTER| = malloc ( sizeof(<CURSOR><+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
free (|POINTER|);
|
||||
|POINTER| = NULL;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.realloc ==
|
||||
|?POINTER| = realloc ( |POINTER|, sizeof(<CURSOR><+TYPE+>) );
|
||||
if ( |POINTER|==NULL ) {
|
||||
fprintf ( stderr, "\ndynamic memory reallocation failed\n" );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.sizeof == insert ==
|
||||
sizeof(<CURSOR><SPLIT>)
|
||||
== idioms.assert == insert ==
|
||||
assert(<CURSOR><SPLIT>);
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.open-input-file ==
|
||||
FILE *|?FILEPOINTER|; // input-file pointer
|
||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; // input-file name
|
||||
|
||||
|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" );
|
||||
if ( |FILEPOINTER| == NULL ) {
|
||||
fprintf ( stderr, "couldn't open file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
if( fclose(|FILEPOINTER|) == EOF ) { // close input file
|
||||
fprintf ( stderr, "couldn't close file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.open-output-file ==
|
||||
FILE *|?FILEPOINTER|; // output-file pointer
|
||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; // output-file name
|
||||
|
||||
|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" );
|
||||
if ( |FILEPOINTER| == NULL ) {
|
||||
fprintf ( stderr, "couldn't open file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
<SPLIT>{-continue here-}
|
||||
if( fclose(|FILEPOINTER|) == EOF ) { // close output file
|
||||
fprintf ( stderr, "couldn't close file '%s'; %s\n",
|
||||
|FILEPOINTER|_file_name, strerror(errno) );
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== idioms.fprintf == insert ==
|
||||
fprintf ( |?FILEPOINTER|, "<CURSOR>\n", );
|
||||
== idioms.fscanf == insert ==
|
||||
fscanf ( |?FILEPOINTER|, "<CURSOR>", & );
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
@ -0,0 +1,54 @@
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.include-global ==
|
||||
#include <<CURSOR>>
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.include-local ==
|
||||
#include "<CURSOR>"
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.define ==
|
||||
#define <CURSOR> //
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.undefine ==
|
||||
#undef <CURSOR> //
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.if-endif ==
|
||||
#if |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#endif // ----- |CONDITION| -----
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.if-else-endif ==
|
||||
#if |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else // ----- not |CONDITION| -----
|
||||
<+ELSE PART+>
|
||||
#endif // ----- not |CONDITION| -----
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifdef-else-endif ==
|
||||
#ifdef |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else // ----- not |CONDITION| -----
|
||||
<+ELSE PART+>
|
||||
#endif // ----- not |CONDITION| -----
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifndef-else-endif ==
|
||||
#ifndef |?CONDITION:u|
|
||||
<CURSOR><SPLIT>
|
||||
#else // ----- not |CONDITION| -----
|
||||
<+ELSE PART+>
|
||||
#endif // ----- not |CONDITION| -----
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.ifndef-def-endif ==
|
||||
#ifndef |?BASENAME:L|_INC
|
||||
#define |BASENAME|_INC
|
||||
<CURSOR><SPLIT>
|
||||
#endif // ----- #ifndef |BASENAME|_INC -----
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.error ==
|
||||
#error "<CURSOR>" //
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.line ==
|
||||
#line <CURSOR> //
|
||||
$-------------------------------------------------------------------------
|
||||
== preprocessor.pragma ==
|
||||
#pragma <CURSOR> //
|
||||
$-------------------------------------------------------------------------
|
@ -0,0 +1,72 @@
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.do-while ==
|
||||
do {
|
||||
<SPLIT>} while ( <CURSOR> ); // ----- end do-while -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.for ==
|
||||
for ( <CURSOR>; ; )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.for-block ==
|
||||
for ( <CURSOR>; ; ) {
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if ==
|
||||
if ( <CURSOR> )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-block ==
|
||||
if ( <CURSOR> ) {
|
||||
<SPLIT><-IF PART->
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-else ==
|
||||
if ( <CURSOR> )
|
||||
<SPLIT>else
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.if-block-else ==
|
||||
if ( <CURSOR> ) {
|
||||
<SPLIT><-IF PART->
|
||||
}
|
||||
else {
|
||||
<+ELSE PART+>
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.else-block ==
|
||||
else {
|
||||
<CURSOR><SPLIT>
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.while ==
|
||||
while ( <CURSOR> )
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.while-block ==
|
||||
while ( <CURSOR> ) {
|
||||
<SPLIT>}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.switch ==
|
||||
switch ( <CURSOR> ) {
|
||||
case 1:
|
||||
<SPLIT>break;
|
||||
|
||||
case 2:
|
||||
break;
|
||||
|
||||
case 3:
|
||||
break;
|
||||
|
||||
case 4:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} // ----- end switch -----
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.case ==
|
||||
case <CURSOR>:
|
||||
break;
|
||||
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
== statements.block ==
|
||||
{
|
||||
<CURSOR><SPLIT>
|
||||
}
|
||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
220
vim_plugins_src/cvim/c-support/wordlists/c-c++-keywords.list
Normal file
220
vim_plugins_src/cvim/c-support/wordlists/c-c++-keywords.list
Normal file
@ -0,0 +1,220 @@
|
||||
adjustfield
|
||||
basefield
|
||||
boolalpha
|
||||
floatfield
|
||||
internal
|
||||
scientific
|
||||
setbase
|
||||
setiosflags
|
||||
setprecision
|
||||
showbase
|
||||
showpoint
|
||||
showpos
|
||||
uppercase
|
||||
|
||||
auto
|
||||
break
|
||||
case
|
||||
char
|
||||
const
|
||||
continue
|
||||
default
|
||||
double
|
||||
else
|
||||
enum
|
||||
extern
|
||||
float
|
||||
goto
|
||||
inline
|
||||
long
|
||||
register
|
||||
restrict
|
||||
return
|
||||
short
|
||||
signed
|
||||
sizeof
|
||||
static
|
||||
struct
|
||||
switch
|
||||
typedef
|
||||
union
|
||||
unsigned
|
||||
void
|
||||
volatile
|
||||
while
|
||||
_Bool
|
||||
_Complex
|
||||
_Imaginary
|
||||
EXIT_FAILURE
|
||||
EXIT_SUCCESS
|
||||
size_t
|
||||
|
||||
alignas
|
||||
alignof
|
||||
bool
|
||||
catch
|
||||
char16_t
|
||||
char32_t
|
||||
class
|
||||
constexpr
|
||||
const_cast
|
||||
decltype
|
||||
delete
|
||||
dynamic_cast
|
||||
explicit
|
||||
export
|
||||
false
|
||||
friend
|
||||
mutable
|
||||
namespace
|
||||
new
|
||||
neexcept
|
||||
nullptr
|
||||
operator
|
||||
private
|
||||
protected
|
||||
public
|
||||
reinterpret_cast
|
||||
static_assert
|
||||
static_cast
|
||||
template
|
||||
this
|
||||
thread_local
|
||||
throw
|
||||
true
|
||||
typeid
|
||||
typename
|
||||
using
|
||||
virtual
|
||||
wchar_t
|
||||
|
||||
and_eq
|
||||
bitand
|
||||
bitor
|
||||
compl
|
||||
not_eq
|
||||
or_eq
|
||||
xor_eq
|
||||
|
||||
define
|
||||
defined
|
||||
elif
|
||||
endif
|
||||
error
|
||||
ifdef
|
||||
ifndef
|
||||
include
|
||||
pragma
|
||||
undef
|
||||
|
||||
exception
|
||||
bad_alloc
|
||||
bad_exception
|
||||
bad_cast
|
||||
bad_typeid
|
||||
ios_base::failure
|
||||
logic_error
|
||||
domain_error
|
||||
invalid_argument
|
||||
length_error
|
||||
out_of_range
|
||||
runtime_error
|
||||
range_error
|
||||
overflow_error
|
||||
underflow_error
|
||||
uncaught_exception
|
||||
|
||||
__DATE__
|
||||
__FILE__
|
||||
__LINE__
|
||||
__STDC__
|
||||
__STDC_HOSTED__
|
||||
__STDC_IEC_559__
|
||||
__STDC_IEC_559_COMPLEX__
|
||||
__STDC_ISO_10646__
|
||||
__STDC_VERSION__
|
||||
__TIME__
|
||||
__func__
|
||||
__cplusplus
|
||||
|
||||
__BORLANDC__
|
||||
__CYGWIN__
|
||||
__CYGWIN32__
|
||||
__GNUC__
|
||||
__WIN32__
|
||||
__WINDOWS__
|
||||
|
||||
assert
|
||||
ctype
|
||||
errno
|
||||
float
|
||||
limits
|
||||
locale
|
||||
math
|
||||
setjmp
|
||||
signal
|
||||
stdarg
|
||||
stddef
|
||||
stdio
|
||||
stdlib
|
||||
string
|
||||
time
|
||||
|
||||
complex
|
||||
fenv
|
||||
inttypes
|
||||
iso646
|
||||
stdbool
|
||||
stdint
|
||||
tgmath
|
||||
wchar
|
||||
wctype
|
||||
|
||||
algorithm
|
||||
bitset
|
||||
complex
|
||||
deque
|
||||
exception
|
||||
fstream
|
||||
functional
|
||||
iomanip
|
||||
ios
|
||||
iosfwd
|
||||
iostream
|
||||
istream
|
||||
iterator
|
||||
limits
|
||||
list
|
||||
locale
|
||||
|
||||
map
|
||||
memory
|
||||
numeric
|
||||
ostream
|
||||
queue
|
||||
set
|
||||
sstream
|
||||
stack
|
||||
stdexcept
|
||||
streambuf
|
||||
string
|
||||
typeinfo
|
||||
utility
|
||||
valarray
|
||||
vector
|
||||
|
||||
cassert
|
||||
cctype
|
||||
cerrno
|
||||
cfloat
|
||||
climits
|
||||
clocale
|
||||
cmath
|
||||
csetjmp
|
||||
csignal
|
||||
cstdarg
|
||||
cstddef
|
||||
cstdio
|
||||
cstdlib
|
||||
cstring
|
||||
ctime
|
108
vim_plugins_src/cvim/c-support/wordlists/k+r.list
Normal file
108
vim_plugins_src/cvim/c-support/wordlists/k+r.list
Normal file
@ -0,0 +1,108 @@
|
||||
address
|
||||
allocator
|
||||
allocation
|
||||
argument
|
||||
arithmetic
|
||||
array
|
||||
assignement
|
||||
bitwise
|
||||
block
|
||||
character
|
||||
command
|
||||
condition
|
||||
conditional
|
||||
constant
|
||||
conversion
|
||||
declaration
|
||||
decrement
|
||||
defined
|
||||
definition
|
||||
descriptor
|
||||
description
|
||||
dimension
|
||||
evaluation
|
||||
expression
|
||||
external
|
||||
format
|
||||
formatted
|
||||
function
|
||||
global
|
||||
handling
|
||||
identifier
|
||||
implementation
|
||||
increment
|
||||
initialization
|
||||
input
|
||||
interface
|
||||
label
|
||||
lexical
|
||||
local
|
||||
logical
|
||||
lookup
|
||||
loop
|
||||
lvalue
|
||||
miscellaneous
|
||||
notation
|
||||
numerical
|
||||
operator
|
||||
operation
|
||||
output
|
||||
pointer
|
||||
precedence
|
||||
preprocessor
|
||||
preprocessing
|
||||
program
|
||||
random
|
||||
recursion
|
||||
recursive
|
||||
reference
|
||||
referential
|
||||
relational
|
||||
scope
|
||||
standard
|
||||
statement
|
||||
string
|
||||
structure
|
||||
system
|
||||
undefined
|
||||
variable
|
||||
|
||||
abstract
|
||||
algorithm
|
||||
alignment
|
||||
application
|
||||
assignment
|
||||
asynchronous
|
||||
binary
|
||||
buffer
|
||||
component
|
||||
constructor
|
||||
container
|
||||
destructor
|
||||
difference
|
||||
enumeration
|
||||
exception
|
||||
floating-point
|
||||
horizontal
|
||||
inheritance
|
||||
instantiation
|
||||
integer
|
||||
internal
|
||||
invariant
|
||||
iterator
|
||||
localization
|
||||
overflow
|
||||
overload
|
||||
override
|
||||
overwrite
|
||||
polymorphic
|
||||
portability
|
||||
position
|
||||
postcondition
|
||||
precision
|
||||
precondition
|
||||
prototype
|
||||
subscript
|
||||
underflow
|
||||
vertical
|
||||
whitespace
|
202
vim_plugins_src/cvim/c-support/wordlists/stl_index.list
Normal file
202
vim_plugins_src/cvim/c-support/wordlists/stl_index.list
Normal file
@ -0,0 +1,202 @@
|
||||
accumulate
|
||||
adjacent_difference
|
||||
adjacent_find
|
||||
advance
|
||||
append
|
||||
assign
|
||||
auto_ptr
|
||||
back
|
||||
back_inserter
|
||||
basic_string
|
||||
bidirectional_iterator
|
||||
bidirectional_iterator_tag
|
||||
binary_compose
|
||||
binary_function
|
||||
binary_negate
|
||||
binary_search
|
||||
bind1st
|
||||
bind2nd
|
||||
bit_vector
|
||||
bitset
|
||||
capacity
|
||||
char_producer
|
||||
char_traits
|
||||
char_type
|
||||
compare
|
||||
construct
|
||||
copy
|
||||
copy_backward
|
||||
copy_n
|
||||
count
|
||||
count_if
|
||||
deque
|
||||
destroy
|
||||
distance
|
||||
distance_type
|
||||
divides
|
||||
equal
|
||||
equal_range
|
||||
equal_to
|
||||
erase
|
||||
fill
|
||||
fill_n
|
||||
find
|
||||
find_end
|
||||
find_first_not_of
|
||||
find_first_of
|
||||
find_if
|
||||
find_last_not_of
|
||||
find_last_of
|
||||
for_each
|
||||
forward_iterator
|
||||
forward_iterator_tag
|
||||
front
|
||||
front_inserter
|
||||
generate
|
||||
generate_n
|
||||
get_temporary_buffer
|
||||
greater
|
||||
greater_equal
|
||||
hash
|
||||
hash_map
|
||||
hash_multimap
|
||||
hash_multiset
|
||||
hash_set
|
||||
identity
|
||||
includes
|
||||
inner_product
|
||||
inplace_merge
|
||||
input_iterator
|
||||
input_iterator_tag
|
||||
insert
|
||||
insert_iterator
|
||||
inserter
|
||||
int_type
|
||||
iota
|
||||
is_heap
|
||||
is_sorted
|
||||
istream_iterator
|
||||
istream_type
|
||||
istreambuf_iterator
|
||||
iter_swap
|
||||
iterator_category
|
||||
iterator_traits
|
||||
less
|
||||
less_equal
|
||||
lexicographical_compare
|
||||
lexicographical_compare_3way
|
||||
list
|
||||
logical_and
|
||||
logical_not
|
||||
logical_or
|
||||
lower_bound
|
||||
make_heap
|
||||
make_pair
|
||||
map
|
||||
max
|
||||
max_element
|
||||
mem_fun1_ref_t
|
||||
mem_fun1_t
|
||||
mem_fun_ref_t
|
||||
mem_fun_t
|
||||
merge
|
||||
min
|
||||
min_element
|
||||
minus
|
||||
mismatch
|
||||
modulus
|
||||
multimap
|
||||
multiplies
|
||||
multiset
|
||||
negate
|
||||
next_permutation
|
||||
not_equal_to
|
||||
nth_element
|
||||
operator
|
||||
ostream_iterator
|
||||
ostreambuf_iterator
|
||||
output_iterator
|
||||
output_iterator_tag
|
||||
pair
|
||||
partial_sort
|
||||
partial_sort_copy
|
||||
partial_sum
|
||||
partition
|
||||
plus
|
||||
pointer_to_binary_function
|
||||
pointer_to_unary_function
|
||||
pop_back
|
||||
pop_front
|
||||
pop_heap
|
||||
power
|
||||
prev_permutation
|
||||
priority_queue
|
||||
project1st
|
||||
project2nd
|
||||
ptr_fun
|
||||
push_back
|
||||
push_front
|
||||
push_heap
|
||||
queue
|
||||
random_access_iterator
|
||||
random_access_iterator_tag
|
||||
random_sample
|
||||
random_sample_n
|
||||
random_shuffle
|
||||
raw_storage_iterator
|
||||
release
|
||||
remove
|
||||
remove_copy
|
||||
remove_copy_if
|
||||
remove_if
|
||||
replace
|
||||
replace_copy
|
||||
replace_copy_if
|
||||
replace_if
|
||||
reset
|
||||
resize
|
||||
return_temporary_buffer
|
||||
reverse
|
||||
reverse_bidirectional_iterator
|
||||
reverse_copy
|
||||
reverse_iterator
|
||||
rfind
|
||||
rope
|
||||
rotate
|
||||
rotate_copy
|
||||
search
|
||||
search_n
|
||||
select1st
|
||||
select2nd
|
||||
sequence_buffer
|
||||
set
|
||||
set_difference
|
||||
set_intersection
|
||||
set_symmetric_difference
|
||||
set_union
|
||||
slist
|
||||
sort
|
||||
sort_heap
|
||||
stable_partition
|
||||
stable_sort
|
||||
stack
|
||||
streambuf_type
|
||||
substr
|
||||
subtractive_rng
|
||||
swap
|
||||
swap_ranges
|
||||
temporary_buffer
|
||||
transform
|
||||
unary_compose
|
||||
unary_function
|
||||
unary_negate
|
||||
uninitialized_copy
|
||||
uninitialized_copy_n
|
||||
uninitialized_fill
|
||||
uninitialized_fill_n
|
||||
unique
|
||||
unique_copy
|
||||
upper_bound
|
||||
value_comp
|
||||
value_type
|
||||
vector
|
2257
vim_plugins_src/cvim/doc/csupport.txt
Normal file
2257
vim_plugins_src/cvim/doc/csupport.txt
Normal file
File diff suppressed because it is too large
Load Diff
487
vim_plugins_src/cvim/ftplugin/c.vim
Normal file
487
vim_plugins_src/cvim/ftplugin/c.vim
Normal file
@ -0,0 +1,487 @@
|
||||
" ------------------------------------------------------------------------------
|
||||
"
|
||||
" Vim filetype plugin file
|
||||
"
|
||||
" Language : C / C++
|
||||
" Plugin : c.vim
|
||||
" Maintainer : Fritz Mehner <mehner@fh-swf.de>
|
||||
" Revision : $Id: c.vim,v 1.71 2011/12/27 21:04:33 mehner Exp $
|
||||
"
|
||||
" ------------------------------------------------------------------------------
|
||||
"
|
||||
" Only do this when not done yet for this buffer
|
||||
"
|
||||
if exists("b:did_C_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_C_ftplugin = 1
|
||||
"
|
||||
" ---------- system installation or local installation ----------
|
||||
"
|
||||
let s:installation = 'local'
|
||||
if match( expand("<sfile>"), escape( $VIM, ' \' ) ) == 0
|
||||
let s:installation = 'system'
|
||||
endif
|
||||
"
|
||||
" ---------- Do we have a mapleader other than '\' ? ------------
|
||||
"
|
||||
if exists("g:C_MapLeader")
|
||||
let maplocalleader = g:C_MapLeader
|
||||
endif
|
||||
"
|
||||
" ---------- C/C++ dictionary -----------------------------------
|
||||
" This will enable keyword completion for C and C++
|
||||
" using Vim's dictionary feature |i_CTRL-X_CTRL-K|.
|
||||
" Set the new dictionaries in front of the existing ones
|
||||
"
|
||||
if exists("g:C_Dictionary_File")
|
||||
let save=&dictionary
|
||||
silent! exe 'setlocal dictionary='.g:C_Dictionary_File
|
||||
silent! exe 'setlocal dictionary+='.save
|
||||
endif
|
||||
"
|
||||
" ---------- F-key mappings ------------------------------------
|
||||
"
|
||||
" Alt-F9 write buffer and compile
|
||||
" F9 compile and link
|
||||
" Ctrl-F9 run executable
|
||||
" Shift-F9 command line arguments
|
||||
"
|
||||
map <buffer> <silent> <A-F9> :call C_Compile()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <A-F9> <C-C>:call C_Compile()<CR>:call C_HlMessage()<CR>
|
||||
"
|
||||
map <buffer> <silent> <F9> :call C_Link()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <F9> <C-C>:call C_Link()<CR>:call C_HlMessage()<CR>
|
||||
"
|
||||
map <buffer> <silent> <C-F9> :call C_Run()<CR>
|
||||
imap <buffer> <silent> <C-F9> <C-C>:call C_Run()<CR>
|
||||
"
|
||||
map <buffer> <silent> <S-F9> :call C_Arguments()<CR>
|
||||
imap <buffer> <silent> <S-F9> <C-C>:call C_Arguments()<CR>
|
||||
"
|
||||
" ---------- alternate file plugin (a.vim) ----------------------
|
||||
"
|
||||
if exists("loaded_alternateFile")
|
||||
map <buffer> <silent> <S-F2> :A<CR>
|
||||
imap <buffer> <silent> <S-F2> <C-C>:A<CR>
|
||||
endif
|
||||
"
|
||||
command! -nargs=1 -complete=customlist,C_CFileSectionList CFileSection call C_CFileSectionListInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_HFileSectionList HFileSection call C_HFileSectionListInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_KeywordCommentList KeywordComment call C_KeywordCommentListInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_SpecialCommentList SpecialComment call C_SpecialCommentListInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_StdLibraryIncludesList IncludeStdLibrary call C_StdLibraryIncludesInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_C99LibraryIncludesList IncludeC99Library call C_C99LibraryIncludesInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_CppLibraryIncludesList IncludeCppLibrary call C_CppLibraryIncludesInsert (<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_CppCLibraryIncludesList IncludeCppCLibrary call C_CppCLibraryIncludesInsert(<f-args>)
|
||||
command! -nargs=1 -complete=customlist,C_StyleList CStyle call C_Style (<f-args>)
|
||||
|
||||
" ---------- KEY MAPPINGS : MENU ENTRIES -------------------------------------
|
||||
" ---------- comments menu ------------------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>cl :call C_EndOfLineComment()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cl <Esc>:call C_EndOfLineComment()<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>cl :call C_EndOfLineComment()<CR>
|
||||
"
|
||||
nnoremap <buffer> <silent> <LocalLeader>cj :call C_AdjustLineEndComm()<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>cj :call C_AdjustLineEndComm()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cj <Esc>:call C_AdjustLineEndComm()<CR>a
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>cs :call C_GetLineEndCommCol()<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>c* :call C_CodeToCommentC()<CR>:nohlsearch<CR>j
|
||||
vnoremap <buffer> <silent> <LocalLeader>c* :call C_CodeToCommentC()<CR>:nohlsearch<CR>j
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>cc :call C_CodeToCommentCpp()<CR>:nohlsearch<CR>j
|
||||
vnoremap <buffer> <silent> <LocalLeader>cc :call C_CodeToCommentCpp()<CR>:nohlsearch<CR>j
|
||||
noremap <buffer> <silent> <LocalLeader>co :call C_CommentToCode()<CR>:nohlsearch<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>co :call C_CommentToCode()<CR>:nohlsearch<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>cfr :call C_InsertTemplate("comment.frame")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>cfu :call C_InsertTemplate("comment.function")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>cme :call C_InsertTemplate("comment.method")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>ccl :call C_InsertTemplate("comment.class")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>cfdi :call C_InsertTemplate("comment.file-description")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>cfdh :call C_InsertTemplate("comment.file-description-header")<CR>
|
||||
|
||||
inoremap <buffer> <silent> <LocalLeader>cfr <Esc>:call C_InsertTemplate("comment.frame")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cfu <Esc>:call C_InsertTemplate("comment.function")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cme <Esc>:call C_InsertTemplate("comment.method")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ccl <Esc>:call C_InsertTemplate("comment.class")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cfdi <Esc>:call C_InsertTemplate("comment.file-description")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cfdh <Esc>:call C_InsertTemplate("comment.file-description-header")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>cd <Esc>:call C_InsertDateAndTime('d')<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cd <Esc>:call C_InsertDateAndTime('d')<CR>a
|
||||
vnoremap <buffer> <silent> <LocalLeader>cd s<Esc>:call C_InsertDateAndTime('d')<CR>a
|
||||
noremap <buffer> <silent> <LocalLeader>ct <Esc>:call C_InsertDateAndTime('dt')<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ct <Esc>:call C_InsertDateAndTime('dt')<CR>a
|
||||
vnoremap <buffer> <silent> <LocalLeader>ct s<Esc>:call C_InsertDateAndTime('dt')<CR>a
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>cx :call C_CommentToggle( )<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>cx <Esc>:call C_CommentToggle( )<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>cx :call C_CommentToggle( )<CR>
|
||||
"
|
||||
" call the above defined commands:
|
||||
"
|
||||
noremap <buffer> <LocalLeader>ccs <Esc>:CFileSection<Space>
|
||||
noremap <buffer> <LocalLeader>chs <Esc>:HFileSection<Space>
|
||||
noremap <buffer> <LocalLeader>ckc <Esc>:KeywordComment<Space>
|
||||
noremap <buffer> <LocalLeader>csc <Esc>:SpecialComment<Space>
|
||||
"
|
||||
inoremap <buffer> <LocalLeader>ccs <Esc>:CFileSection<Space>
|
||||
inoremap <buffer> <LocalLeader>chs <Esc>:HFileSection<Space>
|
||||
inoremap <buffer> <LocalLeader>ckc <Esc>:KeywordComment<Space>
|
||||
inoremap <buffer> <LocalLeader>csc <Esc>:SpecialComment<Space>
|
||||
"
|
||||
" ---------- statements menu ------------------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>sd :call C_InsertTemplate("statements.do-while")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sd <Esc>:call C_InsertTemplate("statements.do-while", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sd <Esc>:call C_InsertTemplate("statements.do-while")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sf :call C_InsertTemplate("statements.for")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sf <Esc>:call C_InsertTemplate("statements.for")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sfo :call C_InsertTemplate("statements.for-block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sfo <Esc>:call C_InsertTemplate("statements.for-block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sfo <Esc>:call C_InsertTemplate("statements.for-block")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>si :call C_InsertTemplate("statements.if")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>si <Esc>:call C_InsertTemplate("statements.if")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sif :call C_InsertTemplate("statements.if-block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sif <Esc>:call C_InsertTemplate("statements.if-block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sif <Esc>:call C_InsertTemplate("statements.if-block")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sie :call C_InsertTemplate("statements.if-else")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sie <Esc>:call C_InsertTemplate("statements.if-else", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sie <Esc>:call C_InsertTemplate("statements.if-else")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sife :call C_InsertTemplate("statements.if-block-else")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sife <Esc>:call C_InsertTemplate("statements.if-block-else", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sife <Esc>:call C_InsertTemplate("statements.if-block-else")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>se :call C_InsertTemplate("statements.else-block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>se <Esc>:call C_InsertTemplate("statements.else-block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>se <Esc>:call C_InsertTemplate("statements.else-block")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sw :call C_InsertTemplate("statements.while")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sw <Esc>:call C_InsertTemplate("statements.while")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>swh :call C_InsertTemplate("statements.while-block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>swh <Esc>:call C_InsertTemplate("statements.while-block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>swh <Esc>:call C_InsertTemplate("statements.while-block")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>ss :call C_InsertTemplate("statements.switch")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>ss <Esc>:call C_InsertTemplate("statements.switch", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ss <Esc>:call C_InsertTemplate("statements.switch")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sc :call C_InsertTemplate("statements.case")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sc <Esc>:call C_InsertTemplate("statements.case")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>s{ :call C_InsertTemplate("statements.block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>s{ <Esc>:call C_InsertTemplate("statements.block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>s{ <Esc>:call C_InsertTemplate("statements.block")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>sb :call C_InsertTemplate("statements.block")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>sb <Esc>:call C_InsertTemplate("statements.block", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>sb <Esc>:call C_InsertTemplate("statements.block")<CR>
|
||||
"
|
||||
" ---------- preprocessor menu ----------------------------------------------
|
||||
"
|
||||
noremap <buffer> <LocalLeader>ps :IncludeStdLibrary<Space>
|
||||
inoremap <buffer> <LocalLeader>ps <Esc>:IncludeStdLibrary<Space>
|
||||
noremap <buffer> <LocalLeader>pc :IncludeC99Library<Space>
|
||||
inoremap <buffer> <LocalLeader>pc <Esc>:IncludeC99Library<Space>
|
||||
noremap <buffer> <LocalLeader>+ps :IncludeCppLibrary<Space>
|
||||
inoremap <buffer> <LocalLeader>+ps <Esc>:IncludeCppLibrary<Space>
|
||||
noremap <buffer> <LocalLeader>+pc :IncludeCppCLibrary<Space>
|
||||
inoremap <buffer> <LocalLeader>+pc <Esc>:IncludeCppC9Library<Space>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>p< :call C_InsertTemplate("preprocessor.include-global")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>p" :call C_InsertTemplate("preprocessor.include-local")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pd :call C_InsertTemplate("preprocessor.define")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pu :call C_InsertTemplate("preprocessor.undefine")<CR>
|
||||
"
|
||||
inoremap <buffer> <silent> <LocalLeader>p< <Esc>:call C_InsertTemplate("preprocessor.include-global")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>p" <Esc>:call C_InsertTemplate("preprocessor.include-local")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pd <Esc>:call C_InsertTemplate("preprocessor.define")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pu <Esc>:call C_InsertTemplate("preprocessor.undefine")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>pif :call C_InsertTemplate("preprocessor.if-endif")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pie :call C_InsertTemplate("preprocessor.if-else-endif")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pid :call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pin :call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pind :call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR>
|
||||
|
||||
vnoremap <buffer> <silent> <LocalLeader>pif <Esc>:call C_InsertTemplate("preprocessor.if-endif", "v")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>pie <Esc>:call C_InsertTemplate("preprocessor.if-else-endif", "v")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>pid <Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif", "v")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>pin <Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif", "v")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>pind <Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif", "v")<CR>
|
||||
|
||||
inoremap <buffer> <silent> <LocalLeader>pif <Esc>:call C_InsertTemplate("preprocessor.if-endif")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pie <Esc>:call C_InsertTemplate("preprocessor.if-else-endif")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pid <Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pin <Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pind <Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>pi0 :call C_PPIf0("a")<CR>2ji
|
||||
inoremap <buffer> <silent> <LocalLeader>pi0 <Esc>:call C_PPIf0("a")<CR>2ji
|
||||
vnoremap <buffer> <silent> <LocalLeader>pi0 <Esc>:call C_PPIf0("v")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>pr0 :call C_PPIf0Remove()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pr0 <Esc>:call C_PPIf0Remove()<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>pe :call C_InsertTemplate("preprocessor.error")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pl :call C_InsertTemplate("preprocessor.line")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>pp :call C_InsertTemplate("preprocessor.pragma")<CR>
|
||||
"
|
||||
inoremap <buffer> <silent> <LocalLeader>pe <Esc>:call C_InsertTemplate("preprocessor.error")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pl <Esc>:call C_InsertTemplate("preprocessor.line")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>pp <Esc>:call C_InsertTemplate("preprocessor.pragma")<CR>
|
||||
"
|
||||
" ---------- idioms menu ----------------------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>if :call C_InsertTemplate("idioms.function")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>if <Esc>:call C_InsertTemplate("idioms.function", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>if <Esc>:call C_InsertTemplate("idioms.function")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>isf :call C_InsertTemplate("idioms.function-static")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>isf <Esc>:call C_InsertTemplate("idioms.function-static", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>isf <Esc>:call C_InsertTemplate("idioms.function-static")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>im :call C_InsertTemplate("idioms.main")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>im <Esc>:call C_InsertTemplate("idioms.main", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>im <Esc>:call C_InsertTemplate("idioms.main")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>i0 :call C_CodeFor("up" )<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>i0 :call C_CodeFor("up" )<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>i0 <Esc>:call C_CodeFor("up" )<CR>i
|
||||
noremap <buffer> <silent> <LocalLeader>in :call C_CodeFor("down")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>in :call C_CodeFor("down")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>in <Esc>:call C_CodeFor("down")<CR>i
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ie :call C_InsertTemplate("idioms.enum")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>ie <Esc>:call C_InsertTemplate("idioms.enum" , "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ie <Esc>:call C_InsertTemplate("idioms.enum")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>is :call C_InsertTemplate("idioms.struct")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>is <Esc>:call C_InsertTemplate("idioms.struct", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>is <Esc>:call C_InsertTemplate("idioms.struct")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>iu :call C_InsertTemplate("idioms.union")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>iu <Esc>:call C_InsertTemplate("idioms.union" , "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>iu <Esc>:call C_InsertTemplate("idioms.union")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ip :call C_InsertTemplate("idioms.printf")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ip <Esc>:call C_InsertTemplate("idioms.printf")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>isc :call C_InsertTemplate("idioms.scanf")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>isc <Esc>:call C_InsertTemplate("idioms.scanf")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ica :call C_InsertTemplate("idioms.calloc")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ica <Esc>:call C_InsertTemplate("idioms.calloc")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>ima :call C_InsertTemplate("idioms.malloc")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ima <Esc>:call C_InsertTemplate("idioms.malloc")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>ire :call C_InsertTemplate("idioms.realloc")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ire <Esc>:call C_InsertTemplate("idioms.realloc")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>isi :call C_InsertTemplate("idioms.sizeof")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>isi <Esc>:call C_InsertTemplate("idioms.sizeof")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>isi <Esc>:call C_InsertTemplate("idioms.sizeof", "v")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>ias :call C_InsertTemplate("idioms.assert")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>ias <Esc>:call C_InsertTemplate("idioms.assert", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ias <Esc>:call C_InsertTemplate("idioms.assert")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ii :call C_InsertTemplate("idioms.open-input-file")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file", "v")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>io :call C_InsertTemplate("idioms.open-output-file")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>io <Esc>:call C_InsertTemplate("idioms.open-output-file")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>io <Esc>:call C_InsertTemplate("idioms.open-output-file", "v")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ifs :call C_InsertTemplate("idioms.fscanf")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ifs <Esc>:call C_InsertTemplate("idioms.fscanf")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>ifp :call C_InsertTemplate("idioms.fprintf")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ifp <Esc>:call C_InsertTemplate("idioms.fprintf")<CR>
|
||||
"
|
||||
" ---------- snippet menu : snippets -----------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>nr :call C_CodeSnippet("r")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>nw :call C_CodeSnippet("w")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>nw <Esc>:call C_CodeSnippet("wv")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>ne :call C_CodeSnippet("e")<CR>
|
||||
"
|
||||
inoremap <buffer> <silent> <LocalLeader>nr <Esc>:call C_CodeSnippet("r")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>nw <Esc>:call C_CodeSnippet("w")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ne <Esc>:call C_CodeSnippet("e")<CR>
|
||||
"
|
||||
" ---------- snippet menu : prototypes ---------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>np :call C_ProtoPick("function")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>np :call C_ProtoPick("function")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>np <Esc>:call C_ProtoPick("function")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>nf :call C_ProtoPick("function")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>nf :call C_ProtoPick("function")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>nf <Esc>:call C_ProtoPick("function")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>nm :call C_ProtoPick("method")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>nm :call C_ProtoPick("method")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>nm <Esc>:call C_ProtoPick("method")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ni :call C_ProtoInsert()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ni <Esc>:call C_ProtoInsert()<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>nc :call C_ProtoClear()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>nc <Esc>:call C_ProtoClear()<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ns :call C_ProtoShow()<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ns <Esc>:call C_ProtoShow()<CR>
|
||||
"
|
||||
" ---------- snippet menu : templates ----------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>ntl :call C_BrowseTemplateFiles("Local")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ntl <Esc>:call C_BrowseTemplateFiles("Local")<CR>
|
||||
if s:installation == 'system'
|
||||
noremap <buffer> <silent> <LocalLeader>ntg :call C_BrowseTemplateFiles("Global")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>ntg <Esc>:call C_BrowseTemplateFiles("Global")<CR>
|
||||
endif
|
||||
noremap <buffer> <silent> <LocalLeader>ntr :call C_RereadTemplates()<CR>
|
||||
noremap <buffer> <LocalLeader>nts :CStyle<Space>
|
||||
inoremap <buffer> <silent> <LocalLeader>ntr <Esc>:call C_RereadTemplates()<CR>
|
||||
inoremap <buffer> <LocalLeader>nts <Esc>:CStyle<Space>
|
||||
"
|
||||
" ---------- C++ menu ----------------------------------------------------
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>+" :call C_InsertTemplate("cpp.cout-operator")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+" <Esc>:call C_InsertTemplate("cpp.cout-operator")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+co :call C_InsertTemplate("cpp.cout")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+co <Esc>:call C_InsertTemplate("cpp.cout")<CR>
|
||||
"
|
||||
noremap <buffer> <silent> <LocalLeader>+c :call C_InsertTemplate("cpp.class-definition")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+c <Esc>:call C_InsertTemplate("cpp.class-definition")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+cn :call C_InsertTemplate("cpp.class-using-new-definition")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+cn <Esc>:call C_InsertTemplate("cpp.class-using-new-definition")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+ci :call C_InsertTemplate("cpp.class-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+ci <Esc>:call C_InsertTemplate("cpp.class-implementation")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+cni :call C_InsertTemplate("cpp.class-using-new-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+cni <Esc>:call C_InsertTemplate("cpp.class-using-new-implementation")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+mi :call C_InsertTemplate("cpp.method-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+mi <Esc>:call C_InsertTemplate("cpp.method-implementation")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+ai :call C_InsertTemplate("cpp.accessor-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+ai <Esc>:call C_InsertTemplate("cpp.accessor-implementation")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+tc :call C_InsertTemplate("cpp.template-class-definition")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tc <Esc>:call C_InsertTemplate("cpp.template-class-definition")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+tcn :call C_InsertTemplate("cpp.template-class-using-new-definition")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tcn <Esc>:call C_InsertTemplate("cpp.template-class-using-new-definition")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+tci :call C_InsertTemplate("cpp.template-class-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tci <Esc>:call C_InsertTemplate("cpp.template-class-implementation")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tcni <Esc>:call C_InsertTemplate("cpp.template-class-using-new-implementation")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+tmi :call C_InsertTemplate("cpp.template-method-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tmi <Esc>:call C_InsertTemplate("cpp.template-method-implementation")<CR>
|
||||
noremap <buffer> <silent> <LocalLeader>+tai :call C_InsertTemplate("cpp.template-accessor-implementation")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tai <Esc>:call C_InsertTemplate("cpp.template-accessor-implementation")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+tf :call C_InsertTemplate("cpp.template-function")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tf <Esc>:call C_InsertTemplate("cpp.template-function")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+ec :call C_InsertTemplate("cpp.error-class")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+ec <Esc>:call C_InsertTemplate("cpp.error-class")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+tr :call C_InsertTemplate("cpp.try-catch")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+ca :call C_InsertTemplate("cpp.catch")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>+ca <Esc>:call C_InsertTemplate("cpp.catch", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+ca <Esc>:call C_InsertTemplate("cpp.catch")<CR>
|
||||
|
||||
noremap <buffer> <silent> <LocalLeader>+c. :call C_InsertTemplate("cpp.catch-points")<CR>
|
||||
vnoremap <buffer> <silent> <LocalLeader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points", "v")<CR>
|
||||
inoremap <buffer> <silent> <LocalLeader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points")<CR>
|
||||
"
|
||||
" ---------- run menu --------------------------------------------------------
|
||||
"
|
||||
map <buffer> <silent> <LocalLeader>rc :call C_Compile()<CR>:call C_HlMessage()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rl :call C_Link()<CR>:call C_HlMessage()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rr :call C_Run()<CR>
|
||||
map <buffer> <silent> <LocalLeader>ra :call C_Arguments()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rm :call C_Make()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rcm :call C_ChooseMakefile()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rmc :call C_MakeClean()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rme :call C_MakeExeToRun()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rma :call C_MakeArguments()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rp :call C_SplintCheck()<CR>:call C_HlMessage()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rpa :call C_SplintArguments()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rd :call C_Indent()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rh :call C_Hardcopy()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rs :call C_Settings()<CR>
|
||||
"
|
||||
vmap <buffer> <silent> <LocalLeader>rh :call C_Hardcopy()<CR>
|
||||
"
|
||||
imap <buffer> <silent> <LocalLeader>rc <C-C>:call C_Compile()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rl <C-C>:call C_Link()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rr <C-C>:call C_Run()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>ra <C-C>:call C_Arguments()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rm <C-C>:call C_Make()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rmc <C-C>:call C_MakeClean()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rme <C-C>:call C_MakeExeToRun()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rma <C-C>:call C_MakeArguments()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rp <C-C>:call C_SplintCheck()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rpa <C-C>:call C_SplintArguments()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rd <C-C>:call C_Indent()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rh <C-C>:call C_Hardcopy()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rs <C-C>:call C_Settings()<CR>
|
||||
if has("unix")
|
||||
map <buffer> <silent> <LocalLeader>rx :call C_XtermSize()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rx <C-C>:call C_XtermSize()<CR>
|
||||
endif
|
||||
map <buffer> <silent> <LocalLeader>ro :call C_Toggle_Gvim_Xterm()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>ro <C-C>:call C_Toggle_Gvim_Xterm()<CR>
|
||||
"
|
||||
" Abraxas CodeCheck (R)
|
||||
"
|
||||
if executable("check")
|
||||
map <buffer> <silent> <LocalLeader>rk :call C_CodeCheck()<CR>:call C_HlMessage()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rka :call C_CodeCheckArguments()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rk <C-C>:call C_CodeCheck()<CR>:call C_HlMessage()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rka <C-C>:call C_CodeCheckArguments()<CR>
|
||||
endif
|
||||
" ---------- plugin help -----------------------------------------------------
|
||||
"
|
||||
map <buffer> <silent> <LocalLeader>hp :call C_HelpCsupport()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>hp <C-C>:call C_HelpCsupport()<CR>
|
||||
map <buffer> <silent> <LocalLeader>hm :call C_Help("m")<CR>
|
||||
imap <buffer> <silent> <LocalLeader>hm <C-C>:call C_Help("m")<CR>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" additional mapping : complete a classical C comment: '/*' => '/* | */'
|
||||
"-------------------------------------------------------------------------------
|
||||
inoremap <buffer> /* /*<Space><Space>*/<Left><Left><Left>
|
||||
vnoremap <buffer> /* s/*<Space><Space>*/<Left><Left><Left><Esc>p
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" additional mapping : complete a classical C multi-line comment:
|
||||
" '/*<CR>' => /*
|
||||
" * |
|
||||
" */
|
||||
"-------------------------------------------------------------------------------
|
||||
inoremap <buffer> /*<CR> /*<CR><CR>/<Esc>kA<Space>
|
||||
"
|
||||
"-------------------------------------------------------------------------------
|
||||
" additional mapping : {<CR> always opens a block
|
||||
"-------------------------------------------------------------------------------
|
||||
inoremap <buffer> {<CR> {<CR>}<Esc>O
|
||||
vnoremap <buffer> {<CR> S{<CR>}<Esc>Pk=iB
|
||||
"
|
||||
"
|
||||
if !exists("g:C_Ctrl_j") || ( exists("g:C_Ctrl_j") && g:C_Ctrl_j != 'off' )
|
||||
nmap <buffer> <silent> <C-j> i<C-R>=C_JumpCtrlJ()<CR>
|
||||
imap <buffer> <silent> <C-j> <C-R>=C_JumpCtrlJ()<CR>
|
||||
endif
|
||||
"
|
31
vim_plugins_src/cvim/ftplugin/make.vim
Normal file
31
vim_plugins_src/cvim/ftplugin/make.vim
Normal file
@ -0,0 +1,31 @@
|
||||
" ------------------------------------------------------------------------------
|
||||
"
|
||||
" Vim filetype plugin file (part of the c.vim plugin)
|
||||
"
|
||||
" Language : make
|
||||
" Plugin : c.vim
|
||||
" Maintainer : Fritz Mehner <mehner@fh-swf.de>
|
||||
" Revision : $Id: make.vim,v 1.4 2011/12/27 21:04:33 mehner Exp $
|
||||
"
|
||||
" ------------------------------------------------------------------------------
|
||||
"
|
||||
" Only do this when not done yet for this buffer
|
||||
"
|
||||
if exists("b:did_make_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_make_ftplugin = 1
|
||||
|
||||
map <buffer> <silent> <C-F9> :call C_Make()<CR>
|
||||
imap <buffer> <silent> <C-F9> <C-C>:call C_Make()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rm :call C_Make()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rm <C-C>:call C_Make()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rcm :call C_ChooseMakefile()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rcm <C-C>:call C_ChooseMakefile()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rmc :call C_MakeClean()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rmc <C-C>:call C_MakeClean()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rme :call C_MakeExeToRun()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rme <C-C>:call C_MakeExeToRun()<CR>
|
||||
map <buffer> <silent> <LocalLeader>rma :call C_MakeArguments()<CR>
|
||||
imap <buffer> <silent> <LocalLeader>rma <C-C>:call C_MakeArguments()<CR>
|
||||
|
3753
vim_plugins_src/cvim/plugin/c.vim
Normal file
3753
vim_plugins_src/cvim/plugin/c.vim
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user