• 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

  • 相关阅读:
    hdu 1106 排序(排序)
    hdu 1040 As Easy As A+B(排序)
    hdu 1029 Ignatius and the Princess IV(排序)
    mysql-9索引
    mysql-8 alter命令
    mysql-7事务管理
    mysql-6正则表达式
    http协议
    9-2交互体验
    9-2专项测试下午
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2137411.html
Copyright © 2020-2023  润新知