Skip to content

Instantly share code, notes, and snippets.



Last active Feb 23, 2018
What would you like to do?
Meu arquivo de config do emacs
;; -*- coding: utf-8 -*-
;; custom
;; Atenção: não esquecer de setar a variável HOME do windows para a
;; pasta home do usuário. Caso contrário o "~" não será reconhecido.
(setq frame-title-format "emacs do amaral")
(tool-bar-mode -1)
(scroll-bar-mode -1)
(set-default 'cursor-type 'hbar)
(winner-mode t)
(prefer-coding-system 'utf-8)
;; el-get
;; Nota: não esquecer de remover o (package-initialize) do ~/.emacs
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(goto-char (point-max))
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
(el-get-bundle undo-tree)
(el-get-bundle goto-chg)
;; (el-get 'sync)
;; packages
;; Insight retirado de
;; Talvez deva trocar por
(require 'package)
(setq package-archives '(("gnu" . "")
("marmalade" . "")
("melpa" . "")
("org" . "")))
(line-number-mode 1)
(column-number-mode 1)
(require 'cl)
(defvar packages-list
"List of packages to be installed at launch")
(defun has-package-not-installed ()
(loop for p in packages-list
when (not (package-installed-p p)) do (return t)
finally (return nil)))
(when (has-package-not-installed)
;; Check for new packages (package versions)
(message "%s" "Get latest versions of all packages...")
(message "%s" " done.")
;; install missing packages
(dolist (p packages-list)
(when (not (package-installed-p p))
(package-install p))))
;; org-mode
(setq org-agenda-files '("~/org/"
(define-key global-map "\C-cc" 'org-capture)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-capture-templates '(("t" "Todo [inbox]" entry
(file+headline "~/org/" "Tasks")
"* TODO %i%?")
("T" "Tickler" entry
(file+readline "~/org/" "Agenda")
"* %i \n %U")))
(setq org-todo-keywords
(quote ((sequence "TODO(t)" "DOING(d)" "WAITING(w)" "|" "DONE(o)" "CANCELLED(c)" "DELEGATED(e)")
(sequence "CALL(c)" "INCALL(i)" "|" "CALLED(d)" "CANCELLED(x)"))))
(setq org-enforce-todo-checkbox-dependencies 1)
(setq coding-system-for-read 'utf-8)
(setq org-clock-persist 'history)
(setq org-clock-in-resume t)
(setq org-clock-out-when-done t)
(setq org-log-done 'time)
'((python . t)))
(setq org-confirm-babel-evaluate nil)
(setq org-src-fontify-natively t)
(setq org-agenda-window-setup 'current-window)
(add-to-list 'org-modules "org-habit")
;; Retirado originamente de
(defun my/refile (file headline &optional arg)
(let ((pos (save-excursion
(find-file file)
(org-find-exact-headline-in-buffer headline))))
(org-refile arg nil (list headline file nil pos)))
(switch-to-buffer (current-buffer)))
(defhydra amaral/org-refile-hydra (:foreign-keys run)
("n" (my/refile "" "Próximas ações") "Próximas ações")
("m" (my/refile "" "Talvez um dia") "Talvez um dia")
("a" (my/refile "" "Delegado. Aguardando") "Aguardando")
("l" (my/refile "" "Fila de leitura") "Fila de leitura")
("t" (my/refile "" "Tickler") "Agenda (tickler)")
("p" (my/refile "" "Projetos") "Projetos")
("s" (my/refile "" "Telessaúde") "Telesaúde")
("1" (my/refile "" "12 minutos") "12 minutos")
("e" (my/refile "" "emacs") "emacs")
("j" (my/refile "" "sij-jf") "sij-jf")
("q" nil "cancel"))
(global-set-key (kbd "<f9> r") 'amaral/org-refile-hydra/body)
;; evil
(require 'evil)
(evil-mode 1)
(setq-default evil-escape-key-sequence "fd")
(setq-default evil-escape-delay 0.2)
;; projectile
(define-key global-map (kbd "<f5>") 'projectile-find-file)
;; magit
(if (eq system-type 'windows-nt)
(setq exec-path (add-to-list 'exec-path "C:/Program Files/Git/bin"))
(setenv "PATH" (concat "C:\\Program Files\\Git\\bin;" (getenv "PATH")))))
(define-key global-map (kbd "\C-cgs") 'magit-status)
;; desktop
(require 'desktop)
(desktop-save-mode 1)
(defun my-desktop-save ()
(if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname)))
(add-hook 'auto-save-hook 'my-desktop-save)
;; configuração dos arquivos de save
;; extraído de
(setq backup-directory-alist `(("." . "~/.saves")))
(setq delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
;; org-tree-slide
(require 'org-tree-slide)
(define-key org-mode-map (kbd "<f8>") 'org-tree-slide-mode)
(define-key org-mode-map (kbd "S-<f8>") 'org-tree-slide-skip-done-toggle)
;; tema
(load-theme 'leuven t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.