Linux: .vimrc

set nu
set autoindent
set cindent
"set tabstop=2
"set shiftwidth=2
set cursorline
set hlsearch
"set fdm=syntax
" *********************************************************************************************
" comments.vim
" *********************************************************************************************
" Description : Global Plugin to comment and un-comment different
" source files in both normal and visual <Shift-V> mode
" Last Change : 26th April, 2006
" Created By : Jasmeet Singh Anand <[email protected]>
" Version : 2.2
" Usage : For VIM 6 -
" Stick this file in your ~/.vim/plugin directory or
" in some other ‘plugin‘ directory that is in your runtime path
" For VIM 5 -
" Stick this file somewhere and ‘source <path>/comments.vim‘ it from
" your ~/.vimrc file
" Note : I have provided the following key mappings
" To comment <Ctrl-C> in both normal and visual <Shift-V> range select mode
" To un-comment <Ctrl-X> in both normal and visual <Shift-V> range select mode
" These can be changed based on user‘s likings or usage
" Contact : For any comments or bug fixes email me at <[email protected]>
" *********************************************************************************************
"Modification:
" *********************************************************************************************
" Jasmeet Anand 26th April, 2006 v2.0
" Fixed C commenting where a single line already had previous comments.
" int x=0; /*this is an x value*/
" Still working on situations like
" Issue A:
" 1 int x=0; /*this
" 2 is
" 3 an
" 4 x
" 5 value*/
" *********************************************************************************************
" Jasmeet Anand 26th April, 2006 v2.1
" Provided more granule checking for C Code but still working on Issue A
" *********************************************************************************************
" Jasmeet Anand 27th April, 2006 v2.2
" Fixed another minor C code commenting bug
" Provided for .csh, .php, .php2 and .php3 support
" Resolved Issue A with the following logic
" 1 /* int x=0; */ /*this*/
" 2 /*is*/
" 3 /*an*/
" 4 /*x*/
" 5 /*value*/
" However care should be taken when un-commenting it
" in order to retain the previous comments
" *********************************************************************************************
" Jasmeet Anand 1st May 2006 v2.3
" Provided [:blank:] to accomodate for space and tab characters
" *********************************************************************************************
" Jasmeet Anand 1st May 2006 v2.4
" Provided support for .css as advised by Willem Peter
" *********************************************************************************************
" Jasmeet Anand 2nd May 2006 v2.5
" Removed auto-indenting for .sql, .sh and normal files when un-commenting
" *********************************************************************************************
" Jasmeet Anand 5th June 2006 v2.6
" Added support for .html, .xml, .xthml, .htm, .vim, .vimrc
" files as provided by Jeff Buttars
" *********************************************************************************************
" Smolyar "Rastafarra" Denis 7th June 2007 v2.7
" Added support for .tex
" *********************************************************************************************
" Jasmeet Anand 5th June 2006 v2.8
" Added support for Fortran .f, .F, .f90, .F90, .f95, .F95
" files as provided by Albert Farres
" *********************************************************************************************
" Jasmeet Anand 8th March 2008 v2.9
" Added support for ML, Caml, OCaml .ml, mli, PHP (v.4) .php4, PHP (v.5) .php5
" files as provided by Denis Smolyar
" Added support for noweb (requires only a small enhancement to the tex type)
" as provided by Meik "fuller" Te脽mer
" Added support for vhdl files provided by Trond Danielsen
" *********************************************************************************************
" Jasmeet Anand 20 th March 2008 v2.10
" Bug fixes for php files as pointed by rastafarra
" *********************************************************************************************
" Jasmeet Anand 29th November 2008 v2.11
" Added support for haskel
" files as provided by Nicolas Martyanoff
" File Format changed to UNIX
" *********************************************************************************************
" Jasmeet Anand 11th January 2009 v2.12
" bug fix for haskel files as prpvided by Jean-Marie
"

" Exit if already loaded
if exists("loaded_comments_plugin")
finish
endif

let loaded_comments_plugin="v2.10"

" key-mappings for comment line in normal mode
noremap <silent> <C-C> :call CommentLine()<CR>
" key-mappings for range comment lines in visual <Shift-V> mode
vnoremap <silent> <C-C> :call RangeCommentLine()<CR>

