关于自动加入头文件的问题

来源:1-6 VIM编辑器基本设置(下)

慕粉3321357

2016-09-28 11:01

老师关于添加那一段自动添加头文件的东西,放在  /etc/vimrc  最后可以吗, 还是要放到 指定的位置。

写回答 关注

2回答

  • _潇潇暮雨
    2016-12-12 22:18:15
    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文件,你可以参考下。我是按照这个教程设置的。

    小马_125

    为啥用你的报错啊 -bash: syntax: command not found -bash: let: =consoles: syntax error: operand expected (error token is "=consoles")

    2019-08-28 11:43:59

    共 1 条回复 >

  • big杨
    2016-10-04 17:35:37

    可以放最后

Shell典型应用之主控脚本实现

应用shell实现案例主控脚本,握如何编写主控脚本

37224 学习 · 42 问题

查看课程

相似问题