How can I automatically add some skeleton code when creating a new file with vim

后端 未结 8 1415
清歌不尽
清歌不尽 2020-11-29 02:42

When creating a new file with vim, I would like to automatically add some skeleton code.

For example, when creating a new xml file, I would like to add the first lin

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 02:53

    You can add various hooks when files are read or created. to

    :help event
    

    and read what's there. What you want is

    :help BufNewFile
    

提交回复
热议问题