" key-mappings for un-comment line in normal mode
noremap <silent> <C-X> :call UnCommentLine()<CR>
" key-mappings for range un-comment lines in visual <Shift-V> mode
vnoremap <silent> <C-X> :call RangeUnCommentLine()<CR>

" function to comment line in normal mode
function! CommentLine()
let file_name = buffer_name("%")

" for .cpp or .hpp or .java or .C files use //
if file_name =~ ‘\.cpp$‘ || file_name =~ ‘\.hpp$‘ || file_name =~ ‘\.java$‘ || file_name =~ ‘\.php[2345]\?$‘ || file_name =~ ‘\.C$‘
execute ":silent! normal ^i//\<ESC>==\<down>^"
" for .c or .h or .pc or .css files use /* */
elseif file_name =~ ‘\.c$‘ || file_name =~ ‘\.h$‘ || file_name =~ ‘\.pc$‘ || file_name =~ ‘\.css$‘ || file_name =~ ‘\.js$‘
" if there are previous comments on this line ie /* ... */
if stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") != -1
execute ":silent! normal :nohlsearch\<CR>:s/\\([^\\/\\*]*\\)\\(\\/\\*.*\\*\\/\\)/\\1\\*\\/\\2/\<CR>:s/\\([^[:blank:]]\\+\\)/\\/\\*\\1/\<CR>:nohlsearch\<CR>=="
" if there is a /* but no */ like line 1 in Issue A above
elseif stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") == -1
execute ":silent! normal :nohlsearch\<CR>:s/\\(.*\\)\\(\\/\\*.*$\\)/\\/\\*\\1\\*\\/\\2\\*\\//\<CR>:nohlsearch\<CR>=="
" if there is a */ but no /* like line 5 in Issue A above
elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") != -1
execute ":silent! normal :nohlsearch\<CR>:s/\\(.*\\*\\/\\)/\\/\\*\\1/\<CR>:nohlsearch\<CR>=="
" if there are no comments on this line
elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") == -1
execute ":silent! normal ^i/*\<ESC>$a*/\<ESC>==\<down>^"
endif
"for .ml or .mli files use (* *)
elseif file_name =~ ‘\.ml$‘ || file_name =~ ‘\.mli$‘
if stridx(getline("."), "\(\*") == -1 && stridx(getline("."), "\*)") == -1
execute ":silent! normal ^i(*\<ESC>$a*)\<ESC>==\<down>^"
endif
" .html,.xml,.xthml,.htm
elseif file_name =~ ‘\.html$‘ || file_name =~ ‘\.htm$‘ || file_name =~ ‘\.xml$‘ || file_name =~ ‘\.xhtml$‘
if stridx( getline("."), "\<!--" ) != -1 && stridx( getline("."), "--\>" ) != -1
elseif stridx( getline("."), "\<!--" ) != -1 && stridx( getline("."), "--\>" ) == -1
" open, but a close "
execute ":silent! normal ^A--\>\<ESC>==\<down>^"
elseif stridx( getline("."), "\<!--" ) == -1 && stridx( getline("."), "--\>" ) != -1
execute ":silent! normal ^i\<\!--\<ESC>==\<down>^"
elseif stridx( getline("."), "\<!--" ) == -1 && stridx( getline("."), "--\>" ) == -1
execute ":silent! normal ^i\<\!--\<ESC>$a--\>\<ESC>==\<down>^"
endif
" for .vim files use "
elseif file_name =~ ‘\.vim$‘ || file_name =~ ‘\.vimrc$‘
execute ":silent! normal ^i\"\<ESC>\<down>^"
" for .sql files use --
elseif file_name =~ ‘\.sql$‘
execute ":silent! normal ^i--\<ESC>\<down>^"
" for .ksh or .sh or .csh or .pl or .pm files use #
elseif file_name =~ ‘\.[kc]\?sh$‘ || file_name =~ ‘\.pl$‘ || file_name =~ ‘\.pm$‘
execute ":silent! normal ^i#\<ESC>\<down>^"
" for .tex files use %
elseif file_name =~ ‘\.tex$‘ || file_name =~ ‘\.nw$‘
execute ":silent! normal ^i%\<ESC>\<down>^"
" for fortran 77 files use C on first column
elseif file_name =~ ‘\.f$‘ || file_name =~ ‘\.F$‘
execute ":silent! normal ^gIC\<ESC>\<down>^"
" for fortran 90/95 files use !
elseif file_name =~ ‘\.f90$‘ || file_name =~ ‘\.F90$‘ || file_name =~ ‘\.f95$‘ || file_name =~ ‘\.F95$‘
execute ":silent! normal ^i!\<ESC>\<down>^"
" for VHDL and Haskell files use --
elseif file_name =~ ‘\.vhd$‘ || file_name =~ ‘\.vhdl$‘ || file_name =~ ‘\.hs$‘
execute ":silent! normal ^gI-- \<ESC>\<down>^"
" for all other files use #
else
execute ":silent! normal ^i#\<ESC>\<down>^"
endif
endfunction

