Skip to content

Instantly share code, notes, and snippets.



Created Mar 16, 2015
What would you like to do?
;; ~/elisp をライブラリパスに追加
(setq load-path
(expand-file-name "~/elisp/")
;; indent setting
(setq-default tab-width 4 indent-tabs-mode nil)
;; ruby-mode
(autoload 'ruby-mode "ruby-mode"
"Mode for editing ruby source files" t)
(setq auto-mode-alist
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
(autoload 'run-ruby "inf-ruby"
"Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby"
"Set local key defs for inf-ruby in ruby-mode")
(add-hook 'ruby-mode-hook
'(lambda () (inf-ruby-keys)))
;; ruby-electric
(require 'ruby-electric)
(add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t)))
;; ELPA package
(require 'package)
(add-to-list 'package-archives '("melpa" . "") t)
(add-to-list 'package-archives '("marmalade" . ""))
;; auto-complete
(require 'auto-complete-config)
;; js2-mode
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t) ; optional
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(defun revert-buffer-no-confirm (&optional force-reverting)
"Interactive call to revert-buffer. Ignoring the auto-save
file and not requesting for confirmation. When the current buffer
is modified, the command refuses to revert it, unless you specify
the optional argument: force-reverting to true."
(interactive "P")
;;(message "force-reverting value is %s" force-reverting)
(if (or force-reverting (not (buffer-modified-p)))
(revert-buffer :ignore-auto :noconfirm)
(error "The buffer has been modified")))
(global-set-key "\M-r" 'revert-buffer-no-confirm)
(require 'magit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment