代码改变世界

Emacs

2012-01-18 09:50  康杜  阅读(275)  评论(0编辑  收藏  举报

My Emacs setting for Groovy

(put 'dired-find-alternate-file 'disabled nil)
;;; turn on syntax highlighting
(global-font-lock-mode 1)
;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start
(autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))
;;; make Groovy mode electric by default.
(add-hook 'groovy-mode-hook
          '(lambda ()
             (require 'groovy-electric)
             (groovy-electric-mode)))
(setq x-select-enable-clipboard t) ;this is the varaibale set
 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
(global-set-key (kbd "C-x <up>")  'windmove-up)
(global-set-key (kbd "C-x <down>") 'windmove-down)
(global-set-key (kbd "C-x <right>") 'windmove-right)
(global-set-key (kbd "C-x <left>") 'windmove-left)
(if (fboundp 'pc-selection-mode) (pc-selection-mode) (require 'pc-select))   
  (custom-set-variables  '(pc-selection-mode t nil (pc-select)))