User:Timothee Flutre/Notebook/Postdoc/2012/07/25

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(Autocreate 2012/07/25 Entry for User:Timothee_Flutre/Notebook/Postdoc)
(Entry title: first version)
Line 6: Line 6:
| colspan="2"|
| colspan="2"|
<!-- ##### DO NOT edit above this line unless you know what you are doing. ##### -->
<!-- ##### DO NOT edit above this line unless you know what you are doing. ##### -->
-
==Entry title==
+
==About Emacs==
-
* Insert content here...
+
 +
* '''Motivation''': when analyzing data for any research project, it's essential to know well a good text editor. Indeed, it's very efficient to be able to program in several languages (eg. Python, C/C++, R), interact with the shell like in a terminal, manipulate data and plot exploratory analyzes in R, [[all this within the same editor]]. One such editor is [http://en.wikipedia.org/wiki/Emacs Emacs], and is available on Linux, Mac OS and Windows.
 +
 +
* '''Configuration''': my own file <nowiki>.emacs</nowiki>
 +
 +
<nowiki>
 +
;; .emacs
 +
 +
(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.
 +
'(case-fold-search t)
 +
'(column-number-mode t)
 +
'(current-language-environment "UTF-8")
 +
'(default-input-method "rfc1345")
 +
'(global-font-lock-mode t nil (font-lock))
 +
'(show-paren-mode t))
 +
(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.
 +
)
 +
 +
(setq inhibit-startup-message t)
 +
 +
;; config for C/C++ code
 +
(setq c-default-style "bsd"
 +
          c-basic-offset 2
 +
          tab-width 2
 +
          indent-tabs-mode t)
 +
 +
(setq latex-run-command "pdflatex")
 +
 +
(add-to-list 'load-path "~/.emacs.d/")
 +
 +
;;--------------------------------------------------------------------
 +
 +
;; START config Auto-Complete
 +
(require 'auto-complete-config)
 +
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
 +
(ac-config-default)
 +
;; END config Auto-Complete
 +
 +
;;--------------------------------------------------------------------
 +
 +
;; START config ESS
 +
(add-to-list 'load-path "~/src/Emacs_ESS/ess-5.13/lisp")
 +
(require 'ess-site)
 +
 +
;; tips from http://emacswiki.org/emacs/EmacsSpeaksStatistics
 +
(setq ess-eval-visibly-p nil) ;otherwise C-c C-r (eval region) takes forever
 +
(setq ess-ask-for-ess-directory nil) ;otherwise you are prompted each time you start an interactive R session
 +
;; END config ESS
 +
 +
;;--------------------------------------------------------------------
 +
 +
;; START config AUCTeX
 +
(load "/home/tflutre/src/LATEX_PKGS/AUCTEX/auctex.el" nil t t)
 +
(load "/home/tflutre/src/LATEX_PKGS/AUCTEX/preview-latex.el" nil t t)
 +
(add-to-list 'load-path "/home/tflutre/src/LATEX_PKGS/AUCTEX")
 +
(setq TeX-auto-save t)
 +
(setq TeX-parse-self t)
 +
(setq-default TeX-master nil)
 +
(setq TeX-save-query nil)
 +
(setq TeX-PDF-mode t) ;; to have a pdf output for all LaTeX documents
 +
;; END config AUCTeX
 +
 +
;;--------------------------------------------------------------------
 +
 +
;; START config org-mode
 +
(setq load-path (cons "/home/tflutre/src/ORG-MODE/org-7.8.03/lisp" load-path))
 +
(setq load-path (cons "/home/tflutre/src/ORG-MODE/org-7.8.03/contrib/lisp" load-path))
 +
(require 'org-install)
 +
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
 +
(global-set-key "\C-cl" 'org-store-link)
 +
(global-set-key "\C-cc" 'org-capture)
 +
(global-set-key "\C-ca" 'org-agenda)
 +
(global-set-key "\C-cb" 'org-iswitchb)
 +
(org-babel-do-load-languages
 +
'org-babel-load-languages
 +
'((R . t)
 +
  (sh . t)
 +
  (python . t)
 +
  ))
 +
(setq org-confirm-babel-evaluate nil)
 +
(require 'org-latex)
 +
(add-to-list 'org-export-latex-packages-alist '("" "listings"))
 +
(setq org-export-latex-listings-options
 +
      '(("breaklines")))
 +
(setq org-log-done 'time)
 +
;; END config org-mode
 +
</nowiki>
 +
 +
* '''Important packages''':
 +
** [http://ess.r-project.org/ ESS]
 +
** [http://cx4a.org/software/auto-complete/ Auto-Complete]
 +
** [http://orgmode.org/) org-mode]
 +
** [http://www.gnu.org/software/auctex/ AUCTeX]
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->

Revision as of 11:29, 25 July 2012

Project name Main project page
Previous entry      Next entry

About Emacs

  • Motivation: when analyzing data for any research project, it's essential to know well a good text editor. Indeed, it's very efficient to be able to program in several languages (eg. Python, C/C++, R), interact with the shell like in a terminal, manipulate data and plot exploratory analyzes in R, all this within the same editor. One such editor is Emacs, and is available on Linux, Mac OS and Windows.
  • Configuration: my own file .emacs
;; .emacs

(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.
 '(case-fold-search t)
 '(column-number-mode t)
 '(current-language-environment "UTF-8")
 '(default-input-method "rfc1345")
 '(global-font-lock-mode t nil (font-lock))
 '(show-paren-mode t))
(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.
 )

(setq inhibit-startup-message t)

;; config for C/C++ code
(setq c-default-style "bsd"
          c-basic-offset 2
          tab-width 2
          indent-tabs-mode t)

(setq latex-run-command "pdflatex")

(add-to-list 'load-path "~/.emacs.d/")

;;--------------------------------------------------------------------

;; START config Auto-Complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
(ac-config-default)
;; END config Auto-Complete

;;--------------------------------------------------------------------

;; START config ESS
(add-to-list 'load-path "~/src/Emacs_ESS/ess-5.13/lisp")
(require 'ess-site)

;; tips from http://emacswiki.org/emacs/EmacsSpeaksStatistics
(setq ess-eval-visibly-p nil) ;otherwise C-c C-r (eval region) takes forever
(setq ess-ask-for-ess-directory nil) ;otherwise you are prompted each time you start an interactive R session
;; END config ESS

;;--------------------------------------------------------------------

;; START config AUCTeX
(load "/home/tflutre/src/LATEX_PKGS/AUCTEX/auctex.el" nil t t)
(load "/home/tflutre/src/LATEX_PKGS/AUCTEX/preview-latex.el" nil t t)
(add-to-list 'load-path "/home/tflutre/src/LATEX_PKGS/AUCTEX")
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq TeX-save-query nil)
(setq TeX-PDF-mode t) ;; to have a pdf output for all LaTeX documents
;; END config AUCTeX

;;--------------------------------------------------------------------

;; START config org-mode
(setq load-path (cons "/home/tflutre/src/ORG-MODE/org-7.8.03/lisp" load-path))
(setq load-path (cons "/home/tflutre/src/ORG-MODE/org-7.8.03/contrib/lisp" load-path))
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (sh . t)
   (python . t)
   ))
(setq org-confirm-babel-evaluate nil)
(require 'org-latex)
(add-to-list 'org-export-latex-packages-alist '("" "listings"))
(setq org-export-latex-listings-options
      '(("breaklines")))
(setq org-log-done 'time)
;; END config org-mode


Personal tools