My emacs configuration
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.

260 lines
8.3 KiB

;;; My basic configuration Gerardo Marx 15/Jul/2020
;;--------
;; Melpa repository:
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;; use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; frame size
(setq initial-frame-alist '((top . 10)(left . 20)
(width . 90)(height . 50)))
;; which-key:
(use-package which-key
:ensure t
:config (which-key-mode))
;; doom-themes
(use-package doom-themes
:ensure t
:config
(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
'doom-tomorrow-day t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-colors") ; use the colorful treemacs theme
(doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
;; modeline
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1))
;; icons:
(use-package all-the-icons
:ensure t) ;; --> you need this M-x all-the-icons-install-fonts
;; startup config
(setq inhibit-startup-message t) ;;inhibit startup
(tool-bar-mode -1)
(menu-bar-mode -1)
(global-hl-line-mode +1) ;; highlith current line
(delete-selection-mode +1) ;; deletes selected text and replace it
(scroll-bar-mode -1)
(setq ns-right-alternate-modifier nil) ;; right option macos key enable
(setq backup-directory-alist '(("." . "~/.saves"))) ;; a backup dir to store no saved files
(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
;; helm package:
(use-package helm
:ensure t
:demand t
:bind (("M-x" . helm-M-x)
("C-c h x" . helm-register) ; C-x r SPC and C-x r j
("C-c h g" . helm-google-suggest)
("C-c h M-:" . helm-eval-expression-with-eldoc)
("C-x C-f" . helm-find-files))
:config
(require 'helm-config)
(helm-mode t))
;; projectile:
(use-package projectile
:ensure t
:config
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(projectile-mode t))
;; helm-projectile:
(use-package helm-projectile
:ensure t
:init
(progn
(require 'tramp)
)
:config (helm-projectile-on))
;; temp:
(setq ido-enable-flex-matching t)
;; dash-board:
(use-package dashboard
:ensure t
:init
(progn
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)
(agenda . 5)))
(setq dashboard-banner-logo-title "Welcome gMarx")
(setq dashboard-set-file-icons t)
(setq dashboard-set-init-info t)
(add-to-list 'dashboard-items '(agenda) t)
(setq dashboard-startup-banner 'logo)
)
:config
(dashboard-setup-startup-hook))
;; treemacs
(use-package treemacs
:ensure t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(progn
(setq treemacs-is-never-other-window t)
(setq treemacs-width 35))
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t t" . treemacs)))
;; treemacs-projectile
(use-package treemacs-projectile
:after treemacs projectile
:ensure t)
;; magit
(use-package magit
:ensure t)
;; latex
(use-package auctex
:defer t
:ensure t)
;; pdlatex:
(setq latex-run-command "pdflatex")
(setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/"))
(setq exec-path (append exec-path '("/Library/TeX/texbin/")))
;; Use pdf-tools to open PDF files
(use-package pdf-tools
:ensure nil
:pin melpa
:config
(custom-set-variables
'(pdf-tools-handle-upgrades nil)) ; Use brew upgrade pdf-tools instead.
(setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo"))
;; Use pdf-tools to open PDF files
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
TeX-source-correlate-start-server t)
(add-hook 'LaTeX-mode-hook 'pdf-view-mode)
;; Update PDF buffers after successful LaTeX runs
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)
;; flycheck
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
;; expand region
(use-package expand-region
:ensure t
:bind
("C-=" . er/expand-region)
("C--" . er/contract-region))
;; org-bullets
(use-package org-bullets
:ensure t
:init
(setq org-support-shift-select t)
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
;; Company-mode
(use-package company
:ensure t
:init
(add-hook 'after-init-hook 'global-company-mode))
;; ispell
(dolist (hook '(org-mode-hook latex-mode-hook tex-mode-hook git-commit-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
(setq ispell-dictionary "english")
(setq ispell-program-name "/usr/local/bin/aspell")
;; Set default font:
(add-to-list 'default-frame-alist
'(font . "Source Code Pro-18"))
;; Activatiin ORG-mode
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
;;++++++++++
;; Todo states for ORG:
(setq org-todo-keywords
(quote
((sequence "TODO(t)" "PROGRESS(g)" "PAUSE(p)" "CHECK(k)" "|" "DONE(d)" "CANCELED(c)"))))
(setq org-todo-keyword-faces
'(("PROGRESS" . "orange") ("PAUSE" . "magenta") ("CHECK" . "purple") ("CANCELED" . "red") ("DONE" . "green")))
;; capture:
(setq org-capture-templates
(quote (
("a" ; hotkey
"Academia Todo" ; name
entry ; type
(file+headline "/Users/gmarx/beorg/academia.org" "Tasks") ;target
"* TODO [#B] %^{Task}" ; template
)
("t"
"Task PhD"
entry
(file+datetree "~/beorg/phd.org")
"* TODO [#A] %^{Task}")
("d"
"Students"
item
(file+datetree "~/beorg/students.org")
"- %U - %^{Activity}")
("r"
"to Read"
entry
(file+headline "~/beorg/inbox.org" "to read")
"* TODO %^{topic to read}\n%^{Why to read this?}"
)
("s"
"Schedule an event"
entry
(file+headline "~/beorg/inbox.org" "Scheduled events")
"* %^{Event}\nSCHEDULED: %^t"
)
("k"
"Task inbox"
entry
(file+headline "~/beorg/inbox.org" "Tasks")
"* TODO %^{Task} -> %^{move to}"
)
("c"
"Cheat-Sheet"
entry
(file+headline "~/beorg/cheatsheets.org" "Notes")
"* %^{what solves}\n%^{the commands are}"
)
)))
(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-safe-themes
(quote
("2f1518e906a8b60fac943d02ad415f1d8b3933a5a7f75e307e6e9a26ef5bf570" "fe94e2e42ccaa9714dd0f83a5aa1efeef819e22c5774115a9984293af609fce7" default)))
'(org-agenda-files
(quote
("~/beorg/students.org" "~/beorg/inbox.org" "~/beorg/academia.org")))
'(package-selected-packages
(quote
(pdf-tools company org-bullets expand-region flycheck treemacs-projectile treemacs magit auctex dashboard helm-projectile helm doom-modeline doom-themes which-key use-package projectile)))
'(pdf-tools-handle-upgrades nil)
'(safe-local-variable-values
(quote
((org-attach-directory . "students/")
(org-attach-use-inheritance . t)
(org-attach-preferred-new-method . ask)
(pyvenv-workon . keesman_env)
(org-edit-src-content . 0)
(org-src-preserve-indentation . t)))))
(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.
)