The scientific-emacs a container-based in Debian:Focal version with emacs 26, and a light version of TeXlive.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
6.2 KiB

  1. ;;; My basic configuration Gerardo Marx 31/Jul/2020
  2. ;;--------
  3. ;; Melpa repository:
  4. (require 'package)
  5. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
  6. (package-initialize)
  7. ;; use-package
  8. (unless (package-installed-p 'use-package)
  9. (package-refresh-contents)
  10. (package-install 'use-package))
  11. ;; frame size at start
  12. (setq initial-frame-alist '((top . 10)(left . 20)
  13. (width . 80)(height . 40)))
  14. ;; which-key:
  15. (use-package which-key
  16. :ensure t
  17. :config (which-key-mode))
  18. ;; doom-themes
  19. (use-package doom-themes
  20. :ensure t
  21. :config
  22. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  23. doom-themes-enable-italic t) ; if nil, italics is universally disabled
  24. (load-theme ;'doom-one
  25. 'doom-monokai-pro t) ;'doom-tomorrow-day
  26. ;; Enable flashing mode-line on errors
  27. (doom-themes-visual-bell-config)
  28. ;; Enable custom neotree theme (all-the-icons must be installed!)
  29. (doom-themes-neotree-config)
  30. ;; or for treemacs users
  31. (setq doom-themes-treemacs-theme "doom-colors") ; use the colorful treemacs theme
  32. (doom-themes-treemacs-config)
  33. ;; Corrects (and improves) org-mode's native fontification.
  34. (doom-themes-org-config))
  35. ;; modeline
  36. (use-package doom-modeline
  37. :ensure t
  38. :init (doom-modeline-mode 1))
  39. ;; icons:
  40. (use-package all-the-icons
  41. :ensure t) ;; --> you need this M-x all-the-icons-install-fonts
  42. ;; helm package:
  43. (use-package helm
  44. :ensure t
  45. :demand t
  46. :bind (("M-x" . helm-M-x)
  47. ("C-c h x" . helm-register) ; C-x r SPC and C-x r j
  48. ("C-c h g" . helm-google-suggest)
  49. ("C-c h M-:" . helm-eval-expression-with-eldoc)
  50. ("C-x C-f" . helm-find-files))
  51. :config
  52. (require 'helm-config)
  53. (helm-mode t))
  54. ;; projectile:
  55. (use-package projectile
  56. :ensure t
  57. :config
  58. (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
  59. (projectile-mode t))
  60. ;; helm-projectile:
  61. (use-package helm-projectile
  62. :after projectile
  63. :ensure t
  64. :init
  65. (require 'tramp)
  66. :config
  67. (helm-projectile-on))
  68. ;; temp:
  69. (setq ido-enable-flex-matching t)
  70. ;; dash-board:
  71. (use-package dashboard
  72. :ensure t
  73. :init
  74. (progn
  75. (setq dashboard-items '((recents . 5)
  76. (bookmarks . 5)
  77. (projects . 5)
  78. ;;(agenda . 5)
  79. ))
  80. (setq dashboard-banner-logo-title "Welcome to Scientific-Emacs")
  81. (setq dashboard-set-file-icons t)
  82. (setq dashboard-set-init-info t)
  83. (setq dashboard-startup-banner 'logo)
  84. )
  85. :config
  86. (dashboard-setup-startup-hook))
  87. ;; magit
  88. (use-package magit
  89. :ensure t)
  90. ;; expand region
  91. (use-package expand-region
  92. :ensure t
  93. :bind
  94. ("C-=" . er/expand-region)
  95. ("C--" . er/contract-region))
  96. ;; latex
  97. (use-package tex
  98. :defer t
  99. :ensure auctex
  100. :init
  101. (progn
  102. (setq-default TeX-master nil) ; Query for master file.
  103. (setq TeX-auto-save t) ; Enable parse on save.
  104. (setq TeX-save-query nil)
  105. ;;(setq TeX-command-force "LaTex")
  106. (setq latex-run-command "pdflatex")
  107. (setq TeX-parse-self t) ; Enable parse on load.
  108. (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/"))
  109. (setq exec-path (append exec-path '("/Library/TeX/texbin/")))
  110. ;; pdf-tools configuration
  111. (setq TeX-PDF-mode t)
  112. (add-hook 'TeX-after-compilation-finished-functions
  113. #'TeX-revert-document-buffer)
  114. (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
  115. TeX-source-correlate-start-server t)
  116. (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo")
  117. (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))
  118. (add-hook 'pdf-view-mode-hook
  119. (lambda () (pdf-tools-enable-minor-modes)))
  120. (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)
  121. )
  122. :config
  123. (add-hook 'LaTeX-mode-hook
  124. (lambda ()
  125. ;;(rainbow-delimiters-mode)
  126. ;;(company-mode)
  127. ;;(smartparens-mode)
  128. (turn-on-reftex)
  129. (setq reftex-plug-into-AUCTeX t)
  130. (reftex-isearch-minor-mode)
  131. (setq TeX-PDF-mode t)
  132. (setq TeX-source-correlate-method 'synctex)
  133. (setq TeX-source-correlate-start-server t)))
  134. )
  135. ;; pdf-tools
  136. (use-package pdf-tools
  137. :ensure t
  138. :pin melpa
  139. :magic ("%PDF" . pdf-view-mode)
  140. :config
  141. (custom-set-variables
  142. '(pdf-tools-handle-upgrades nil))
  143. )
  144. ;; -+-+-+-+-+-+-+
  145. ;; startup config
  146. (setq inhibit-startup-message t) ;;inhibit startup
  147. (show-paren-mode 1) ;; parenthesis match
  148. (tool-bar-mode -1) ;; no tool-bar
  149. (menu-bar-mode -1) ;; menu-bar disable
  150. (global-hl-line-mode +1) ;; highlith current line
  151. (delete-selection-mode +1) ;; deletes selected text and replace it
  152. (scroll-bar-mode -1)
  153. ;; Set default font:
  154. (add-to-list 'default-frame-alist
  155. '(font . "DejaVu Sans Mono-16"))
  156. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  157. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  158. ;; rextex
  159. (use-package reftex
  160. :ensure t
  161. :defer t
  162. :config
  163. (setq reftex-cite-prompt-optional-args t)); Prompt for empty optional arguments in cite
  164. ;; Company-mode
  165. (use-package company
  166. :ensure t
  167. :init
  168. (add-hook 'after-init-hook 'global-company-mode))
  169. ;; ispell
  170. (dolist (hook '(org-mode-hook latex-mode-hook tex-mode-hook git-commit-mode-hook))
  171. (add-hook hook (lambda () (flyspell-mode 1))))
  172. ;;(setq ispell-dictionary "en")
  173. (setq ispell-program-name "/usr/bin/aspell")
  174. ;;-+-+-+-+-+-+-+-
  175. (custom-set-variables
  176. ;; custom-set-variables was added by Custom.
  177. ;; If you edit it by hand, you could mess it up, so be careful.
  178. ;; Your init file should contain only one such instance.
  179. ;; If there is more than one, they won't work right.
  180. '(custom-safe-themes
  181. (quote
  182. ("3c2f28c6ba2ad7373ea4c43f28fcf2eed14818ec9f0659b1c97d4e89c99e091e" "8d7684de9abb5a770fbfd72a14506d6b4add9a7d30942c6285f020d41d76e0fa" "990e24b406787568c592db2b853aa65ecc2dcd08146c0d22293259d400174e37" "bf387180109d222aee6bb089db48ed38403a1e330c9ec69fe1f52460a8936b66" default)))
  183. '(package-selected-packages (quote (org-pdftools use-package)))
  184. '(pdf-tools-handle-upgrades nil))
  185. (custom-set-faces
  186. ;; custom-set-faces was added by Custom.
  187. ;; If you edit it by hand, you could mess it up, so be careful.
  188. ;; Your init file should contain only one such instance.
  189. ;; If there is more than one, they won't work right.
  190. )