terdon

terdon's nint.el

Jan 14th, 2015
288
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;(setq locale-coding-system 'utf-8)
  2. ;(set-terminal-coding-system 'utf-8)
  3. ;(set-keyboard-coding-system 'utf-8)
  4. ;(set-selection-coding-system 'utf-8)
  5. ;(prefer-coding-system 'utf-8)
  6. ;'(buffer-encoding (quote utf-8))
  7. '(recentf-mode t)
  8. '(transient-mark-mode t)
  9.  
  10. ;(set-default-font "Bitstream Vera Sans Mono-10")
  11. ;(set-fontset-font (frame-parameter nil 'font)
  12. ;  'han '("cwTeXHeiBold" . "unicode-bmp"))
  13.  
  14. (setq make-backup-files nil)
  15. (setq query-replace-highlight t)
  16. (setq search-highlight t)
  17. (setq font-lock-maximum-decoration t)
  18. (fset 'yes-or-no-p 'y-or-n-p)
  19. (setq require-final-newline t)
  20. (setq major-mode 'text-mode)
  21.  
  22. ;; turn on paren matching
  23. (show-paren-mode t)
  24. (setq show-paren-style 'mixed)
  25.  
  26. ;; Get rid of the startup screen
  27. (setq inhibit-startup-screen t)
  28. (setq initial-scratch-message nil)
  29.  
  30. (setq default-frame-alist '((font . "inconsolata")))
  31.  
  32. ;; Get back font antialiasing
  33. (push '(font-backend xft x) default-frame-alist)
  34.  
  35. ;(global-font-lock-mode t t)
  36. (setq font-lock-maximum-decoration t)
  37.  
  38. ;(setq default-directory "~/Documentos/WyeWorks/Proys/")
  39. (setq default-directory "~/")
  40.  
  41. ;; Get rid of toolbar, scrollbar, menubar
  42. (progn
  43.   (tool-bar-mode)
  44. ;  (menu-bar-mode)
  45.   (scroll-bar-mode))
  46.  
  47. (add-to-list 'load-path "~/.emacs.d/plugins/textmate")
  48. (require 'textmate)
  49. (textmate-mode)
  50.  
  51. ;; redo
  52. (add-to-list  'load-path "~/.emacs.d/plugins/redo")
  53. (require 'redo)
  54. (global-set-key [(control -)] 'redo)
  55.  
  56.  
  57. ;; show ascii table
  58. ;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
  59. (defun ascii-table ()
  60.   "Print the ascii table. Based on a defun by Alex Schroeder <asc@bsiag.com>"
  61.   (interactive)
  62.   (switch-to-buffer "*ASCII*")
  63.   (erase-buffer)
  64.   (insert (format "ASCII characters up to number %d.\n" 254))
  65.   (let ((i 0))
  66.     (while (< i 254)
  67.       (setq i (+ i 1))
  68.       (insert (format "%4d %c\n" i i))))
  69.   (beginning-of-buffer))
  70.  
  71.  
  72. ;; insert date into buffer at point
  73. ;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
  74. (defun insert-date ()
  75.   "Insert date at point."
  76.   (interactive)
  77.   (insert (format-time-string "%a %Y-%m-%d - %l:%M %p")))
  78.  
  79.  
  80. ;; Centering code stolen from somewhere and restolen from
  81. ;; http://www.chrislott.org/geek/emacs/dotemacs.html
  82. ;; centers the screen around a line...
  83. (global-set-key [(control l)]  'centerer)
  84. (defun centerer ()
  85.    "Repositions current line: once middle, twice top, thrice bottom"
  86.    (interactive)
  87.    (cond ((eq last-command 'centerer2)  ; 3 times pressed = bottom
  88.           (recenter -1))
  89.          ((eq last-command 'centerer1)  ; 2 times pressed = top
  90.           (recenter 0)
  91.           (setq this-command 'centerer2))
  92.          (t                             ; 1 time pressed = middle
  93.           (recenter)
  94.           (setq this-command 'centerer1))))
  95.  
  96.  
  97. ;; Kills live buffers, leaves some emacs work buffers
  98. ;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
  99. (defun nuke-some-buffers (&optional list)
  100.   "For each buffer in LIST, kill it silently if unmodified. Otherwise ask.
  101. LIST defaults to all existing live buffers."
  102.   (interactive)
  103.   (if (null list)
  104.       (setq list (buffer-list)))
  105.   (while list
  106.     (let* ((buffer (car list))
  107.            (name (buffer-name buffer)))
  108.       (and (not (string-equal name ""))
  109.            ;(not (string-equal name "*Messages*"))
  110.           ;; (not (string-equal name "*Buffer List*"))
  111.            ;(not (string-equal name "*buffer-selection*"))
  112.            ;(not (string-equal name "*Shell Command Output*"))
  113.            (not (string-equal name "*scratch*"))
  114.            (/= (aref name 0) ? )
  115.            (if (buffer-modified-p buffer)
  116.                (if (yes-or-no-p
  117.                     (format "Buffer %s has been edited. Kill? " name))
  118.                    (kill-buffer buffer))
  119.              (kill-buffer buffer))))
  120.     (setq list (cdr list))))
  121.  
  122.  
  123. ;; fullscreen
  124. ;(defun toggle-fullscreen ()
  125. ;(interactive)
  126. ;(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
  127. ;'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  128. ;(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
  129. ;'(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
  130. ;)
  131. ;(toggle-fullscreen)
  132.  
  133.  
  134. ;; maxframe
  135. (add-to-list  'load-path "~/.emacs.d/plugins/maxframe")
  136. (require 'maxframe)
  137. (add-hook 'window-setup-hook 'maximize-frame t)
  138. (add-hook 'window-setup-hook 'ecb-redraw-layout t)
  139.  
  140. (set-background-color "#2b2b2b")
  141. (set-foreground-color "white")
  142. (set-face-background 'modeline "DarkRed")
  143. (set-face-foreground 'modeline "white")
  144. ;; color-theme
  145. ;(add-to-list  'load-path "~/.emacs.d/plugins/color-theme")
  146. ;(require 'color-theme)
  147. ;    (color-theme-initialize)
  148. ;    (color-theme-arjen)
  149.  
  150.  
  151. (mouse-wheel-mode t)
  152. ;; wheel mouse
  153. ;(defun up-slightly () (interactive) (scroll-up 5))
  154. ;(defun down-slightly () (interactive) (scroll-down 5))
  155. ;(global-set-key [mouse-4] 'down-slightly)
  156. ;(global-set-key [mouse-5] 'up-slightly)
  157. ;(defun up-one () (interactive) (scroll-up 1))
  158. ;(defun down-one () (interactive) (scroll-down 1))
  159. ;(global-set-key [S-mouse-4] 'down-one)
  160. ;(global-set-key [S-mouse-5] 'up-one)
  161. ;(defun up-a-lot () (interactive) (scroll-up))
  162. ;(defun down-a-lot () (interactive) (scroll-down))
  163. ;(global-set-key [C-mouse-4] 'down-a-lot)
  164. ;(global-set-key [C-mouse-5] 'up-a-lot)
  165.  
  166.  
  167. ;; cedet
  168. ;; See cedet/common/cedet.info for configuration details.
  169. (load-file "~/.emacs.d/plugins/cedet/common/cedet.el")
  170. ; Enable EDE (Project Management) features
  171. ;(global-ede-mode 1)
  172. ;; * This enables the database and idle reparse engines
  173. ;(semantic-load-enable-minimum-features)
  174. ;(setq semantic-load-turn-everything-on t)
  175.  
  176.  
  177. ;; ecb
  178. (setq stack-trace-on-error t)
  179. (add-to-list 'load-path "~/.emacs.d/plugins/ecb")
  180. (require 'ecb)
  181. (setq ecb-tip-of-the-day nil)
  182. (setq ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
  183. (ecb-activate)
  184. (ecb-byte-compile)
  185. (custom-set-variables
  186.   ;; custom-set-variables was added by Custom.
  187.   ;; If you edit it by hand, you could mess it up, so be careful.
  188.   ;; Your init file should contain only one such instance.
  189.   ;; If there is more than one, they won't work right.
  190.  '(ecb-layout-window-sizes (quote (("left8" (ecb-directories-buffer-name 0.23671497584541062 . 0.29310344827586204) (ecb-sources-buffer-name 0.23671497584541062 . 0.22413793103448276) (ecb-methods-buffer-name 0.23671497584541062 . 0.25862068965517243) (ecb-history-buffer-name 0.23671497584541062 . 0.20689655172413793)))))
  191.  '(ecb-options-version "2.40"))
  192. ;; resize the windows on emacs and run ecb-store-window-sizes
  193. ; '(show-paren-mode t))
  194.  
  195.  
  196. ;; find-recursive
  197. (add-to-list 'load-path "~/.emacs.d/plugins/find-recursive")
  198. (require 'find-recursive)
  199.  
  200.  
  201. ;; anything
  202. (add-to-list 'load-path "~/.emacs.d/plugins/anything")
  203. (require 'anything)
  204.  
  205. ;; anything-rcodetools
  206. (add-to-list 'load-path "~/.emacs.d/plugins/rcodetools")
  207. ;(require 'rcodetools)
  208. ;(require 'icicles-rcodetools)
  209. ;(require 'anything)
  210. (require 'anything-rcodetools)
  211. ;;       ;; Command to get all RI entries.
  212. (setq rct-get-all-methods-command "PAGER=cat fri -l -L")
  213. ;;       (setq rct-get-all-methods-command "PAGER=cat fri -l")
  214. ;(setq rct-get-all-methods-command "PAGER=cat ri -l")
  215. ;;       ;; See docs
  216. ;; (define-key ruby-mode-map "\M-\C-i" 'rct-complete-symbol)
  217. (define-key anything-map "\C-z" 'anything-execute-persistent-action)
  218. ;(rct-get-all-methods)
  219.  
  220.  
  221. ;; Interactively Do Things (highly recommended, but not strictly required)
  222. (require 'ido)
  223. (ido-mode t)
  224.  
  225.  
  226. ;; tabkey2
  227. ;(load "~/.emacs.d/plugins/nxhtml/util/tabkey2.el")
  228.  
  229.  
  230.  
  231. ;; DTD mode
  232. (autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs." t)
  233. (autoload 'dtd-etags "tdtd" "Execute etags on FILESPEC and match on DTD-specific regular expressions." t)
  234. (autoload 'dtd-grep "tdtd" "Grep for PATTERN in files matching FILESPEC." t)
  235. (setq auto-mode-alist (append (list
  236.     '("\\.dcl$" . dtd-mode)
  237.     '("\\.dec$" . dtd-mode)
  238.     '("\\.dtd$" . dtd-mode)
  239.     '("\\.ele$" . dtd-mode)
  240.     '("\\.ent$" . dtd-mode)
  241.     '("\\.mod$" . etd-mode))
  242.   auto-mode-alist))
  243.  
  244.  
  245. ;; css
  246. ;(add-to-list  'load-path "~/.emacs.d/plugins/css-mode")
  247. ;(autoload 'css-mode "css-mode" "Mode for editing CSS files" t)
  248. ;(setq auto-mode-alist (append '(("\\.css$" . css-mode)) auto-mode-alist))
  249. (add-hook 'css-mode-hook
  250.          (lambda()
  251.            (local-set-key (kbd "<return>") 'newline-and-indent)
  252. ))
  253.  
  254.  
  255. ;; javascript
  256. (add-to-list  'load-path "~/.emacs.d/plugins/javascript")
  257. (add-to-list 'auto-mode-alist '("\\.js$" . javascript-mode))
  258. (autoload 'javascript-mode "javascript" nil t)
  259.  
  260. (defvar javascript-identifier-regexp "[a-zA-Z0-9.$_]+")
  261.  
  262. (defun javascript-imenu-create-method-index-1 (class bound)
  263.   (let (result)
  264.     (while (re-search-forward (format "^ +\\(\%s\\): *function" javascript-identifier-regexp) bound t)
  265.       (push (cons (format "%s.%s" class (match-string 1)) (match-beginning 1)) result))
  266.     (nreverse result)))
  267.  
  268. (defun javascript-imenu-create-method-index()
  269.   (cons "Methods"
  270.         (let (result)
  271.           (dolist (pattern (list (format "\\b\\(%s\\) *= *Class\.create" javascript-identifier-regexp)
  272.                                  (format "\\b\\([A-Z]%s\\) *= *Object.extend(%s"
  273.                                          javascript-identifier-regexp
  274.                                          javascript-identifier-regexp)
  275.                                  (format "^ *Object.extend(\\([A-Z]%s\\)" javascript-identifier-regexp)
  276.                                  (format "\\b\\([A-Z]%s\\) *= *{" javascript-identifier-regexp)))
  277.             (goto-char (point-min))
  278.             (while (re-search-forward pattern (point-max) t)
  279.               (save-excursion
  280.                 (condition-case nil
  281.                     (let ((class (replace-regexp-in-string "\.prototype$" "" (match-string 1)))
  282.                           (try 3))
  283.                       (if (eq (char-after) ?\()
  284.                           (down-list))
  285.                       (if (eq (char-before) ?{)
  286.                           (backward-up-list))
  287.                       (forward-list)
  288.                       (while (and (> try 0) (not (eq (char-before) ?})))
  289.                         (forward-list)
  290.                         (decf try))
  291.                       (if (eq (char-before) ?})
  292.                           (let ((bound (point)))
  293.                             (backward-list)
  294.                             (setq result (append result (javascript-imenu-create-method-index-1 class bound))))))
  295.                   (error nil)))))
  296.           (delete-duplicates result :test (lambda (a b) (= (cdr a) (cdr b)))))))
  297.  
  298. (defun javascript-imenu-create-function-index ()
  299.   (cons "Functions"
  300.          (let (result)
  301.            (dolist (pattern '("\\b\\([[:alnum:].$]+\\) *= *function" "function \\([[:alnum:].]+\\)"))
  302.              (goto-char (point-min))
  303.              (while (re-search-forward pattern (point-max) t)
  304.                (push (cons (match-string 1) (match-beginning 1)) result)))
  305.            (nreverse result))))
  306.  
  307. (defun javascript-imenu-create-index ()
  308.   (list
  309.    (javascript-imenu-create-function-index)
  310.    (javascript-imenu-create-method-index)))
  311.  
  312. (add-hook 'javascript-mode-hook
  313.   (lambda ()
  314.     (setq imenu-create-index-function 'javascript-imenu-create-index)
  315.     (local-set-key (kbd "<return>") 'newline-and-indent)
  316.   )
  317. t)
  318.  
  319. ;; ruby-mode
  320. (add-to-list 'load-path "~/.emacs.d/plugins/ruby-mode")
  321. (require 'ruby-mode)
  322. (require 'ruby-electric)
  323. (add-hook 'ruby-mode-hook 'turn-on-font-lock)
  324. (add-to-list 'auto-mode-alist '("\\.rjs$" . ruby-mode))
  325. (add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
  326.  
  327. ;; ruby-block
  328. (add-to-list 'load-path "~/.emacs.d/plugins/ruby-block")
  329. (require 'ruby-block)
  330.  
  331. ;; ruby electric
  332. (defun try-complete-abbrev (old)
  333.   (if (expand-abbrev) t nil))
  334. (setq hippie-expand-try-functions-list
  335.      '(try-complete-abbrev
  336.    try-complete-file-name
  337.    try-expand-dabbrev))
  338.  
  339.  
  340. ;; yaml
  341. (add-to-list 'load-path "~/.emacs.d/plugins/yaml-mode")
  342. (require 'yaml-mode)
  343. (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
  344.  
  345.  
  346. ;; rdebug
  347. (add-to-list 'load-path "~/.emacs.d/plugins/rdebug")
  348. (require 'rdebug)
  349. (setq rdebug-short-key-mode t)
  350.  
  351.  
  352. ;; ri-emacs
  353. (setq ri-ruby-script (expand-file-name "~/.emacs.d/plugins/ri-emacs/ri-emacs.rb"))
  354. ;(autoload 'ri (expand-file-name "~/.emacs.d/plugins/ri-emacs/ri-ruby.el") nil t)
  355. (load "~/.emacs.d/plugins/ri-emacs/ri-ruby.el")
  356.  
  357.  
  358. ;; ruby-mode-hook
  359. (add-hook 'ruby-mode-hook
  360.          (lambda()
  361.            (add-hook 'write-file-functions
  362.                       '(lambda()
  363.                          (save-excursion
  364.                            (untabify (point-min) (point-max))
  365.                            (delete-trailing-whitespace)
  366.                            )))
  367.            (set (make-local-variable 'indent-tabs-mode) 'nil)
  368.            (set (make-local-variable 'tab-width) 2)
  369.            (imenu-add-to-menubar "IMENU")
  370. ;           (require 'ruby-electric)
  371.            (ruby-electric-mode t)
  372. ;           (require 'ruby-block)
  373.            (ruby-block-mode t)
  374. ;           (local-set-key 'f1 'ri)
  375.            (local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
  376. ;           (local-set-key 'f4 'ri-ruby-show-args)
  377.            (define-key ruby-mode-map "\M-\C-o" 'rct-complete-symbol)
  378.            (local-set-key (kbd "<return>") 'newline-and-indent)
  379. ))
  380.  
  381.  
  382. ;; nxhtml
  383. ;(setq *nxhtml-autostart-file* (expand-file-name "~/.emacs.d/plugins/nxhtml/autostart.el"))
  384. ;(load *nxhtml-autostart-file*)
  385. ;(setq
  386. ;      nxhtml-global-minor-mode t
  387. ;      mumamo-chunk-coloring 'submode-colored
  388. ;      nxhtml-skip-welcome t
  389. ;      indent-region-mode t
  390. ;      nxhtml-default-encoding "utf8"
  391. ;      rng-nxml-auto-validate-flag nil
  392. ;      nxml-degraded t)
  393. ;(add-to-list 'auto-mode-alist '("\\.html$" . nxhtml-mumamo-mode))
  394. ;(add-to-list 'auto-mode-alist '("\\.html\\.erb$" . eruby-nxhtml-mumamo-mode))
  395. ;(add-hook 'nxhtml-mumamo-mode-hook 'tabkey2-mode)
  396. ;(add-hook 'eruby-nxhtml-mumamo-mode-hook 'tabkey2-mode)
  397.  
  398.  
  399. ;; flymake
  400. (add-to-list  'load-path "~/.emacs.d/plugins/flymake")
  401. (require 'flymake)
  402.  
  403. ;; I don't like the default colors :)
  404. (set-face-background 'flymake-errline "red4")
  405. (set-face-background 'flymake-warnline "dark slate blue")
  406.  
  407. ;; Feature request: have flymake create its temp files in the system temp file directory instead of in the same directory as the file. When using it with Ruby on Rails and autotest, autotest sees the temp file and tries to do something with it and dies, forcing me to restart it, thus killing the magic of autotest. Putting flymake’s temp files elsewhere seems like the easiest way to dodge this.
  408. ;;
  409. ;; I second the above request. I know there are workarounds for autotest, but it seems like we don’t want to find work arounds for every new web framework, we want to get flymake working in a way that won’t conflict with any other tools.
  410. ;;
  411. ;; It is easy to patch your autotest to ignore flymake files. I have submitted a patch which hopefully will be included in future releases. For more info see: Emacs, flymake and autotest: the fix
  412. ;;
  413. ;; Here is a suggestion for a solution (100% untested). Replace flymake-create-temp-inplace above with
  414.  
  415. (defun flymake-create-temp-intemp (file-name prefix)
  416.   "Return file name in temporary directory for checking FILE-NAME.
  417. This is a replacement for `flymake-create-temp-inplace'. The
  418. difference is that it gives a file name in
  419. `temporary-file-directory' instead of the same directory as
  420. FILE-NAME.
  421.  
  422. For the use of PREFIX see that function.
  423.  
  424. Note that not making the temporary file in another directory
  425. \(like here) will not if the file you are checking depends on
  426. relative paths to other files \(for the type of checks flymake
  427. makes)."
  428.   (unless (stringp file-name)
  429.     (error "Invalid file-name"))
  430.   (or prefix
  431.       (setq prefix "flymake"))
  432.   (let* ((name (concat
  433.                 (file-name-nondirectory
  434.                  (file-name-sans-extension file-name))
  435.                 "_" prefix))
  436.          (ext  (concat "." (file-name-extension file-name)))
  437.          (temp-name (make-temp-file name nil ext))
  438.          )
  439.     (flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name)
  440.     temp-name))
  441.  
  442.  
  443. ;; Invoke ruby with '-c' to get syntax checking
  444. (defun flymake-ruby-init ()
  445.   (let* ((temp-file   (flymake-init-create-temp-buffer-copy
  446.                        'flymake-create-temp-intemp))
  447.          (local-file  (file-relative-name
  448.                        temp-file
  449.                        (file-name-directory buffer-file-name))))
  450.     (list "ruby" (list "-c" local-file))))
  451.  
  452. (push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
  453. (push '(".+\\.rjs$" flymake-ruby-init) flymake-allowed-file-name-masks)
  454. (push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
  455.  
  456. (push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3) flymake-err-line-patterns)
  457.  
  458. (add-hook 'ruby-mode-hook
  459.           '(lambda ()
  460.  
  461.              ;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
  462.              (if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
  463.                  (flymake-mode))
  464.              ))
  465.  
  466. (require 'flymake-jslint)
  467. (add-hook 'javascript-mode-hook
  468.           '(lambda ()
  469.              ;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
  470.              (if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
  471.                  (flymake-mode))
  472.              ))
  473.  
  474.  
  475. ;; Rinari
  476. (add-to-list 'load-path "~/.emacs.d/plugins/rinari")
  477. (require 'rinari)
  478. (setq rinari-tags-file-name "TAGS")
  479.  
  480.  
  481. ;; yasnippet
  482. (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
  483. (require 'yasnippet)
  484. (yas/initialize)
  485. (yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets")
  486. (setq require-final-newline nil)
  487.  
  488. ;; yasnippet rails
  489. (load "~/.emacs.d/plugins/yasnippets-rails/setup.el")
  490.  
  491.  
  492. (add-to-list 'load-path "~/.emacs.d/plugins/autotest")
  493. (require 'autotest)
  494.  
  495.  
  496. ;; rhtml-mode
  497. (add-to-list 'load-path "~/.emacs.d/plugins/rhtml")
  498. (require 'rhtml-mode)
  499. (add-hook 'rhtml-mode-hook
  500.   (lambda () (rinari-launch)))
  501.  
  502. (add-hook 'rhtml-mode
  503.           (let ((original-command (lookup-key rhtml-mode-map [tab])))
  504.             `(lambda ()
  505.                (setq yas/fallback-behavior
  506.                      '(apply ,original-command))
  507.                (local-set-key [tab] 'yas/expand))))
  508.  
  509.  
  510. (add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
  511. (require 'auto-complete-config)
  512. ;(global-auto-complete-mode t)
  513. ;(define-key ac-complete-mode-map "\C-n" 'ac-next)
  514. ;(define-key ac-complete-mode-map "\C-p" 'ac-previous)
  515. ;;     ;; start completion when entered 3 characters
  516. ;(setq ac-auto-start 2)
  517. ;; Add following code to your .emacs.
  518. ;;
  519. ;(define-key ac-complete-mode-map "\t" 'ac-complete)
  520. ;(define-key ac-complete-mode-map "\r" nil)
  521.  
  522.  
  523. ;(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
  524. ; (when (require 'auto-complete nil t)
  525. ;   (require 'auto-complete-yasnippet)
  526. ;   (require 'auto-complete-ruby)
  527. ;   (require 'auto-complete-css)
  528.  
  529.    (global-auto-complete-mode t)           ;enable global-mode
  530.    (setq ac-auto-start t)                  ;automatically start
  531.    (setq ac-dwim 3)                        ;Do what i mean
  532.    (setq ac-override-local-map nil)        ;don't override local map
  533. ;;   (define-key ac-complete-mode-map "\t" 'ac-expand)
  534. ;;   (define-key ac-complete-mode-map "\r" 'ac-complete)
  535. ;;   (define-key ac-complete-mode-map "\M-n" 'ac-next)
  536. ;;   (define-key ac-complete-mode-map "\M-p" 'ac-previous)
  537.    (set-default 'ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer))
  538.  
  539.    (setq ac-modes
  540.          (append ac-modes
  541.                  '(eshell-mode
  542.                    ;org-mode
  543.                    )))
  544.    ;(add-to-list 'ac-trigger-commands 'org-self-insert-command)
  545.  
  546.    (add-hook 'emacs-lisp-mode-hook
  547.              (lambda ()
  548.                (setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-symbols))))
  549.  
  550.    (add-hook 'eshell-mode-hook
  551.              (lambda ()
  552.                (setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-files-in-current-dir ac-source-words-in-buffer))))
  553.  
  554.    (add-hook 'ruby-mode-hook
  555.              (lambda ()
  556.                (setq ac-omni-completion-sources '(("\\.\\=" ac-source-rcodetools)))));)
  557.  
  558.  
  559. ;; ri
  560. ;(load "~/.emacs.d/plugins/ri/ri.el")
  561.  
  562. ;; snippet
  563. ;(add-to-list 'load-path "~/.emacs.d/plugins/snippet")
  564.  
  565. ;; rails-emacs
  566. ;(add-to-list 'load-path "~/.emacs.d/plugins/emacs-rails")
  567. ;(require 'rails)
  568.  
  569. ;(kill-buffer "*ESS*")
  570. ;(kill-buffer "*Compile-Log*")
  571. ;(kill-buffer "*Messages*")
  572.  
  573. (custom-set-faces
  574.   ;; custom-set-faces was added by Custom.
  575.   ;; If you edit it by hand, you could mess it up, so be careful.
  576.   ;; Your init file should contain only one such instance.
  577.   ;; If there is more than one, they won't work right.
  578.  )
RAW Paste Data