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.

97 lines
3.4 KiB

  1. ;;; My basic configuration Gerardo Marx 20/May/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. ;; is-installed function
  10. (defun is-installed (package)
  11. "A function to determine if a packge is installed, otherwise will be installed"
  12. (unless (package-installed-p package)
  13. (package-refresh-contents)
  14. (package-install package)))
  15. ;;+++++++++++++
  16. ;; 1 Very basic emacs configuration:
  17. ;;
  18. (setq initial-frame-alist '((top . 0)(left . 0)
  19. (width . 80)(height . 50)));;frame size
  20. (add-to-list 'default-frame-alist
  21. '(font . "Source Code Pro-16"));; Set default font:
  22. (setq inhibit-startup-message t) ;;inhibit startup message
  23. (tool-bar-mode -1) ;; no toolbar
  24. (menu-bar-mode -1) ;; no menubar
  25. (global-hl-line-mode +1) ;; highlith current line
  26. (delete-selection-mode +1) ;; deletes selected text and replace it
  27. (scroll-bar-mode -1) ;; no scroll bar
  28. (setq ns-right-alternate-modifier nil) ;; right option macos key enable
  29. (fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
  30. (add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
  31. (show-paren-mode +1) ;; show matching parentheses
  32. ;;===========
  33. ;; 2. Packages for Emacs
  34. ;;------------
  35. ;;+++++++++++
  36. ;; 2.1: Doom-themes, all-the-icons and mode-line
  37. (is-installed 'doom-themes) ; install doom-themes
  38. (is-installed 'all-the-icons) ; install beauty icons for emacs
  39. (require 'doom-themes)
  40. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  41. doom-themes-enable-italic t); if nil, italics is universally disabled
  42. (load-theme 'doom-one t) ;default theme
  43. (doom-themes-visual-bell-config);; Enable flashing mode-line on errors
  44. ;; Enable custom neotree theme
  45. (doom-themes-neotree-config) ; all-the-icons fonts must be installed!
  46. (is-installed 'doom-modeline);; Installling doom-modeline:
  47. (require 'doom-modeline) ;loading modeline
  48. (doom-modeline-mode 1);enabling modeline
  49. ;; 2.2 helm
  50. (is-installed 'helm)
  51. (require 'helm-config)
  52. (global-set-key (kbd "M-x") 'helm-M-x)
  53. (global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks)
  54. (global-set-key (kbd "C-x C-f") #'helm-find-files)
  55. (helm-mode 1)
  56. ;; 2.3 which-key: Support to learn emacs keybindings
  57. (is-installed 'which-key)
  58. (require 'which-key)
  59. (which-key-mode)
  60. ;;+++++++
  61. ;;2.4 auctex:
  62. (setq TeX-auto-save t)
  63. (setq TeX-parse-self t)
  64. (setq-default TeX-master nil)
  65. ;;--end----
  66. ;; 2.5 auto-complet:
  67. (is-installed 'auto-complete)
  68. (ac-config-default)
  69. ;; 2.6 ace-window
  70. (is-installed 'ace-window)
  71. (global-set-key (kbd "M-o") 'ace-window)
  72. ;; 2.7 avy
  73. (is-installed 'avy)
  74. (avy-setup-default)
  75. (global-set-key (kbd "M-g f") 'avy-goto-line)
  76. ;; 2.8 multiple-cursors
  77. (is-installed 'multiple-cursors)
  78. (require 'multiple-cursors)
  79. (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
  80. (global-set-key (kbd "C->") 'mc/mark-next-like-this)
  81. (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
  82. (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
  83. (custom-set-variables
  84. ;; custom-set-variables was added by Custom.
  85. ;; If you edit it by hand, you could mess it up, so be careful.
  86. ;; Your init file should contain only one such instance.
  87. ;; If there is more than one, they won't work right.
  88. )
  89. (custom-set-faces
  90. ;; custom-set-faces was added by Custom.
  91. ;; If you edit it by hand, you could mess it up, so be careful.
  92. ;; Your init file should contain only one such instance.
  93. ;; If there is more than one, they won't work right.
  94. )