V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
013231
V2EX  ›  Vim

怎样在新建特定扩展名的文件时自动执行特定动作?

  •  
  •   013231 · 2012-01-22 01:17:52 +08:00 · 3281 次点击
    这是一个创建于 4480 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如说, 新建.sh文件时自动在文件头部插入#!/bin/bash, 新建.py时自动插入#!/usr/bin/python, 并执行chmod u+x %.
    2 条回复    1970-01-01 08:00:00 +08:00
    fanzeyi
        1
    fanzeyi  
       2012-01-22 11:28:30 +08:00
    autocmd
    ry_wang
        2
    ry_wang  
       2012-01-22 13:52:09 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5407 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:49 · PVG 13:49 · LAX 22:49 · JFK 01:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.