" function to un-comment line in normal mode
function! UnCommentLine()
let file_name = buffer_name("%")

" for .cpp or .hpp or .java or .C files use //
if file_name =~ ‘\.cpp$‘ || file_name =~ ‘\.hpp$‘ || file_name =~ ‘\.java$‘ || file_name =~ ‘\.php[2345]\?$‘ || file_name =~ ‘\.C$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\/\\///\<CR>:nohlsearch\<CR>=="
" for .ml or .mli
elseif file_name =~ ‘\.ml$‘ || file_name =~ ‘\.mli$‘
execute ":silent! normal :nohlsearch\<CR>:s/(\\*//\<CR>:nohlsearch\<CR>"
execute ":silent! normal :nohlsearch\<CR>:s/\\*)//\<CR>:nohlsearch\<CR>=="
" for .c or .h or .pc or .css files use /* */
elseif file_name =~ ‘\.c$‘ || file_name =~ ‘\.h$‘ || file_name =~ ‘\.pc$‘ || file_name =~ ‘\.css$‘ || file_name =~ ‘\.js$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\/\\*//\<CR>:s/\\*\\///\<CR>:nohlsearch\<CR>=="
" for .vim files use "
elseif file_name =~ ‘\.vim$‘ || file_name =~ ‘\.vimrc$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\\"//\<CR>:nohlsearch\<CR>"
" for .sql files use --
elseif file_name =~ ‘\.sql$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\-\\-//\<CR>:nohlsearch\<CR>"
" for .ksh or .sh or .csh or .pl or .pm files use #
elseif file_name =~ ‘\.[kc]\?sh$‘ || file_name =~ ‘\.pl$‘ || file_name =~ ‘\.pm$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\#//\<CR>:nohlsearch\<CR>"
" for .xml .html .xhtml .htm use <!-- -->
elseif file_name =~ ‘\.html$‘ || file_name =~ ‘\.htm$‘ || file_name =~ ‘\.xml$‘ || file_name =~ ‘\.xhtml$‘
execute ":silent! normal :nohlsearch\<CR>:s/<!--//\<CR>=="
execute ":silent! normal :nohlsearch\<CR>:s/-->//\<CR>=="
" for .tex use %
elseif file_name =~ ‘\.tex$‘ || file_name =~ ‘\.nw$‘
execute ":silent! normal :nohlsearch\<CR>:s/%/\<CR>:nohlsearch\<CR>"
" for fortran 77 files use C on first column
elseif file_name =~ ‘\.f$‘ || file_name =~ ‘\.F$‘
execute ":silent! normal ^x\<ESC>\<down>^"
" for fortran 90/95 files use !
elseif file_name =~ ‘\.f90$‘ || file_name =~ ‘\.F90$‘ || file_name =~ ‘\.f95$‘ || file_name =~ ‘\.F95$‘
execute ":silent! normal :nohlsearch\<CR>:s/!//\<CR>:nohlsearch\<CR>"
" for VHDL and Haskell files use --
elseif file_name =~ ‘\.vhd$‘ || file_name =~ ‘\.vhdl$‘ || file_name =~ ‘\.hs$‘
execute ":silent! normal :nohlsearch\<CR>:s/-- //\<CR>:nohlsearch\<CR>"
" for all other files use #
else
execute ":silent! normal :nohlsearch\<CR>:s/\\#//\<CR>:nohlsearch\<CR>"
endif
endfunction

" function to range comment lines in visual mode
function! RangeCommentLine()
let file_name = buffer_name("%")

