Skip to content

Instantly share code, notes, and snippets.

@garuma
Created February 27, 2012 13:40
Show Gist options
  • Save garuma/1923873 to your computer and use it in GitHub Desktop.
Save garuma/1923873 to your computer and use it in GitHub Desktop.
(add-to-list 'load-path "~/emacs.d")
(setq ring-bell-function 'ignore)
(set-language-environment "UTF-8")
(setq default-tab-width 4)
(setq tab-width 4)
(setq-default tab-width 4)
(setq cua-auto-tabify-rectangles nil)
(setq add-log-mailing-address "jeremie.laval@gmail.com")
(setq user-mail-address "jeremie.laval@gmail.com")
(setq user-full-name "Jérémie Laval")
(blink-cursor-mode (- (*) (*) (*)))
(require 'smarttabs)
(setq indent-tabs-mode t)
;; CSharp
(setq flymake-mode nil)
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
(setq auto-mode-alist
(append '(("\\.cs$" . csharp-mode)) auto-mode-alist))
;; PHP
(autoload 'php-mode "php-mode.el" "Php mode." t)
(setq auto-mode-alist (append '(("/*.\.php[345]?$" . php-mode)) auto-mode-alist))
;; Prolog
;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
;; (autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
;; (autoload 'mercury-mode "prolog" "Major mode for editing Mercury programs." t)
;; (setq prolog-system 'swi)
;; (setq auto-mode-alist (append '(("\\.pl$" . prolog-mode))
;; auto-mode-alist))
;; Lisp
;; (setq inferior-lisp-program "/usr/bin/clisp")
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
;; (require 'slime)
;; (slime-setup)
;; LaTeX
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
;; Scheme
;(autoload 'bdb "bdb" "bdb mode" t)
;(autoload 'bee-mode "bee-mode" "bee mode" t)
;(setq auto-mode-alist
; (append '(("\\.scm$" . bee-mode)
; ("\\.sch$" . bee-mode)
; ("\\.scme$" . bee-mode)
; ("\\.bgl$" . bee-mode)
; ("\\.bee$" . bee-mode))
; auto-mode-alist))
;; ReST
(autoload 'rst "rst" "Major mode for editing reStructured text" t)
(require 'rst)
(setq auto-mode-alist
(append '(("\\.rst$" . rst-mode)
("\\.rest$" . rst-mode)) auto-mode-alist))
(add-hook 'rst-adjust-hook 'rst-toc-update)
(add-hook 'text-mode-hook 'rst-text-mode-bindings)
;disable backup
(setq backup-inhibited t)
;disable auto save
(setq auto-save-default nil)
(setq dabbrev-case-fold-search t)
(setq dabbrev-case-replace nil)
;;; couleurs:
;; gestion des thèmes
(require 'color-theme)
;;(color-theme-charcoal-black)
(require 'color-theme-solarized)
(require 'zenburn)
(zenburn)
;;; Afficher la 'parenthèse correspondante'
(setq show-paren-delay 0)
(show-paren-mode 13)
;(set-default-font "-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1")
(set-default-font "Inconsolata-16")
(require 'linum)
(global-set-key (kbd "<f6>") 'linum-mode)
;; (require 'minimap)
(defadvice kill-ring-save (before slick-copy activate compile) "When called
interactively with no active region, copy a single line instead."
(interactive (if mark-active (list (region-beginning) (region-end)) (message
"Copied line") (list (line-beginning-position) (line-beginning-position
2)))))
(defadvice kill-region (before slick-cut activate compile)
"When called interactively with no active region, kill a single line instead."
(interactive
(if mark-active (list (region-beginning) (region-end))
(list (line-beginning-position)
(line-beginning-position 2)))))
(defun pretty-print-xml-region (begin end)
"Pretty format XML markup in region. You need to have nxml-mode
http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do
this. The function inserts linebreaks to separate tags that have
nothing but whitespace between them. It then indents the markup
by using nxml's indentation rules."
(interactive "r")
(save-excursion
(nxml-mode)
(goto-char begin)
(while (search-forward-regexp "\>[ \\t]*\<" nil t)
(backward-char) (insert "\n"))
(indent-region begin end))
(message "Ah, much better!"))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(cluck-fontify-style (quote plt))
'(column-number-mode t)
'(inhibit-startup-screen t)
'(transient-mark-mode (quote identity)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment