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.

137 lines
4.3 KiB

3 years ago
  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/bin/aspell")
  78. (dolist (hook '(text-mode-hook))
  79. (add-hook hook (lambda () (flyspell-mode 1))))
  80. ;; ==========
  81. ;; ORG files:
  82. (is-installed 'org-ref)
  83. (require 'org-ref)
  84. (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
  85. (setq org-latex-prefer-user-labels t)
  86. ;; ==========
  87. ;; TRMAP
  88. (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
  89. ;;=========
  90. ;;Shell
  91. (setq-default explicit-shell-file-name "/bin/bash")
  92. ;; =========
  93. ;; markdown
  94. (is-installed 'markdown-mode)
  95. (autoload 'markdown-mode "markdown-mode"
  96. "Major mode for editing Markdown files" t)
  97. (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
  98. (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
  99. (autoload 'gfm-mode "markdown-mode"
  100. "Major mode for editing GitHub Flavored Markdown files" t)
  101. (add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))
  102. ;; ========
  103. ;;Neotree
  104. (is-installed 'neotree)
  105. (require 'neotree)
  106. (global-set-key [f8] 'neotree-toggle)
  107. ;;====================
  108. ;; emacs startup config
  109. (setq inhibit-startup-message nil) ;;inhibit startup
  110. (global-visual-line-mode t)
  111. (tool-bar-mode -1)
  112. (menu-bar-mode -1)
  113. (global-hl-line-mode +1) ;; highlith current line
  114. (delete-selection-mode +1) ;; deletes selected text and replace it
  115. (scroll-bar-mode -1)
  116. (setq ns-right-alternate-modifier nil) ;; right option macos key enable
  117. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  118. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  119. (show-paren-mode +1) ;; show matching parentheses
  120. ;;---------
  121. (custom-set-variables
  122. ;; custom-set-variables was added by Custom.
  123. ;; If you edit it by hand, you could mess it up, so be careful.
  124. ;; Your init file should contain only one such instance.
  125. ;; If there is more than one, they won't work right.
  126. )
  127. (custom-set-faces
  128. ;; custom-set-faces was added by Custom.
  129. ;; If you edit it by hand, you could mess it up, so be careful.
  130. ;; Your init file should contain only one such instance.
  131. ;; If there is more than one, they won't work right.
  132. )