" for .cpp or .hpp or .java or .C files use //
if file_name =~ ‘\.cpp$‘ || file_name =~ ‘\.hpp$‘ || file_name =~ ‘\.java$‘ || file_name =~ ‘\.php[2345]\?$‘ || file_name =~ ‘\.C$‘
execute ":silent! normal :s/\\S/\\/\\/\\0/\<CR>:nohlsearch<CR>=="
" for .c or .h or .pc or .css files use /* */
elseif file_name =~ ‘\.c$‘ || file_name =~ ‘\.h$‘ || file_name =~ ‘\.pc$‘ || file_name =~ ‘\.css$‘ || file_name =~ ‘\.js$‘
" if there are previous comments on this line ie /* ... */
if stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") != -1
execute ":silent! normal :nohlsearch\<CR>:s/\\([^\\/\\*]*\\)\\(\\/\\*.*\\*\\/\\)/\\1\\*\\/\\2/\<CR>:s/\\([^[:blank:]]\\+\\)/\\/\\*\\1/\<CR>:nohlsearch\<CR>=="
" if there is a /* but no */ like line 1 in Issue A above
elseif stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") == -1
execute ":silent! normal :nohlsearch\<CR>:s/\\(.*\\)\\(\\/\\*.*$\\)/\\/\\*\\1\\*\\/\\2\\*\\//\<CR>:nohlsearch\<CR>=="
" if there is a */ but no /* like line 5 in Issue A above
elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") != -1
execute ":silent! normal :nohlsearch\<CR>:s/\\(.*\\*\\/\\)/\\/\\*\\1/\<CR>:nohlsearch\<CR>=="
" if there are no comments on this line
elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") == -1
execute ":silent! normal :s/\\(\\S.*$\\)/\\/\\*\\1\\*\\//\<CR>:nohlsearch\<CR>=="
endif
" .html,.xml,.xthml,.htm
elseif file_name =~ ‘\.html$‘ || file_name =~ ‘\.htm$‘ || file_name =~ ‘\.xml$‘ || file_name =~ ‘\.xhtml$‘
if stridx( getline("."), "\<!--" ) != -1 && stridx( getline("."), "--\>" ) != -1
elseif stridx( getline("."), "\<!--" ) != -1 && stridx( getline("."), "--\>" ) == -1
" open, but a close "
execute ":silent! normal ^A--\>\<ESC>==\<down>^"
elseif stridx( getline("."), "\<!--" ) == -1 && stridx( getline("."), "--\>" ) != -1
execute ":silent! normal ^i\<\!--\<ESC>==\<down>^"
elseif stridx( getline("."), "\<!--" ) == -1 && stridx( getline("."), "--\>" ) == -1
execute ":silent! normal ^i\<\!--\<ESC>$a--\>\<ESC>==\<down>^"
endif
" for .ml, .mli files use (* *)
elseif file_name =~ ‘\.ml$‘ || file_name =~ ‘\.mli‘
if stridx(getline("."), "\(\*") == -1 && stridx(getline("."), "\*)/") == -1
execute ":silent! normal ^i\(*\<ESC>$a*)\<ESC>==\<down>^"
endif
" for .vim files use --
elseif file_name =~ ‘\.vim$‘ || file_name =~ ‘\.vimrc$‘
execute ":silent! normal :s/\\S/\\\"\\0/\<CR>:nohlsearch<CR>"
" for .sql files use --
elseif file_name =~ ‘\.sql$‘
execute ":silent! normal :s/\\S/\\-\\-\\0/\<CR>:nohlsearch<CR>"
" for .ksh or .sh or .csh or .pl or .pm files use #
elseif file_name =~ ‘\.[kc]\?sh$‘ || file_name =~ ‘\.pl$‘ || file_name =~ ‘\.pm$‘
execute ":silent! normal :s/\\S/\\#\\0/\<CR>:nohlsearch<CR>"
" for .tex use %
elseif file_name =~ ‘\.tex$‘ || file_name =~ ‘\.nw$‘
execute ":silent! normal :s/\\S/\\%\\0/\<CR>:nohlsearch<CR>"
" for fortran 77 files use C on first column
elseif file_name =~ ‘\.f$‘ || file_name =~ ‘\.F$‘
execute ":silent! normal ^gIC\<ESC>\<down>^"
" for fortran 90/95 files use !
elseif file_name =~ ‘\.f90$‘ || file_name =~ ‘\.F90$‘ || file_name =~ ‘\.f95$‘ || file_name =~ ‘\.F95$‘
execute ":silent! normal :s/\\S/!\\0/\<CR>:nohlsearch<CR>"
" for VHDL and Haskell files use --
elseif file_name =~ ‘\.vhd$‘ || file_name =~ ‘\.vhdl$‘ || file_name =~ ‘\.hs$‘
execute ":silent! normal ^gI-- \<ESC>\<down>^"
" for all other files use #
else
execute ":silent! normal :s/\\S/\\#\\0/\<CR>:nohlsearch<CR>"
endif
endfunction

