Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; .emacs --- Initialization file for Emacs
- ;;; Commentary: Emacs Startup File --- initialization for Emacs
- ;; This both loads the archives and sets up use-package to manage my packages
- ;; The packages are then initialized
- (require 'package)
- (setq package-enable-at-startup nil)
- (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
- (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
- (package-initialize)
- (unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
- (eval-when-compile
- (require 'use-package))
- (require 'diminish)
- (package-initialize)
- ;;; Useful Defaults
- (setq-default cursor-type 'bar) ; Line-style cursor similar to other text editors
- (setq inhibit-startup-screen t) ; Disable startup screen
- (setq initial-scratch-message "") ; Make *scratch* buffer blank
- (setq-default frame-title-format '("%b")) ; Make window title the buffer name
- (setq ring-bell-function 'ignore) ; Disable bell sound
- (fset 'yes-or-no-p 'y-or-n-p) ; y-or-n-p makes answering questions faster
- (setq gc-cons-threshold 20000000) ; Allocating more memory, it's the future
- (use-package company ;; Company provides completion for programming languages
- :ensure t
- :diminish company-mode
- :hook (after-init . global-company-mode)
- )
- (use-package flycheck ;; Flycheck is a modern on-the-fly syntax checking extension
- :ensure t
- :diminish flycheck-mode
- :hook (after-init . global-flycheck-mode)
- )
- (use-package flyspell ;; Flyspell enables on-the-fly spell checking in Emacs by the means of a minor mode
- :ensure t
- :hook ((prog-mode . flyspell-prog-mode)
- (prog-mode . flyspell-mode))
- :config
- ;; Sets flyspell correction to use two-finger mouse click
- (define-key flyspell-mouse-map [down-mouse-3] #'flyspell-correct-word)
- )
- (use-package reftex ;; RefTeX is a package for managing Labels, References, Citations and index entries with GNU Emacs.
- :ensure t
- :hook ((LaTex-mode . turn-on-reftex) ;; with AUCTeX LaTex
- (latex-mode . turn-on-reftex)) ;; with Emacs latex mode
- )
- (use-package cdlatex ;; CDLaTeX mode is a minor mode to speed-up insertion of environments and math templates
- :ensure t
- :hook (org-mode . turn-on-org-cdlatex) ;; Enable cdlatex by default
- )
- ;; Adding a spell-checker for english and french
- (use-package guess-language
- :ensure t
- :defer t
- :config
- (setq guess-language-languages '(en fr))
- (setq guess-language-min-paragraph-length 35)
- )
- (add-hook 'text-mode-hook 'auto-fill-mode) ;; Adding autofill on text mode
- (electric-pair-mode 1) ;; Autocomplete paired brackets
- (pdf-tools-install) ;; Adding pdf-tools
- (use-package org-noter ;; Emacs document annotator, using Org-mode.
- :requires (pdf-tools)
- :ensure t
- :defer t
- )
- (with-eval-after-load 'ox-latex ;; Adding a new class called notes which I'll use extensively
- (add-to-list 'org-latex-classes
- '("notes"
- "\\documentclass{article}
- \\usepackage[utf8]{inputenc}
- \\usepackage[T1]{fontenc}
- \\usepackage{libertine}
- \\usepackage{libertinust1math}
- \\usepackage{booktabs}
- \\usepackage{caption}
- \\captionsetup[table]{skip=10pt}
- \\usepackage{soul}
- \\usepackage[usenames,dvipsnames,svgnames]{xcolor}
- \\usepackage{graphicx}
- \\usepackage{hyperref}
- \\hypersetup{
- colorlinks,
- linkcolor={PineGreen!50!black},
- citecolor={DarkGray},
- urlcolor={blue!80!black}}
- \\usepackage{natbib}
- \\usepackage{amssymb}
- \\usepackage{amsmath}
- \\usepackage{geometry}
- \\geometry{a4paper,left=2.5cm,top=0.5cm,right=2.5cm,bottom=1.5cm,marginparsep=7pt, marginparwidth=.6in}"
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
- ("\\paragraph{%s}" . "\\paragraph*{%s}")
- ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
- ;;; Custom set variables and such, removed on this pic for legibility ;;;
- (provide '.emacs)
- ;;; .emacs ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement