An Emacs configuration to work with LaTeX, Python, C, C++, Pandoc, Markdown, Slack, and git running natively in different OS like MacOS, ArchLinux, and Ubuntu.
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.

106 lines
3.6 KiB

  1. ;;; My basic configuration Gerardo Marx 20/May/2021
  2. ;; MacOS version
  3. ;;--------
  4. ;; Melpa repository:
  5. (require 'package)
  6. (add-to-list 'package-archives
  7. '("melpa" . "https://melpa.org/packages/")t)
  8. (package-initialize)
  9. ;;+++++++++++++
  10. ;;function to check installed packages:
  11. (defun is-installed (pack)
  12. "Check if a package is istalled"
  13. (unless (package-installed-p pack)
  14. (package-refresh-contents)
  15. (package-install pack)))
  16. ;;++++++++++++++++
  17. ;; use-package
  18. (is-installed 'use-package)
  19. (is-installed 'helm)
  20. (require 'helm-config)
  21. (global-set-key (kbd "M-x") 'helm-M-x)
  22. (global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks)
  23. (global-set-key (kbd "C-x C-f") #'helm-find-files)
  24. (helm-mode 1)
  25. ;;+++++++++++++
  26. ;; frame size
  27. (setq initial-frame-alist '((top . 0)(left . 0)
  28. (width . 80)(height . 50)))
  29. ;;+++++++++++
  30. ;; Doom-themes, all-the-icons, mode-line and font
  31. (unless (package-installed-p 'doom-themes)
  32. (package-install 'doom-themes))
  33. (unless (package-installed-p 'all-the-icons)
  34. (package-install 'all-the-icons))
  35. (require 'doom-themes)
  36. ;; Global settings (defaults)
  37. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  38. doom-themes-enable-italic t) ; if nil, italics is universally disabled
  39. ;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each
  40. ;; theme may have their own settings.
  41. (load-theme 'doom-one t)
  42. ;; Enable flashing mode-line on errors
  43. (doom-themes-visual-bell-config)
  44. ;; Enable custom neotree theme
  45. (doom-themes-neotree-config) ; all-the-icons fonts must be installed!
  46. ;; Installling doom-modeline:
  47. (unless (package-installed-p 'doom-modeline)
  48. (package-install 'doom-modeline))
  49. (require 'doom-modeline)
  50. (doom-modeline-mode 1)
  51. ;;Intalling all-the-icons font:
  52. (unless (package-installed-p 'all-the-icons)
  53. (package-install 'all-the-icons))
  54. ;; Set default font:
  55. (add-to-list 'default-frame-alist
  56. '(font . "Source Code Pro-24"))
  57. ;;+++++++
  58. ;;auctex:
  59. (setenv "PATH" (concat "/Library/TeX/texbin:"
  60. (getenv "PATH")))
  61. (add-to-list 'exec-path "/Library/TeX/texbin")
  62. (setq TeX-auto-save t)
  63. (setq TeX-parse-self t)
  64. (setq-default TeX-master nil)
  65. ;;--end----
  66. ;;++++++++
  67. ;; emacs startup config
  68. (setq inhibit-startup-message t) ;;inhibit startup
  69. (global-visual-line-mode t)
  70. (tool-bar-mode -1)
  71. (menu-bar-mode -1)
  72. (global-hl-line-mode +1) ;; highlith current line
  73. (delete-selection-mode +1) ;; deletes selected text and replace it
  74. (scroll-bar-mode -1)
  75. (setq ns-right-alternate-modifier nil) ;; right option macos key enable
  76. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  77. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  78. (show-paren-mode +1) ;; show matching parentheses
  79. ;;---------
  80. ;;========
  81. ;;Flyspell
  82. (setq ispell-program-name "/usr/local/bin/aspell")
  83. ;(setq ispell-aspell-data-dir "/usr/local/Cellar/ispell/3.4.04/lib/ispell/")
  84. ;(setq ispell-aspell-dict-dir ispell-aspell-data-dir)
  85. (dolist (hook '(text-mode-hook))
  86. (add-hook hook (lambda () (flyspell-mode 1))))
  87. ;; ORG files:
  88. (is-installed 'org-ref)
  89. (require 'org-ref)
  90. (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
  91. (setq org-latex-prefer-user-labels t)
  92. (custom-set-variables
  93. ;; custom-set-variables was added by Custom.
  94. ;; If you edit it by hand, you could mess it up, so be careful.
  95. ;; Your init file should contain only one such instance.
  96. ;; If there is more than one, they won't work right.
  97. )
  98. (custom-set-faces
  99. ;; custom-set-faces was added by Custom.
  100. ;; If you edit it by hand, you could mess it up, so be careful.
  101. ;; Your init file should contain only one such instance.
  102. ;; If there is more than one, they won't work right.
  103. )