This is a basic emacs configuration to work with LaTeX projects. The configuration has been tested on Ubuntu 20.04 LTS.
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.

139 lines
4.5 KiB

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