vim设置自动添加头部注释
#自己改了改vim开头文件,如下图#

友友们可以直接修改·SetTitle()
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
" Only do this part when compiled with support for autocommands
if has("autocmd")
augroup redhat
autocmd!
" In text files, always limit the width of text to 78 characters
" autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
augroup END
endif
if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add $PWD/cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
filetype plugin on
if &term=="xterm"
set t_Co=8
set t_Sb=[4%dm
set t_Sf=[3%dm
endif
" Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"
filetype on
set rtp+=~/.vim/bundle/Vundle.vim
set runtimepath+=~/.vim/bundle/YouCompleteMe
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:syntastic_ignore_files=[".*\.py$"]
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_complete_in_comments = 1
let g:ycm_confirm_extra_conf = 0
let g:ycm_key_list_select_completion = ['<c-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>']
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_show_diagnostics_ui = 0
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
nnoremap <c-j> :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_min_num_of_chars_for_completion=2
autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"
func SetTitle()
if &filetype == 'sh'
call setline(1, "##########################################################################")
call append(line("."), "# File Name: ".expand("%"))
call append(line(".")+1, "# Author: jerry")
call append(line(".")+2, "# mail: jiayu_zhou007@163.com")
call append(line(".")+3, "# Created Time: ".strftime("%c"))
call append(line(".")+4, "#########################################################################")
call append(line(".")+5, "#!/bin/bash")
call append(line(".")+6, "")
else
call setline(1, "/*************************************************************************")
call append(line("."), " > File Name: ".expand("%"))
call append(line(".")+1, " > Author: jerry")
call append(line(".")+2, " > Mail: jiayu_zhou007@163.com ")
call append(line(".")+3, " > Created Time: ".strftime("%c"))
call append(line(".")+4, " ************************************************************************/")
call append(line(".")+5, "")
endif
endfunc
"突出显示当前行
set cursorline
" 语法高亮
set syntax=on
" 去掉输入错误的提示声音
set noeb
"背景使用黑色
"set background=dark
vim设置自动添加头部注释的更多相关文章
- vim创建程序文件自动添加头部注释/自动文件头注释与模板定义
Vim 自动文件头注释与模板定义 在vim的配置文件.vimrc添加一些配置可以实现创建新文件时自动添加文件头注释,输入特定命令可以生成模板. 使用方法 插入模式输入模式输入seqlogic[Ente ...
- Visual Studio 20**自动添加头部注释信息
关于Visual Studio 20**自动添加头部注释信息 作为一个万年潜水党,不关这一篇文章技术含量如何,也算是一个好的开始吧. 在日常的开发中我们经常需要为类库添加注释和版权等信息,这样 ...
- Visual Studio自动添加头部注释
VS2013 自动添加头部注释 1.找到VS2013的安装目录 下文以安装目录 C:\Program Files (x86)\Microsoft Visual Studio 12.0 为例 2.修改C ...
- VS2015 自动添加头部注释
让VS自动生成类的头部注释,只需修改两个文集即可,一下两个路径下个有一个 Class.cs文件 D:\Program Files (x86)\Microsoft Visual Studio 14.0\ ...
- VS自动添加头部注释
让VS自动生成类的头部注释,只需修改两个文集即可,一下两个路径下个有一个 Class.cs文件 D:\Program Files (x86)\Microsoft Visual Studio 14.0\ ...
- VS2017自动添加头部注释
让VS自动生成类的头部注释,只需修改两个文集即可,一下两个路径下个有一个 Class.cs文件 D:\Program Files (x86)\Microsoft Visual Studio\2017\ ...
- Visual Studio自动添加头部注释 -C#开发2010-2013验证
在团队开发中,头部注释是必不可少的.但在开发每次新建一个类都要复制一个注释模块也很不爽,所以得想个办法让开发工具自动生成我们所需要的模板.....操作方法如下: 找你的vs安装目录, 比如我的是在D盘 ...
- VS2013 自动添加头部注释 -C#开发
在团队开发中,头部注释是必不可少的.但在开发每次新建一个类都要复制一个注释模块也很不爽,所以得想个办法让开发工具自动生成我们所需要的模板.....操作方法如下: 方法/步骤 1 找你的vs安装目录, ...
- 让Visual Studio 自动添加头部注释信息
在日常的开发过程中我们经常需要为我们的类文件添加注释和版权等信息,以前都是将信息文本复制.粘贴,要是添加一两个个还好,要是添加很多就显得很麻烦了.为了减少这种重复性的工作,有没有好的解决办法呢?答案是 ...
随机推荐
- 剑指Offer系列_30_包含min函数的栈
以空间换时间: package leetcode.sword_to_offfer.day01; import java.util.Stack; /** * 定义栈的数据结构,请在该类型中实现一个能够得 ...
- Solution -「AGC 010C」「AT 2304」Cleaning
\(\mathcal{Description}\) Link. 给定一棵 \(n\) 个点的无根树,点有点权,每次选择两个不同的叶子,使它们间的简单路径的所有点权 \(-1\),问能否将所有点 ...
- Solution -「洛谷 P6158」封锁
\(\mathcal{Description}\) Link. 给定一个 \(n\times n\) 的格点图,横纵相邻的两格点有一条边权为二元组 \((w,e)\) 的边.求对于 \(S=( ...
- Spring Boot内置Tomcat
Spring Boot默认支持Tomcat/Jetty/Undertow作为底层容器.在之前实战相关的文章中,可以看到引入spring-boot-starter-web就默认使用tomcat容器,这是 ...
- 云原生 PostgreSQL - CrunchyData PGO 教程:创建、连接、删除 Postgres 集群
入门 作为安装的一部分,请确保您已完成以下操作: 分叉 Postgres Operator 示例存储库并将其克隆到您的主机. https://github.com/CrunchyData/postgr ...
- PRML 回归的线性模型
线性模型最简单的形式就是输入变量的线性模型,但是,将一组输入变量的非线性函数进行线性组合,我们可以得到一类更加有用的函数,本章我们的讨论重点就是输入变量的非线性函数的线性组合. 1 线性基 ...
- linux下用crunch工具生成密码
crunch是一款linux下的压缩后仅仅38k的小程序,crunch程序在2004年及以前由email为的作者编写mimayin@aciiid.ath.cx,后续版本由bofh28@gmail.co ...
- 用Stegsolve工具解图片隐写的问题
- 替代Tableau,思迈特软件Smartbi让Excel成为企业级自助分析平台
谈到企业级自助分析平台,大家自然会想到Tableau,在Garnter最新的BI平台魔力象限中,是这么描述Tableau的. "Tableau is a Leader in this ...
- Oracle之数据库浅谈
前言 1970年的6月,IBM 公司的研究员埃德加·考特 (Edgar Frank Codd) 在 Communications of ACM 上发表了那篇著名的<大型共享数据库数据的关系模型& ...