#+TITLE: Emacs Configuration File #+Author: BugGhost * Package configuration ** Melpa Define the melpa respository to packages #+begin_src emacs-lisp (require 'package) (setq package-enable-at-startup nil) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) #+end_src ** Use package Instal the package "use-package" to manager packages in emacs #+begin_src emacs-lisp (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) #+end_src * exclude files Exclude message of error or custom vars of config file #+begin_src emacs-lisp (setq custom-file (locate-user-emacs-file "custom-vars-el")) (load custom-file 'noerror 'nomessage) #+end_src * Customization ** General #+begin_src emacs-lisp (fido-vertical-mode) (menu-bar-mode -1) (tool-bar-mode -1) (setq org-startup-folded t) (recentf-mode) (savehist-mode) (global-hl-line-mode) (global-subword-mode) (global-auto-revert-mode) (save-place-mode) (column-number-mode) (size-indication-mode) (global-visual-line-mode) (delete-selection-mode) (setq use-dialog-box nil) (setq visible-bell t) (setq org-startup-indented t) (setq make-backup-files nil) (setq auto-save-default nil) (setq global-auto-revert-non-file-buffers t) (defalias 'yes-or-no-p 'y-or-n-p) (global-set-key (kbd "C-x k") 'kill-buffer-and-window) (global-set-key "\C-x\ \C-r" 'recentf-open-files) (add-hook 'prog-mode-hook 'display-line-numbers-mode) #+end_src ** Theme #+begin_src emacs-lisp (use-package doom-themes :ensure t :init (load-theme 'doom-solarized-light t) :config (doom-themes-org-config) (doom-themes-visual-bell-config)) #+end_src ** Font #+begin_src emacs-lisp (add-to-list 'default-frame-alist '(font . "JetBrains Mono-14")) #+end_src ** Dashboard #+begin_src emacs-lisp (use-package dashboard :ensure t :init (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) (setq dashboard-startup-banner "~/.emacs.d/icon-emacs.png") (setq dashboard-banner-logo-title "I am just a coder for fun") (setq dashboard-center-content t) (setq dashboard-items '((recents . 5) ;; (bookmarks . 5) (projects . 5) (agenda . 5) ;; (registers . 5) )) :config (dashboard-setup-startup-hook)) #+end_src ** Modeline #+begin_src emacs-lisp (use-package doom-modeline :ensure t :config (doom-modeline-mode) :custom ((doom-modeline-height 15))) #+end_src ** Ansi-color for terminal #+begin_src elisp (require 'ansi-color) (defun colorize-compilation-buffer () (ansi-color-apply-on-region compilation-filter-start (point))) (add-hook 'compilation-filter-hook 'colorize-compilation-buffer) #+end_src * Interface Functions ** Newsticker #+begin_src emacs-lisp (setq newsticker-url-list '(("Bugsswriter Videos" "https://bugswriter.com/videos.xml") ("Muñe" "https://www.youtube.com/feeds/videos.xml?channel_id=UCSKzNn35M7HFzHgxz7OikMA") ("Last Dragon" "https://www.youtube.com/feeds/videos.xml?channel_id=UCllrFdkbcxcuAdzRHj-KSMA") ("Muy Linux" "https://www.muylinux.com/feed/") ("Xataka" "https://www.xataka.com.mx/feedburner.xml"))) #+end_src ** Which key #+begin_src emacs-lisp (use-package which-key :ensure t :init (setq which-key-idle-delay 0.3) :config (which-key-mode)) #+end_src ** Undo tree #+begin_src emacs-lisp (use-package undo-tree :ensure t :config (global-undo-tree-mode)) #+end_src ** Writeroom Delet the disctractions when write. #+begin_src emacs-lisp (use-package writeroom-mode :ensure t) #+end_src ** Rainbow Delimiter Change the color of parentheses and other deleimiters depending of the deep. #+begin_src elisp (use-package rainbow-delimiters :ensure t :hook (prog-mode . rainbow-delimiters-mode)) #+end_src ** Avy #+begin_src emacs-lisp (use-package avy :ensure t :bind ("C-." . avy-goto-char-timer)) #+end_src * COMMENT hs-minor-mode #+begin_src emacs-lisp (add-hook 'c-mode-common-hook 'hs-minor-mode) (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode) (add-hook 'java-mode-hook 'hs-minor-mode) (add-hook 'lisp-mode-hook 'hs-minor-mode) (add-hook 'perl-mode-hook 'hs-minor-mode) (add-hook 'sh-mode-hook 'hs-minor-mode) #+end_src * Develop ** Projectile #+begin_src emacs-lisp (use-package projectile :ensure t :bind ("C-x p" . projectile-command-map) :config (projectile-mode)) #+end_src ** Treemacs #+begin_src emacs-lisp (use-package treemacs :ensure t :bind (("C-c t" . treemacs)) :init (setq treemacs-width 30)) #+end_src ** Magit #+begin_src emacs-lisp (use-package magit :ensure t :init (setq auto-revert-check-vc-info t)) #+end_src ** IDE *** LSP Language Server Protocol is for install support for diferent languages. #+begin_src emacs-lisp (use-package lsp-mode :ensure t :hook ((lsp-mode . lsp-enable-which-key-integration)) :config (setq lsp-completion-enable-additional-text-edit nil)) (use-package lsp-ui :ensure t :hook (lsp-mode . lsp-ui-mode) :custom (lsp-ui-doc-position 'bottom)) #+end_src *** Dap #+begin_src emacs-lisp (use-package dap-mode :after lsp-mode :ensure t :config (dap-auto-configure-mode)) #+end_src *** Company Code completation #+begin_src emacs-lisp (use-package company :ensure t :after lsp-mode :hook (lsp-mode . company-mode) :bind (:map company-active-map ("" . company-complete-selection)) (:map lsp-mode-map ("" . company-indent-or-complete-common)) :custom (company-minimum-prefix-length 1) (company-idle-delay 0.0)) (use-package company-box :ensure t :hook (company-mode . company-box-mode)) #+end_src *** Yasnippet #+begin_src emacs-lisp (use-package yasnippet :ensure t :config (yas-global-mode)) #+end_src *** flycheck #+begin_src emacs-lisp (use-package flycheck :ensure t) #+end_src ** Web *** Web Mode #+begin_src emacs-lisp (use-package web-mode :ensure t :mode (("\\.html?\\'" . web-mode) ("\\.css?\\'" . web-mode)) :init (setq web-mode-markup-indent-offset 2) (setq web-mode-css-indent-offset 2) (setq web-mode-code-indent-offset 2) (setq web-mode-enable-current-element-highlight t) (setq web-mode-enable-current-column-highlight t) :config (web-mode)) #+end_src *** Emmet #+begin_src emacs-lisp (use-package emmet-mode :ensure t :hook (sgml-mode css-mode web-mode) :config (emmet-mode) (emmet-preview-mode)) #+end_src *** Javascript Mode #+begin_src emacs-lisp (use-package js2-mode :ensure t :mode ("\\.js?\\'" . js2-mode) :init (setq js-indent-level 2)) #+end_src *** Live Server #+begin_src emacs-lisp (use-package simple-httpd :ensure t) (use-package impatient-mode :ensure t) #+end_src ** Java *** LSP #+begin_src emacs-lisp (use-package lsp-java :hook ((java-mode . lsp))) #+end_src *** Dap #+begin_src emacs-lisp (use-package dap-java :ensure nil :after (lsp-java)) #+end_src ** COMMENT PlantUML #+begin_src emacs-lisp (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) ; this line activates plantuml (use-package plantuml-mode :ensure t :init (setq plantuml-default-exec-mode 'jar) (setq plantuml-jar-path "/usr/share/plantuml/plantuml.jar") (setq org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar")) (setq org-startup-with-inline-images t) (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))) #+end_src