慕粉3321357
2016-09-28 11:01
老师关于添加那一段自动添加头文件的东西,放在 /etc/vimrc 最后可以吗, 还是要放到 指定的位置。
set number set autoindent set cindent let $author_name="consoles" let $author_email="consoles.me@gmail.com" function! AutoSetShFileHead() if &filetype == 'sh' call setline(1, "\#!/bin/bash") call append(line("."),"\# filename: ".expand("%")) call append(line(".")+1,"\# author: ".$author_name) call append(line(".")+2,"\# email: ".$author_email) call append(line(".")+3,"\# created time: ".strftime("%c")) endif normal G normal o normal o endfunc
这个是我的vimrc文件,你可以参考下。我是按照这个教程设置的。
可以放最后
Shell典型应用之主控脚本实现
37224 学习 · 42 问题
相似问题