zoukankan      html  css  js  c++  java
  • emacs 根据文件名自动加载内容

    1

    (setq c-new-buffer-template 
    '(
    ; "#include <stdio.h>\n"
    ;
    "#include <stdlib.h>\n"
    ;
    "\n"
    ;
    "int main(void){\n"
    ;
    "\n"
    ;
    "}\n"
    ; ))
    "/*\n"
    " * =====================================================================================\n"
    " *\n"
    " * Filename: test.c\n"
    " *\n"
    " * Description:\n"
    " *\n"
    " * Version: 1.0\n"
    " * Created: 07/29/2011 10:37:04 AM\n"
    " * Revision: none\n"
    " * Compiler: gcc\n"
    " *\n"
    " * Author: kangle.wang (mn), wangkangluo1@gmail.com\n"
    " * Company: APE-TECH\n"
    " *\n"
    " * =====================================================================================\n"
    " */\n"
    ))

    (defun my
    -c-style ()
    "My editing style for .c files."
    (c
    -mode)
    (
    if (zerop (buffer-size))
    (tempo
    -template-c-skeleton)))

    (setq auto
    -mode-alist
    (cons
    '("\\.c\\'" . my-c-style) auto-mode-alist))

    (tempo
    -define-template "c-skeleton" c-new-buffer-template
    nil
    "Insert a skeleton for a .c document")






    (setq js
    -new-buffer-template
    '(

    "/*fuckof\n"

    ))
    (defun my
    -js-style ()
    "My editing style for .c files."
    (c
    -mode)
    (
    if (zerop (buffer-size))
    (tempo
    -template-c-skeleton)))

    (setq auto
    -mode-alist
    (cons
    '("\\.js\\'" . my-js-style) auto-mode-alist))

    (tempo
    -define-template "c-skeleton" js-new-buffer-template
    nil
    "Insert a skeleton for a .c document")

      

    2

  • 相关阅读:
    约瑟夫环公式解
    闭区间筛素数个数
    欧拉函数
    负进制转换
    2018黑龙江省赛总结
    基础博弈——威佐夫与尼姆不得不说的那些事
    极角排序
    int型素数拆分
    快速幂与费马小定理与组合数
    A*搜索算法
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2137411.html
Copyright © 2011-2022 走看看