vim个人配置文件

来源:互联网 发布:大众网络报 编辑:程序博客网 时间:2024/06/14 01:41
"显示行号
:set nu


"Tab 宽度
:set ts=8


"自动缩进
:set sw=8


"C/C++ 风格的自动缩进
:set cin


"打开普通文件类型的自动缩进
:set ai


"下面是常用自定义快捷键
"使用方法是,例如:输入.i后按回车或空格键,都会输出 #include <stdio.h>
ab .i #include <stdio.h>
ab #i #include <>
ab .l #include <stdlib.h>
ab .s #include <string.h>
ab .m int main(int argc, char* argv[])
ab .p printf("\n");
ab .q printf("please input....\n");
ab .r return 0;


"记住vim上次打开的位置
set viminfo='10,\"100,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif


"开启插件
filetype plugin on

原创粉丝点击