Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 4.28 KB | None | 0 0
  1. ;;; .emacs --- Initialization file for Emacs
  2. ;;; Commentary: Emacs Startup File --- initialization for Emacs
  3.  
  4.  
  5. ;; This both loads the archives and sets up use-package to manage my packages
  6. ;; The packages are then initialized
  7.  
  8. (require 'package)
  9.  
  10. (setq package-enable-at-startup nil)
  11. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
  12. (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
  13. (package-initialize)
  14.  
  15. (unless (package-installed-p 'use-package)
  16.   (package-refresh-contents)
  17.   (package-install 'use-package))
  18.  
  19. (eval-when-compile
  20.   (require 'use-package))
  21.  
  22. (require 'diminish)
  23.  
  24. (package-initialize)
  25.  
  26.  
  27. ;;; Useful Defaults
  28.  
  29. (setq-default cursor-type 'bar)           ; Line-style cursor similar to other text editors
  30. (setq inhibit-startup-screen t)           ; Disable startup screen
  31. (setq initial-scratch-message "")         ; Make *scratch* buffer blank
  32. (setq-default frame-title-format '("%b")) ; Make window title the buffer name
  33. (setq ring-bell-function 'ignore)         ; Disable bell sound
  34. (fset 'yes-or-no-p 'y-or-n-p)             ; y-or-n-p makes answering questions faster
  35. (setq gc-cons-threshold 20000000)         ; Allocating more memory, it's the future
  36.  
  37.  
  38.  
  39. (use-package company        ;; Company provides completion for programming languages
  40.   :ensure t
  41.   :diminish company-mode
  42.   :hook (after-init . global-company-mode)
  43.   )
  44.  
  45. (use-package flycheck       ;; Flycheck is a modern on-the-fly syntax checking extension
  46.   :ensure t
  47.   :diminish flycheck-mode
  48.   :hook (after-init . global-flycheck-mode)
  49. )
  50.  
  51.  
  52.  
  53. (use-package flyspell       ;; Flyspell enables on-the-fly spell checking in Emacs by the means of a minor mode
  54.   :ensure t
  55.   :hook ((prog-mode . flyspell-prog-mode)
  56.      (prog-mode . flyspell-mode))
  57.   :config
  58.   ;; Sets flyspell correction to use two-finger mouse click
  59.   (define-key flyspell-mouse-map [down-mouse-3] #'flyspell-correct-word)
  60.   )
  61.  
  62.  
  63.  
  64. (use-package reftex                          ;; RefTeX is a package for managing Labels, References, Citations and index entries with GNU Emacs.
  65.   :ensure t
  66.   :hook ((LaTex-mode . turn-on-reftex)       ;; with AUCTeX LaTex
  67.      (latex-mode . turn-on-reftex))      ;; with Emacs latex mode
  68.   )
  69.  
  70. (use-package cdlatex                         ;; CDLaTeX mode is a minor mode to speed-up insertion of environments and math templates
  71.   :ensure t
  72.   :hook (org-mode . turn-on-org-cdlatex)     ;; Enable cdlatex by default
  73.   )
  74.  
  75.  
  76. ;; Adding a spell-checker for english and french
  77.  
  78. (use-package guess-language
  79.   :ensure t
  80.   :defer t
  81.   :config
  82.           (setq guess-language-languages '(en fr))
  83.       (setq guess-language-min-paragraph-length 35)
  84. )
  85.  
  86.  
  87.  
  88. (add-hook 'text-mode-hook 'auto-fill-mode)    ;; Adding autofill on text mode
  89.  
  90. (electric-pair-mode 1)                        ;; Autocomplete paired brackets
  91.  
  92. (pdf-tools-install)                           ;; Adding pdf-tools
  93.  
  94.  
  95. (use-package org-noter                        ;; Emacs document annotator, using Org-mode.
  96.   :requires (pdf-tools)
  97.   :ensure t
  98.   :defer t
  99. )
  100.  
  101. (with-eval-after-load 'ox-latex               ;; Adding a new class called notes which I'll use extensively
  102.   (add-to-list 'org-latex-classes
  103.            '("notes"
  104.          "\\documentclass{article}
  105. \\usepackage[utf8]{inputenc}
  106. \\usepackage[T1]{fontenc}
  107. \\usepackage{libertine}
  108. \\usepackage{libertinust1math}
  109. \\usepackage{booktabs}
  110. \\usepackage{caption}
  111. \\captionsetup[table]{skip=10pt}
  112. \\usepackage{soul}
  113. \\usepackage[usenames,dvipsnames,svgnames]{xcolor}
  114. \\usepackage{graphicx}
  115. \\usepackage{hyperref}
  116. \\hypersetup{
  117.    colorlinks,
  118.    linkcolor={PineGreen!50!black},
  119.    citecolor={DarkGray},
  120.    urlcolor={blue!80!black}}
  121. \\usepackage{natbib}
  122. \\usepackage{amssymb}
  123. \\usepackage{amsmath}
  124. \\usepackage{geometry}
  125. \\geometry{a4paper,left=2.5cm,top=0.5cm,right=2.5cm,bottom=1.5cm,marginparsep=7pt, marginparwidth=.6in}"
  126.                ("\\section{%s}" . "\\section*{%s}")
  127.                ("\\subsection{%s}" . "\\subsection*{%s}")
  128.                ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  129.                ("\\paragraph{%s}" . "\\paragraph*{%s}")
  130.                ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
  131.  
  132.  
  133. ;;; Custom set variables and such, removed on this pic for legibility ;;;
  134.  
  135. (provide '.emacs)
  136.  
  137. ;;; .emacs ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement