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.

147 lines
4.7 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. ;; which-key
  27. (is-installed 'which-key)
  28. (require 'which-key)
  29. (which-key-mode)
  30. ;;+++++++++++++
  31. ;; frame size
  32. (setq initial-frame-alist '((top . 0)(left . 0)
  33. (width . 80)(height . 50)))
  34. ;;+++++++++++
  35. ;; Doom-themes, all-the-icons, mode-line and font
  36. (unless (package-installed-p 'doom-themes)
  37. (package-install 'doom-themes))
  38. (unless (package-installed-p 'all-the-icons)
  39. (package-install 'all-the-icons))
  40. (require 'doom-themes)
  41. ;; Global settings (defaults)
  42. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  43. doom-themes-enable-italic t) ; if nil, italics is universally disabled
  44. ;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each
  45. ;; theme may have their own settings.
  46. (load-theme 'doom-one t)
  47. ;; Enable flashing mode-line on errors
  48. (doom-themes-visual-bell-config)
  49. ;; Enable custom neotree theme
  50. (doom-themes-neotree-config) ; all-the-icons fonts must be installed!
  51. ;; Installling doom-modeline:
  52. (unless (package-installed-p 'doom-modeline)
  53. (package-install 'doom-modeline))
  54. (require 'doom-modeline)
  55. (doom-modeline-mode 1)
  56. ;;Intalling all-the-icons font:
  57. (unless (package-installed-p 'all-the-icons)
  58. (package-install 'all-the-icons))
  59. ;; Set default font:
  60. (add-to-list 'default-frame-alist
  61. '(font . "Source Code Pro-24"))
  62. ;;+++++++
  63. ;;auctex:
  64. (setenv "PATH" (concat "/Library/TeX/texbin:"
  65. (getenv "PATH")))
  66. (add-to-list 'exec-path "/Library/TeX/texbin")
  67. (setq TeX-auto-save t)
  68. (setq TeX-parse-self t)
  69. (setq-default TeX-master nil)
  70. ;;--end----
  71. ;;++++++++
  72. ;; emacs startup config
  73. (setq inhibit-startup-message t) ;;inhibit startup
  74. (global-visual-line-mode t)
  75. (tool-bar-mode -1)
  76. (menu-bar-mode -1)
  77. (global-hl-line-mode +1) ;; highlith current line
  78. (delete-selection-mode +1) ;; deletes selected text and replace it
  79. (scroll-bar-mode -1)
  80. (setq ns-right-alternate-modifier nil) ;; right option macos key enable
  81. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  82. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  83. (show-paren-mode +1) ;; show matching parentheses
  84. ;;---------
  85. ;;========
  86. ;;Flyspell
  87. (setq ispell-program-name "/usr/local/bin/aspell")
  88. ;(setq ispell-aspell-data-dir "/usr/local/Cellar/ispell/3.4.04/lib/ispell/")
  89. ;(setq ispell-aspell-dict-dir ispell-aspell-data-dir)
  90. (dolist (hook '(text-mode-hook))
  91. (add-hook hook (lambda () (flyspell-mode 1))))
  92. ;; ==========
  93. ;; ORG files:
  94. (is-installed 'org-ref)
  95. (require 'org-ref)
  96. (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
  97. (setq org-latex-prefer-user-labels t)
  98. ;; ==========
  99. ;; TRMAP
  100. (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
  101. ;;=========
  102. ;;Shell
  103. (setq-default explicit-shell-file-name "/bin/bash")
  104. ;; =========
  105. ;; markdown
  106. (is-installed 'markdown-mode)
  107. (autoload 'markdown-mode "markdown-mode"
  108. "Major mode for editing Markdown files" t)
  109. (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
  110. (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
  111. (autoload 'gfm-mode "markdown-mode"
  112. "Major mode for editing GitHub Flavored Markdown files" t)
  113. (add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))
  114. ;; ========
  115. ;; docker
  116. (is-installed 'docker-compose-mode)
  117. (require 'docker-compose-mode)
  118. ;;========
  119. ;;Neotree
  120. (is-installed 'neotree)
  121. (require 'neotree)
  122. (global-set-key [f8] 'neotree-toggle)
  123. ;;=======
  124. ;; Python completion:
  125. (is-installed 'jedi)
  126. (is-installed 'pyvenv)
  127. ;;(is-installed 'jedi:install-server)
  128. (add-hook 'python-mode-hook 'jedi:setup)
  129. (setq jedi:complete-on-dot t) ; optional
  130. (setq python-shell-interpreter "/usr/local/bin/python3")
  131. (custom-set-variables
  132. ;; custom-set-variables was added by Custom.
  133. ;; If you edit it by hand, you could mess it up, so be careful.
  134. ;; Your init file should contain only one such instance.
  135. ;; If there is more than one, they won't work right.
  136. )
  137. (custom-set-faces
  138. ;; custom-set-faces was added by Custom.
  139. ;; If you edit it by hand, you could mess it up, so be careful.
  140. ;; Your init file should contain only one such instance.
  141. ;; If there is more than one, they won't work right.
  142. )