Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 8th, 2012  |  syntax: Lisp  |  size: 2.33 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ;http://ess.r-project.org/refcard.pdf
  2. (require 'ess-R-object-tooltip)
  3.  
  4. (setq ess-ask-for-ess-directory nil)
  5. (setq ess-local-process-name "R")
  6. (setq ansi-color-for-comint-mode 'filter)
  7. (setq comint-scroll-to-bottom-on-input t)
  8. (setq comint-scroll-to-bottom-on-output t)
  9. (setq comint-move-point-for-output t)
  10. (defun my-ess-start-R ()
  11.   (interactive)
  12.   (if (not (member "*R*" (mapcar (function buffer-name) (buffer-list))))
  13.       (progn
  14.         (delete-other-windows)
  15.         (setq w1 (selected-window))
  16.         (setq w1name (buffer-name))
  17.         (setq w2 (split-window w1 nil t))
  18.         (R)
  19.         (set-window-buffer w2 "*R*")
  20.         (set-window-buffer w1 w1name))))
  21. (defun my-ess-eval ()
  22.   (interactive)
  23.   (my-ess-start-R)
  24.   (if (and transient-mark-mode mark-active)
  25.       (call-interactively 'ess-eval-region)
  26.     (call-interactively 'ess-eval-line-and-step)))
  27. (add-hook 'ess-mode-hook
  28.           '(lambda()
  29.            (key-chord-define-global "jj" 'my-ess-eval)))
  30. (add-hook 'inferior-ess-mode-hook
  31.           '(lambda()
  32.              (local-set-key [C-up] 'comint-previous-input)
  33.              (local-set-key [C-down] 'comint-next-input)))
  34. (add-hook 'Rnw-mode-hook
  35.           '(lambda()
  36.             (key-chord-define-global "jj" 'my-ess-eval)))
  37. (require 'ess-site)
  38.  
  39. (add-hook 'ess-mode-hook
  40.  (lambda ()
  41.   (ess-set-style 'DEFAULT 'quiet)))
  42.  
  43. (fset 'pdf-run-line-dev
  44.    (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217788 19 112 100 102 13 S-return 21 67108896 21 67108896 S-return 134217790 18 100 101 118 46 111 102 102 13 S-return 21 67108896 21 67108896 21 67108896] 0 "%d")) arg)))
  45.  
  46. (fset 'new-file-graphics
  47.    (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([112 100 102 40 102 105 108 101 61 34 34 left f7 102 25 backspace 112 100 102 right right return return 100 101 118 46 111 102 102 40 up] 0 "%d")) arg)))
  48.  
  49. (define-key ess-mode-map (kbd "C-c j") 'pdf-run-line-dev)
  50. (define-key ess-mode-map (kbd "C-c n") 'new-file-graphics)
  51.  
  52. (require 'r-autoyas)
  53. (add-hook 'ess-mode-hook 'r-autoyas-ess-activate)
  54.  
  55. ;in a pop up information about the objects
  56. (require 'ess-R-object-popup)
  57.  
  58. ;(setq-default ess-dialect "R")
  59. (key-chord-define ess-mode-map "vv" 'ess-R-object-popup)
  60.  
  61. (add-hook 'ess-noweb-mode-hook 'local-set-key "TAB" 'yas-expand)
clone this paste RAW Paste Data