" function to range un-comment lines in visual mode
function! RangeUnCommentLine()
let file_name = buffer_name("%")

" for .cpp or .hpp or .java files use //
if file_name =~ ‘\.cpp$‘ || file_name =~ ‘\.hpp$‘ || file_name =~ ‘\.java$‘ || file_name =~ ‘\.php[2345]\?$‘ || file_name =~ ‘\.C$‘
execute ":silent! normal :s/\\/\\///\<CR>:nohlsearch\<CR>=="
" for .c or .h or .pc or .css files use /* */
elseif file_name =~ ‘\.c$‘ || file_name =~ ‘\.h$‘ || file_name =~ ‘\.pc$‘ || file_name =~ ‘\.css$‘ || file_name =~ ‘\.js$‘
execute ":silent! normal :nohlsearch\<CR>:s/\\/\\*//\<CR>:s/\\*\\///\<CR>:nohlsearch\<CR>=="
" for .vim files use "
elseif file_name =~ ‘\.vim$‘ || file_name =~ ‘\.vimrc$‘
execute ":silent! normal :s/\\\"//\<CR>:nohlsearch\<CR>"
" for .sql files use --
elseif file_name =~ ‘\.sql$‘
execute ":silent! normal :s/\\-\\-//\<CR>:nohlsearch\<CR>"
" for .ml .mli
elseif file_name =~ ‘\.ml$‘ || file_name =~ ‘\.mli$‘
execute ":silent! normal :nohlsearch\<CR>:s/(\\*//\<CR>=="
execute ":silent! normal :nohlsearch\<CR>:s/\\*)//\<CR>=="
" for .xml .html .xhtml .htm use <!-- -->
elseif file_name =~ ‘\.html$‘ || file_name =~ ‘\.htm$‘ || file_name =~ ‘\.xml$‘ || file_name =~ ‘\.xhtml$‘
execute ":silent! normal :nohlsearch\<CR>:s/<!--//\<CR>=="
execute ":silent! normal :nohlsearch\<CR>:s/-->//\<CR>=="
elseif file_name =~ ‘\.[kc]\?sh$‘ || file_name =~ ‘\.pl$‘ || file_name =~ ‘\.pm$‘
execute ":silent! normal :s/\\#//\<CR>:nohlsearch\<CR>"
" for .tex use %
elseif file_name =~ ‘\.tex$‘ || file_name =~ ‘\.nw$‘
execute ":silent! normal :s/%/\<CR>:nohlsearch\<CR>"
" for fortran 77 files use C on first column
elseif file_name =~ ‘\.f$‘ || file_name =~ ‘\.F$‘
execute ":silent! normal ^x\<ESC>\<down>^"
" for fortran 90/95 files use !
elseif file_name =~ ‘\.f90$‘ || file_name =~ ‘\.F90$‘ || file_name =~ ‘\.f95$‘ || file_name =~ ‘\.F95$‘
execute ":silent! normal :s/!//\<CR>:nohlsearch\<CR>"
" for VHDL and Haskell files use --
elseif file_name =~ ‘\.vhd$‘ || file_name =~ ‘\.vhdl$‘ || file_name =~ ‘\.hs$‘
execute ":silent! normal :s/-- //\<CR>:nohlsearch\<CR>"
" for all other files use #
else
execute ":silent! normal :s/\\#//\<CR>:nohlsearch\<CR>"
endif
endfunction

时间: 2024-11-15 01:03:45

Linux: .vimrc的相关文章

linux .vimrc的设置!

