From 2cff496181a2c38bf2b739c36b8153712cd65800 Mon Sep 17 00:00:00 2001 From: LAN-TW Date: Wed, 24 Aug 2011 08:54:29 +0800 Subject: Initial commit - import version 20110824 --- vimrc | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 vimrc (limited to 'vimrc') diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..3c27b7b --- /dev/null +++ b/vimrc @@ -0,0 +1,53 @@ +let $ERRFILE="/tmp/f8fe1f28-6e6e-11e0-b22e-000c760ae4c6.err" +let $CFLAGS="-Wall -O2 -pipe" +let $LDFLAGS="" +set bs=2 +set ls=2 +set ts=4 +set sw=4 +set cindent +set hls +set ru +set nocp +syntax on +set background=light +highlight Comment ctermfg=darkcyan +highlight Search term=reverse ctermbg=4 ctermfg=7 + +function! SingleCompile() + let file_suffix = expand("%:e") + if file_suffix == "c" + !gcc ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE} + cg ${ERRFILE} + elseif file_suffix == "cpp" + !g++ ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE} + cg ${ERRFILE} + else + echo "This file has an UNKNOWN SUFFIX!" + endif +endfunction + +map :echo "CFLAGS="$CFLAGS"\n":let $CFLAGS="-Wall -O2 -pipe +map :cl +map :cp +map :cn +map :tabp +map :tabn +map :set background=light:highlight Comment ctermfg=darkcyan +map :set background=dark:highlight PreProc ctermfg=darkcyan +map :call SingleCompile() +map :make +map :echo "LDFLAGS="$LDFLAGS"\n":let $LDFLAGS=" +map :!less -R %:p:. +imap +imap a +imap a +imap a +imap a +imap a +imap a +imap a +imap +imap +imap +imap -- cgit