Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void){
- }
- (define-skeleton c-throwaway
- "Throwaway C skeleton"
- "#include <stdio.h>n"
- "#include <stdlib.h>n"
- "n"
- "int main(void){n"
- "n"
- "}n")
- (define-auto-insert "\.\([Cc]\|cc\|cpp\)\'" 'c-throwaway)
- (defun defaultCtemplate(cfilename)
- (interactive "sFilename: ")
- (switch-to-buffer (generate-new-buffer cfilename))
- (insert-file-contents "~/Desktop/test.c")
- (c-mode)
- )
- (require 'tempo)
- (setq c-new-buffer-template
- '(
- "#include <stdio.h>n"
- "#include <stdlib.h>n"
- "n"
- "int main(void){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")
Add Comment
Please, Sign In to add comment