我的Vim配置文件:.vimrc
时间:2007-04-19 来源:naihe2010
这篇是Vim的配置文件:.vimrc
一个个改这里面的每个VIM的特殊字符,着实费了我一番力气!
一个个改这里面的每个VIM的特殊字符,着实费了我一番力气!
" Set Myself information abbrev
ab myname 于鹏达
ab mynick Alf
ab myurl http://alf.ik8.com
ab myemail [email protected]
ab myqq 122741611
ab myschool 长安大学
ab myzy 信息与计算科学
map! 长安大 长安大学
map! 信息与计 信息与计算科学
" Not Like Vi
set nocompatible
set noremap
set nobackup
set nowritebackup
" Set the View
set background=dark
set number
set ruler
" File Type Detection
filetype on
" Syntax Highlighting
set shiftwidth=8
set tabstop=8
set showmatch
syntax on
" Set My Own Map
map! /* /* */^[bhi
map! 《 《》^[ba
map! “ “”^[ba
" Set the C syntax highlighting
set nocp incsearch
set cindent
" Set HTML map!
map! htmlh <html>^M</html>^[ka
map! headh <head>^M<head>^[ka
map! titleh <title></title>^[2ba
map! bodyh <body bgcolor=# text= >^M</body>^[kwla
map! tableh <table width= align= >^M<tr>^M<td width=></td>^M</tr>^M</table>^{4kwa
map! trh <tr>^M<td width= ></td>^M</tr>^[kwa
map! tdh <td width= ></td>^[3ba
map! verseh <p class='verse'>^M^M</p>^[ki
map! h1h <h1 align=></h1>^[2ba
map! h2h <h2 align=></h2>^[2ba
map! h3h <h3 align=></h3>^[2ba
map! h4h <h4 align=></h4>^[2ba
map! h5h <h5 align=></h5>^[2ba
map! h6h <h6 align=></h6>^[2ba
map! hrefh <a href=""></a>^[2bla
map! imgh <img src="" width="" height="">^[5bla
" Set C Language map!
map! ifndefc #ifndef _H_^M#define _H_ 1^M^M^M^M#endif^[2ki
map! includec #include <stdio.h>^M#include <stdlib.h>^M#include <string.h>^M#include <error.h>^M#include <unistd.h>^M#include <fcntl.h>^M#include <sys/types.h>^M#include <sys/stat.h>
map! includen #include <sys/socket.h>^M#include <netinet/in.h>^M#include <netdb.h>^M#include <arpa/inet.h>
map! includep #include <pthread.h>
map! functionc /*^M* name:^M* using:^M* input:^M* output:^M*/
map! whilex while(){^M}^[kwa
map! forx for( ; ; ){^M}^[kwa
map! switchx switch(){^Mcase:^Mcase:^Mcase:^Mdefault:^M}^[4kea
map! openx if ( ( fp = open ("%s", flags, own) ) != 0 )^[6bla
map! socketx if ( ( sp = socket( , , ) ) != 0 )^[6bla
" Set C++ Language map!
map! includepp #inlcude <iostrem>^Musing namespace std;
map! classpp class {^Mpublic:^Mprivate:^Mprotected:^M};^[4kwi
" Set my shortcut key maps
map <C-k> <C-w>k
map <C-j> <C-w>j
map <C-b> :buffer
" Set my C make IDE
map <C-m> :make^M
" Set my PHP IDE
map <C-h> :!php -l %^M
" Set my amuse IDE
map <C-p> :!amuse %^M
" Set function to change dos text to unix
map <C-d><C-u> :%s/^M/^M
" Set my own autocmd
autocmd BufReadPre *.pdf set ro
autocmd BufReadPost *.pdf %!pdftotext -nopgbrk "%" -
相关阅读 更多 +