个人vim配置文件

  acm菜鸡必备
  1 runtime! debian.vim
  2 if has("syntax")
  3   syntax on
  4 endif
  5 if filereadable("/etc/vim/vimrc.local")
  6   source /etc/vim/vimrc.local
  7 endif
  8 "syntax high light
  9 syntax on
 10 "show the line number
 11 set nu
 12 "为c程序提供自动缩进
 13 set smartindent
 14 "使用c程序的自动缩进
 15 set cindent
 16 "设置缩进的空格数为4
 17 set shiftwidth=4
 18 "设置制表符
 19 set tabstop=4
 20 set softtabstop=4
 21 "匹配模式()
 22 set showmatch
 23 "不保留备份文件
 24 set nobackup
 25 "配色方案
 26 colorscheme slate
 27 "中文显示
 28 set fileencodings=utf-8,gb2312,gbk,gb18030
 29 set termencoding=utf-8
 30 set encoding=prc
 31 "字体
 32 "自动插入头文件
 33 autocmd BufNewFile *.cpp exec ":call SetTitle()"
 34 func SetTitle()
 35     if &filetype =='cpp'
 36     call setline(1,"// file name: ".expand("%")."                               //")
 37     call append(line("."),"// author: huangjipeng                               //")
 38     call append(line(".")+1,"// creat time: ".strftime("%c")."    //")
 39     call append(line(".")+2,"///////////////////////////////////////////////////////")
 40     call append(line(".")+3,"#include<iostream>")
 41     call append(line(".")+4,"#include<cstdio>")
 42     call append(line(".")+5,"#include<cstdlib>")
 43     call append(line(".")+6,"#include<string.h>")
 44     call append(line(".")+7,"#include<math.h>")
 45     call append(line(".")+8,"#include<algorithm>")
 46     call append(line(".")+9,"#include<map>")
 47     call append(line(".")+10,"#include<vector>")
 48     call append(line(".")+11,"#include<queue>")
 49     call append(line(".")+12,"using namespace std;")
 50     call append(line(".")+13,"#define MAXN 1")
 51     call append(line(".")+14,"int main()")
 52     call append(line(".")+15,"{")
 53     call append(line(".")+16,"    return 0;")
 54     call append(line(".")+17,"}")
 55     endif
 56     "新建文件时定位到文件尾
 57     autocmd BufNewFile * normal G
 58 endfunc
 59 map <F9> :call CompileCpp()<CR>
 60 function CompileCpp()
 61      set makeprg=g++\ -o\ %<\ %
 62      silent make
 63      let myfile=expand("%:r")
 64      if filereadable(myfile)
 65          execute "! ./%< && rm ./%<"
 66      else
 67          cope5
 68      endif
 69 endfunction

个人vim配置文件

时间: 2024-08-27 22:54:12

个人vim配置文件的相关文章

强大的vim配置文件,让编程更随意

花了很长时间整理的,感觉用起来很方便,共享一下. 我的vim配置主要有以下优点: 1.按F5可以直接编译并执行C.C++.java代码以及执行shell脚本,按"F8"可进行C.C++代码的调试 2.自动插入文件头 ,新建C.C++源文件时自动插入表头:包括文件名.作者.联系方式.建立时间等,读者可根据需求自行更改 3.映射"Ctrl + A"为全选并复制快捷键,方便复制代码 4.按"F2"可以直接消除代码中的空行 5."F3"

mac 下vim 配置文件

" Configuration file for vim set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compa

vim配置文件 高亮+自动缩进+行号+折叠+优化

配置文件是网上找的,我把出错的几个地方改了下 将一下代码copy到 用户目录下 新建文件为  .vimrc保存即可生效: 如果想所有用户生效 请修改 /etc/vimrc (建议先cp一份) "========================================================================= " DesCRiption: 适合自己使用的vimrc文件,for Linux/Windows, GUI/Console " "

分享一下个人的Vim配置文件

强烈拥护开源精神,高举开源大旗,今天我就分享下我自己结合网上还有自己实际使用配的vimrc,可以给各位参考下,不要见笑哈,具体说明我在rc里写的也很详细,可以具体看下,也希望可以借这个机会能多认识认识几个Vimer们 "======================================== " File Name: .vimrc " Author: Jin Yuqi " Email: [email protected] " Description

vim 配置文件 ,高亮+自动缩进+行号+折叠+优化

vim 配置文件 ,高亮+自动缩进+行号+折叠+优化 将一下代码copy到 用户目录下 新建文件为  .vimrc保存即可生效: 如果想所有用户生效 请修改 /etc/vimrc (建议先cp一份)"=========================================================================" DesCRiption: 适合自己使用的vimrc文件,for Linux/Windows, GUI/Console""

[转] vim配置文件.vimrc

--------------------------------------------------------------------------- 转自:http://www.cnblogs.com/wangj08/archive/2013/03/13/2957309.html ------------------------------------------------------------------------------------- vim 配置文件 ,高亮+自动缩进+行号+折

我的 vim 配置文件

vim 配置文件存放路径 : ~/.vimrc 点(.)开头的文件,系统默认不显示,需要使用 ls -a 选项. syntax on set nobackup set noswapfile set hlsearch set number set ruler set expandtab set tabstop=4 set softtabstop=4 set shiftwidth=4 set autoindent set cindent set smartindent set mouse=v set

vim配置文件--显示行号tabstop设置

在Red Hat Linux 中管理员的vim的配置文件存放在/etc/vimrc set nocompatible            //去掉有关vi一致性模式,避免以前版本的bug和局限 set nu                      //显示行号 等等配置信息都在vimrc这个文件下,可以查看该文件下的具体设置. 如果是普通用户,可以再普通用户的主目录(~)下即cd跳转到的那个文件目录,新建一个.vimrc文件: 如 set nu set tabstop=4       //按

强大的vim配置文件,让编程更随意(转)

欢迎来到小码哥的博客 博客搬家啦 blog.ma6174.com 强大的vim配置文件,让编程更随意 花了很长时间整理的,感觉用起来很方便,共享一下. 我的vim配置主要有以下优点: 1.按F5可以直接编译并执行C.C++.java代码以及执行shell脚本,按"F8"可进行C.C++代码的调试 2.自动插入文件头 ,新建C.C++源文件时自动插入表头:包括文件名.作者.联系方式.建立时间等,读者可根据需求自行更改 3.映射"Ctrl + A"为全选并复制快捷键,方

vim 配置文件留存

备忘留存 // vim 配置文件留存 [2016/05/31 09:11] set number set go=  color darkblue  "set guifont=Source\ Code\ Pro:h10.5:cANSI  set guifont=Mononoki:h12  winpos 100 100  set ruler  set showcmd  set foldenable  syntax on  set nobackup  set clipboard+=unnamed  &