|
;;; My basic configuration Gerardo Marx 20/May/2021
|
|
;;; Ubuntu version
|
|
;;--------
|
|
;; Melpa repository:
|
|
(require 'package)
|
|
(add-to-list 'package-archives
|
|
'("melpa" . "https://melpa.org/packages/")t)
|
|
(package-initialize)
|
|
;; is-installed function
|
|
(defun is-installed (package)
|
|
"A function to determine if a packge is installed, otherwise will be installed"
|
|
(unless (package-installed-p package)
|
|
(package-refresh-contents)
|
|
(package-install package)))
|
|
;;+++++++++++++
|
|
;; 1 Very basic emacs configuration:
|
|
;;
|
|
(setq initial-frame-alist '((top . 0)(left . 0)
|
|
(width . 80)(height . 50)));;frame size
|
|
(add-to-list 'default-frame-alist
|
|
'(font . "Source Code Pro-16"));; Set default font:
|
|
(setq inhibit-startup-message t) ;;inhibit startup message
|
|
(tool-bar-mode -1) ;; no toolbar
|
|
(menu-bar-mode -1) ;; no menubar
|
|
(global-hl-line-mode +1) ;; highlith current line
|
|
(delete-selection-mode +1) ;; deletes selected text and replace it
|
|
(scroll-bar-mode -1) ;; no scroll bar
|
|
(setq ns-right-alternate-modifier nil) ;; right option macos key enable
|
|
(fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no
|
|
(add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming
|
|
(show-paren-mode +1) ;; show matching parentheses
|
|
;;===========
|
|
;; 2. Packages for Emacs
|
|
;;------------
|
|
;;+++++++++++
|
|
;; 2.1: Doom-themes, all-the-icons and mode-line
|
|
(is-installed 'doom-themes) ; install doom-themes
|
|
(is-installed 'all-the-icons) ; install beauty icons for emacs
|
|
(require 'doom-themes)
|
|
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
|
doom-themes-enable-italic t); if nil, italics is universally disabled
|
|
(load-theme 'doom-one t) ;default theme
|
|
(doom-themes-visual-bell-config);; Enable flashing mode-line on errors
|
|
;; Enable custom neotree theme
|
|
(doom-themes-neotree-config) ; all-the-icons fonts must be installed!
|
|
(is-installed 'doom-modeline);; Installling doom-modeline:
|
|
(require 'doom-modeline) ;loading modeline
|
|
(doom-modeline-mode 1);enabling modeline
|
|
;; 2.2 helm
|
|
(is-installed 'helm)
|
|
(require 'helm-config)
|
|
(global-set-key (kbd "M-x") 'helm-M-x)
|
|
(global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks)
|
|
(global-set-key (kbd "C-x C-f") #'helm-find-files)
|
|
(helm-mode 1)
|
|
;; 2.3 which-key: Support to learn emacs keybindings
|
|
(is-installed 'which-key)
|
|
(require 'which-key)
|
|
(which-key-mode)
|
|
;;+++++++
|
|
;;2.4 auctex:
|
|
(setq TeX-auto-save t)
|
|
(setq TeX-parse-self t)
|
|
(setq-default TeX-master nil)
|
|
;;--end----
|
|
;; 2.5 auto-complet:
|
|
(is-installed 'auto-complete)
|
|
(ac-config-default)
|
|
;; 2.6 ace-window
|
|
(is-installed 'ace-window)
|
|
(global-set-key (kbd "M-o") 'ace-window)
|
|
;; 2.7 avy
|
|
(is-installed 'avy)
|
|
(avy-setup-default)
|
|
(global-set-key (kbd "M-g f") 'avy-goto-line)
|
|
;; 2.8 multiple-cursors
|
|
(is-installed 'multiple-cursors)
|
|
(require 'multiple-cursors)
|
|
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
|
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
|
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
|
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
|
|
|
|
|
|
|
(custom-set-variables
|
|
;; custom-set-variables was added by Custom.
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
;; Your init file should contain only one such instance.
|
|
;; If there is more than one, they won't work right.
|
|
)
|
|
(custom-set-faces
|
|
;; custom-set-faces was added by Custom.
|
|
;; If you edit it by hand, you could mess it up, so be careful.
|
|
;; Your init file should contain only one such instance.
|
|
;; If there is more than one, they won't work right.
|
|
)
|