Added 10 more gists.
This commit is contained in:
1
init.el/README.md
Normal file
1
init.el/README.md
Normal file
@@ -0,0 +1 @@
|
||||
A backup of my init.el file.
|
||||
215
init.el/init.el
Normal file
215
init.el/init.el
Normal file
@@ -0,0 +1,215 @@
|
||||
(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.
|
||||
'(ansi-color-names-vector ["#2e3436" "#a40000" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
|
||||
'(custom-enabled-themes (quote (tango-dark)))
|
||||
'(doc-view-continuous t)
|
||||
'(initial-scratch-message nil)
|
||||
'(menu-bar-mode t)
|
||||
'(org-latex-classes (quote (("book" "\\documentclass{book}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("article" "\\documentclass[11pt]{article}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))
|
||||
'(org-latex-pdf-process (quote ("pdflatex -interaction nonstopmode -output-directory %o %f" "bibtex %b" "pdflatex -interaction nonstopmode -output-directory %o %f" "pdflatex -interaction nonstopmode -output-directory %o %f")))
|
||||
'(org-support-shift-select t)
|
||||
'(tool-bar-mode nil))
|
||||
|
||||
(setq inhibit-startup-message t) ;;; remove splash screen
|
||||
|
||||
;; Add custom scripts to load path.
|
||||
(add-to-list 'load-path "~/.emacs.d/lisp")
|
||||
|
||||
;; Enable Neotree
|
||||
;; (require 'neotree)
|
||||
(setq neo-smart-open t)
|
||||
(global-set-key [f8] 'neotree-toggle)
|
||||
|
||||
(defun switch-full-screen ()
|
||||
(interactive)
|
||||
(shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
|
||||
(global-set-key [f7] 'switch-full-screen)
|
||||
|
||||
;; Highlight matching parens.
|
||||
(show-paren-mode 1)
|
||||
|
||||
;; always show line numbers
|
||||
(global-linum-mode 1)
|
||||
|
||||
;; Enable CUA mode (ctrl + x/c/v cut, copy and paste when something is selected).
|
||||
(cua-mode t)
|
||||
|
||||
(set-face-attribute 'default nil :height 110)
|
||||
|
||||
;; Setup screenwriter mode.
|
||||
(require 'screenwriter)
|
||||
(global-set-key (kbd "C-c s") 'screenwriter-slugline)
|
||||
(global-set-key (kbd "C-c a") 'screenwriter-action-block)
|
||||
(global-set-key (kbd "C-c d") 'screenwriter-dialog-block)
|
||||
(global-set-key (kbd "C-c t") 'screenwriter-transition)
|
||||
|
||||
(setq auto-mode-alist (cons '("\\.scp" . screenwriter-mode) auto-mode-alist))
|
||||
(setq auto-mode-alist (cons '("\\.screenplay" . screenwriter-mode) auto-mode-alist))
|
||||
|
||||
;; Set the files that Org-mode should use for the agenda.
|
||||
(setq org-agenda-files (list "~/Dropbox/Documentos/ORG-Mode/Proyectos_2016.org"
|
||||
"~/Dropbox/Documentos/ORG-Mode/Agenda.org"))
|
||||
|
||||
(setq org-todo-keywords '((type "ON-HOLD" "TODO" "|" "DONE" "CANCELED")))
|
||||
(setq org-todo-keyword-faces
|
||||
'(("ON-HOLD" . "yellow")
|
||||
("CANCELED" . (:foreground "blue" :weight bold))))
|
||||
|
||||
;; Set the base directory for Org-mode.
|
||||
(setq org-directory "~/Dropbox/Documentos/ORG-Mode/")
|
||||
(setq org-mobile-directory "~/Dropbox/Aplicaciones/MobileOrg/")
|
||||
(setq org-mobile-inbox-for-pull "~/Dropbox/Documentos/ORG-Mode/notes.org")
|
||||
(setq org-mobile-files (list "~/Dropbox/Documentos/ORG-Mode/Proyectos_2016.org"
|
||||
"~/Dropbox/Documentos/ORG-Mode/Agenda.org"
|
||||
"~/Dropbox/Documentos/ORG-Mode/Compras.org"))
|
||||
|
||||
(require 'iso-transl)
|
||||
|
||||
(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.
|
||||
)
|
||||
|
||||
;; Set up brainfuck mode
|
||||
(require 'bfbuilder)
|
||||
(add-to-list 'auto-mode-alist '("\\.bf$" . bfbuilder-mode))
|
||||
|
||||
;; Set up Io mode
|
||||
(require 'io-mode)
|
||||
|
||||
;; Set up Org-Mode Babel
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((ditaa . t))) ; this line activates ditaa
|
||||
|
||||
(setq org-ditaa-jar-path (expand-file-name
|
||||
"/usr/share/ditaa/ditaa.jar"))
|
||||
|
||||
(require 'ob-tangle)
|
||||
(require 'ob-sh)
|
||||
(require 'ob-python)
|
||||
(require 'ob-R)
|
||||
(require 'ob-latex)
|
||||
(org-babel-do-load-languages 'org-babel-load-languages '((sh . t) (ditaa . t) (python . t) (R . t) (latex . t) ))
|
||||
|
||||
(setq org-export-allow-BIND t)
|
||||
|
||||
(require 'package) ;; You might already have this line
|
||||
(add-to-list 'package-archives
|
||||
'("melpa" . "https://melpa.org/packages/"))
|
||||
(when (< emacs-major-version 24)
|
||||
;; For important compatibility libraries like cl-lib
|
||||
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
|
||||
(package-initialize) ;; You might already have this line
|
||||
|
||||
(add-hook 'c++-mode-hook 'irony-mode)
|
||||
(add-hook 'c-mode-hook 'irony-mode)
|
||||
(add-hook 'objc-mode-hook 'irony-mode)
|
||||
|
||||
;; replace the `completion-at-point' and `complete-symbol' bindings in
|
||||
;; irony-mode's buffers by irony-mode's asynchronous function
|
||||
(defun my-irony-mode-hook ()
|
||||
(define-key irony-mode-map [remap completion-at-point]
|
||||
'irony-completion-at-point-async)
|
||||
(define-key irony-mode-map [remap complete-symbol]
|
||||
'irony-completion-at-point-async))
|
||||
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
|
||||
|
||||
;; Windows performance tweaks
|
||||
;;
|
||||
(when (boundp 'w32-pipe-read-delay)
|
||||
(setq w32-pipe-read-delay 0))
|
||||
;; Set the buffer size to 64K on Windows (from the original 4K)
|
||||
(when (boundp 'w32-pipe-buffer-size)
|
||||
(setq irony-server-w32-pipe-buffer-size (* 64 1024)))
|
||||
|
||||
;; =============
|
||||
;; company mode
|
||||
;; =============
|
||||
(add-hook 'c++-mode-hook 'company-mode)
|
||||
(add-hook 'c-mode-hook 'company-mode)
|
||||
;; replace the `completion-at-point' and `complete-symbol' bindings in
|
||||
;; irony-mode's buffers by irony-mode's function
|
||||
(defun my-irony-mode-hook ()
|
||||
(define-key irony-mode-map [remap completion-at-point]
|
||||
'irony-completion-at-point-async)
|
||||
(define-key irony-mode-map [remap complete-symbol]
|
||||
'irony-completion-at-point-async))
|
||||
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
|
||||
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
|
||||
(eval-after-load 'company
|
||||
'(add-to-list 'company-backends 'company-irony))
|
||||
;; (optional) adds CC special commands to `company-begin-commands' in order to
|
||||
;; trigger completion at interesting places, such as after scope operator
|
||||
;; std::|
|
||||
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
|
||||
;; =============
|
||||
;; flycheck-mode
|
||||
;; =============
|
||||
(add-hook 'c++-mode-hook 'flycheck-mode)
|
||||
(add-hook 'c-mode-hook 'flycheck-mode)
|
||||
(eval-after-load 'flycheck
|
||||
'(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
|
||||
;; =============
|
||||
;; eldoc-mode
|
||||
;; =============
|
||||
(add-hook 'irony-mode-hook 'irony-eldoc)
|
||||
;; ==========================================
|
||||
;; (optional) bind TAB for indent-or-complete
|
||||
;; ==========================================
|
||||
(defun irony--check-expansion ()
|
||||
(save-excursion
|
||||
(if (looking-at "\\_>") t
|
||||
(backward-char 1)
|
||||
(if (looking-at "\\.") t
|
||||
(backward-char 1)
|
||||
(if (looking-at "->") t nil)))))
|
||||
|
||||
(defun irony--indent-or-complete ()
|
||||
"Indent or Complete"
|
||||
(interactive)
|
||||
(cond ((and (not (use-region-p))
|
||||
(irony--check-expansion))
|
||||
(message "complete")
|
||||
(company-complete-common))
|
||||
(t
|
||||
(message "indent")
|
||||
(call-interactively 'c-indent-line-or-region))))
|
||||
|
||||
(defun irony--indent ()
|
||||
"Irony indent"
|
||||
(interactive)
|
||||
(cond ((and (not (use-region-p))
|
||||
(irony--check-expansion))
|
||||
(message "complete")
|
||||
(company-complete-common))
|
||||
(t
|
||||
(message "Nothing"))))
|
||||
|
||||
(defun irony-mode-keys ()
|
||||
"Modify keymaps used by `irony-mode'."
|
||||
;;(local-set-key (kbd "TAB") 'irony--indent-or-complete)
|
||||
;;(local-set-key [tab] 'irony--indent-or-complete))
|
||||
(local-set-key (kbd "s-SPC") 'irony--indent))
|
||||
;;(global-set-key (kbd "s-SPC") 'irony--indent-or-complete)
|
||||
(add-hook 'c-mode-common-hook 'irony-mode-keys)
|
||||
|
||||
|
||||
(require 'org)
|
||||
(eval-after-load 'ox-latex
|
||||
'(add-to-list 'org-latex-classes
|
||||
'("book"
|
||||
"\\documentclass{book}"
|
||||
("\\part{%s}" . "\\part*{%s}")
|
||||
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||
("\\section{%s}" . "\\section*{%s}")
|
||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||
)
|
||||
Reference in New Issue
Block a user