0.记得在配之前先下载vim.不同的版本下载vim使用不同命令 ubuntu使用sudo apt-get install vim 1.vi ~/.vimrc  打开当前用户下的vim的配置文件(修改完之后只对当前用户有效) 2.下面是已经写好的一些参数,可以直接使用,配完之后很方便(直接拷贝保存:wq!就行了). set nocompatible " 关闭 vi 兼容模式 syntax on " 自动语法高亮 colorscheme molokai " 设定配色方案 set

u-boot平台的建立,驱动的添加,索引的创建,命令机制的实现.

一:U-boot移植前建立自己的平台: 关注的相关文件:1.u-boot- 2010.03/board/samsung/ //这个目录下需要创建自己的板级目录fsc100 cp –a smdkc100 fsc100 //直接复制需要修改的文件并重命名2./u-boot-2010.03/board/samsung/fsc100 //进入刚才复制好的目录,创建必要的C文件 mv smdkc100.c fsc100.c //直接重命名里面的可用文件3. vim Makefile //将这个新的C文件编

vim中ctags应用

ctags(Generate tag files for source code)是vim下方便代码阅读的工具.尽管ctags也可以支持其它编辑器,但是它正式支持的只有VIM.并且VIM中已经默认安装了Ctags,它可以帮助程序员很容易地浏览源代码. ctags能够定位如下内容: 1)用#define定义的宏 2)枚举型变量的值 3)函数的定义.原型和声明 4)名字空间(namespace) 5)类型定义(typedefs) 6)变量(包括定义和声明) 7)类(class).结构(struct)

Linux 配置 vimrc

由于熟悉了Windows下利用编译器进行编程,所以在刚刚接触Linux后的编程过程中会感觉其vim编译器的各种不方便编写程序,在逐渐的学习过程中了解到可以通过配置vimrc使得vim编译时类似于VS. 首先我们需要了解vimrc这个文件:vimrc有两个版本,分别为全局版本和用户版本,通过在vi下命令模式下输入[:version]会看到如下图所示的内容 其中系统vimrc文件是全局版本即系统中的公共版本,对其配置后所有用户下的vim编译器均被配置,用户vimrc文件是存在于每个用户的主目录下的私

Linux大棚版vimrc配置

Linux大棚版vimrc配置-V2.0版本,如下: [shell] $cat .vimrc "== "Author :roc "Website:roclinux.cn "Version:2.0 "== "vim支持go语言 - 开始 "关闭文件类型检测功能 filetype off "关闭文件类型插件加载功能.文件类型缩进功能 filetype plugin indent off "增加go语言的vim相关配置路径

Linux下编辑利器vim,vimrc,viminfo的高级用法

1.ci" (由 change operator 和 text-object i" 组成) 这个命令会找到当前光标所在行的下一个 " 括起来的字符串,清除引号裏面的内容,并进入 insert mode 以方便修改用起来比解释起来简单,你可用 const char* hello = "Hello world."; 类似这样的代码来测试 2.yaB (由 yank operator 和 text-object aB 组成) 这个命令会将当前光标所在的代码块({

Linux下的.vimrc文件

因为各种原因,经常需要对vim编辑环境进行设置,但总是忘记具体命令,记下来,方便以后使用,也希望可以帮助到其他刚入门的朋友. 首先,默认的Vim的配置目录在 /etc/vim目录下.在root用户根目录下用命令 vim /etc/vim/vimrc即可打开vimrc文件进行编辑.如没有,可自己创建一个,一般都有. 然后,根据个人需要进行设置. 以下列出了一些经常用到的设置: **双引号开始的行为注释行 **set nocompatible       去掉有关vi一致性模式,避免以前版本的一些b

linux vim 个性化设置(.vimrc)

set sw=4   set ts=4   set et   set smarttab   set smartindent   set lbr   set fo+=mB   set sm   set selection=inclusive   set wildmenu   set mousemodel=popup       au FileType php setlocal dict+=~/.vim/dict/php_funclist.dict   au FileType css setloca

C++模板、.vimrc和一些Linux配置

C++模板 #include<cstdio> #include<iostream> #include<cmath> #include<cstring> #include<algorithm> #include<set> #include<map> using namespace std; #define rep(i,l,r) for(register int i=(l);i<=(r);++i) #define rep