Think before you speak, read before you think.

编辑~/.vimrc,用vim新建文件时自动套用模板

编辑~/.vimrc文件

vim ~/.vimrc

添加一行

autocmd BufNewFile *.py 0r ~/.vim/template/simple.py

新建simple.py文件

mkdir -p ~/.vim/template/
vim ~/.vim/template/simple.py

加入以下内容

#!/usr/bin/env python
#-*- coding:utf-8 -*-
#author: jpuyy date  jpuyy.com
#modified by xx at date
#version:
#history:
#relate on:

这样每次新建 .py 文件的时候,就会自动套用上面的模版

:)EOT


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *