My emacs configuration
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.

192 lines
5.9 KiB

4 years ago
  1. ;;; My basic configuration Gerardo Marx 15/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. ;; which-key:
  12. (use-package which-key
  13. :ensure t
  14. :config (which-key-mode))
  15. ;; doom-themes
  16. (use-package doom-themes
  17. :ensure t
  18. :config
  19. (load-theme 'doom-one t)
  20. ;; Enable flashing mode-line on errors
  21. (doom-themes-visual-bell-config)
  22. ;; Enable custom neotree theme (all-the-icons must be installed!)
  23. (doom-themes-neotree-config)
  24. ;; or for treemacs users
  25. (setq doom-themes-treemacs-theme "doom-colors") ; use the colorful treemacs theme
  26. (doom-themes-treemacs-config)
  27. ;; Corrects (and improves) org-mode's native fontification.
  28. (doom-themes-org-config))
  29. ;; modeline
  30. (use-package doom-modeline
  31. :ensure t
  32. :init (doom-modeline-mode 1))
  33. ;; icons:
  34. (use-package all-the-icons
  35. :ensure t) ;; --> you need this M-x all-the-icons-install-fonts
  36. ;; startup config
  37. (setq inhibit-startup-message t) ;;inhibit startup
  38. (tool-bar-mode -1)
  39. (menu-bar-mode -1)
  40. (global-hl-line-mode +1) ;; highlith current line
  41. (delete-selection-mode +1) ;; deletes selected text and replace it
  42. (scroll-bar-mode -1)
  43. (setq ns-right-alternate-modifier nil) ;; right option macos key enable
  44. (setq backup-directory-alist '(("." . "~/.saves"))) ;; a backup dir to store no saved files
  45. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  46. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  47. (show-paren-mode +1) ;; show matching parentheses
  48. ;; helm package:
  49. (use-package helm
  50. :ensure t
  51. :demand t
  52. :bind (("M-x" . helm-M-x)
  53. ("C-c h x" . helm-register) ; C-x r SPC and C-x r j
  54. ("C-c h g" . helm-google-suggest)
  55. ("C-c h M-:" . helm-eval-expression-with-eldoc)
  56. ("C-x C-f" . helm-find-files))
  57. :config
  58. (require 'helm-config)
  59. (helm-mode t))
  60. ;; projectile:
  61. (use-package projectile
  62. :ensure t
  63. :config
  64. (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
  65. (projectile-mode t))
  66. ;; helm-projectile:
  67. (use-package helm-projectile
  68. :ensure t
  69. :init
  70. (progn
  71. (require 'tramp)
  72. )
  73. :config (helm-projectile-on))
  74. ;; temp:
  75. (setq ido-enable-flex-matching t)
  76. ;; dash-board:
  77. (use-package dashboard
  78. :ensure t
  79. :init
  80. (progn
  81. (setq dashboard-items '((recents . 5)
  82. (bookmarks . 5)
  83. (projects . 5)
  84. (agenda . 5)))
  85. (setq dashboard-banner-logo-title "Welcome gMarx")
  86. (setq dashboard-set-file-icons t)
  87. (setq dashboard-set-init-info t)
  88. (add-to-list 'dashboard-items '(agenda) t)
  89. (setq dashboard-startup-banner 'logo)
  90. )
  91. :config
  92. (dashboard-setup-startup-hook))
  93. ;; treemacs
  94. (use-package treemacs
  95. :ensure t
  96. :init
  97. (with-eval-after-load 'winum
  98. (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
  99. :config
  100. (progn
  101. (setq treemacs-is-never-other-window t)
  102. (setq treemacs-width 35))
  103. :bind
  104. (:map global-map
  105. ("M-0" . treemacs-select-window)
  106. ("C-x t t" . treemacs)))
  107. ;; treemacs-projectile
  108. (use-package treemacs-projectile
  109. :after treemacs projectile
  110. :ensure t)
  111. ;; magit
  112. (use-package magit
  113. :ensure t)
  114. ;; latex
  115. (use-package auctex
  116. :defer t
  117. :ensure t)
  118. ;; pdlatex:
  119. (setq latex-run-command "pdflatex")
  120. (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/"))
  121. (setq exec-path (append exec-path '("/Library/TeX/texbin/")))
  122. ;; Use pdf-tools to open PDF files
  123. ;; (use-package pdf-tools
  124. ;; :ensure t
  125. ;; :pin melpa
  126. ;; :config
  127. ;; (custom-set-variables
  128. ;; '(pdf-tools-handle-upgrades nil)) ; Use brew upgrade pdf-tools instead.
  129. ;; (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo"))
  130. (use-package doc-view
  131. :defer t
  132. :custom
  133. ;; Use MikTeX's utilities for PDF conversion and searching
  134. (doc-view-pdf->png-converter-function 'doc-view-pdf->png-converter-ghostscript))
  135. ;; (setq TeX-view-program-selection '((output-pdf "Preview.app")))
  136. ;; Update PDF buffers after successful LaTeX runs
  137. ;; (add-hook 'TeX-PDF-mode-hook 'pdf-view-mode)
  138. ;; (add-hook 'TeX-after-compilation-finished-functions
  139. ;; 'TeX-revert-document-buffer)
  140. ;; flycheck
  141. (use-package flycheck
  142. :ensure t
  143. :init (global-flycheck-mode))
  144. ;; expand region
  145. (use-package expand-region
  146. :ensure t
  147. :bind
  148. ("C-=" . er/expand-region)
  149. ("C--" . er/contract-region))
  150. ;; org-bullets
  151. (use-package org-bullets
  152. :ensure t
  153. :init
  154. (setq org-support-shift-select t)
  155. :config
  156. (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
  157. ;; Company-mode
  158. (use-package company
  159. :ensure t
  160. :init
  161. (add-hook 'after-init-hook 'global-company-mode))
  162. ;; ispell
  163. (dolist (hook '(org-mode-hook latex-mode-hook tex-mode-hook git-commit-mode-hook))
  164. (add-hook hook (lambda () (flyspell-mode 1))))
  165. (setq ispell-dictionary "english")
  166. (setq ispell-program-name "/usr/local/bin/aspell")
  167. ;; Set default font:
  168. (add-to-list 'default-frame-alist
  169. '(font . "Source Code Pro-18"))
  170. (custom-set-variables
  171. ;; custom-set-variables was added by Custom.
  172. ;; If you edit it by hand, you could mess it up, so be careful.
  173. ;; Your init file should contain only one such instance.
  174. ;; If there is more than one, they won't work right.
  175. '(custom-safe-themes
  176. (quote
  177. ("2f1518e906a8b60fac943d02ad415f1d8b3933a5a7f75e307e6e9a26ef5bf570" "fe94e2e42ccaa9714dd0f83a5aa1efeef819e22c5774115a9984293af609fce7" default)))
  178. '(package-selected-packages
  179. (quote
  180. (company org-bullets expand-region flycheck treemacs-projectile treemacs magit auctex dashboard helm-projectile helm doom-modeline doom-themes which-key use-package projectile)))
  181. '(safe-local-variable-values
  182. (quote
  183. ((pyvenv-workon . keesman_env)
  184. (org-edit-src-content . 0)
  185. (org-src-preserve-indentation . t)))))
  186. (custom-set-faces
  187. ;; custom-set-faces was added by Custom.
  188. ;; If you edit it by hand, you could mess it up, so be careful.
  189. ;; Your init file should contain only one such instance.
  190. ;; If there is more than one, they won't work right.
  191. )