Initial commit
This commit is contained in:
7
elisp/bibtex-setup.el
Normal file
7
elisp/bibtex-setup.el
Normal file
@@ -0,0 +1,7 @@
|
||||
(setq bibtex-entry-format
|
||||
`(page-dashes required-fields
|
||||
numerical-fields whitespace last-comma delimiters
|
||||
unify-case sort-fields))
|
||||
|
||||
(setq bibtex-field-delimiters 'double-quotes)
|
||||
(setq bibtex-entry-delimiters 'braces)
|
||||
17
elisp/custom.el
Normal file
17
elisp/custom.el
Normal file
@@ -0,0 +1,17 @@
|
||||
(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
|
||||
("67e998c3c23fe24ed0fb92b9de75011b92f35d3e89344157ae0d544d50a63a72" default)))
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(counsel ivy-bibtex org-bullets paredit zenburn-theme slime rust-mode racket-mode polymode org lua-mode haskell-mode geiser ergoemacs-mode djvu auctex))))
|
||||
(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.
|
||||
)
|
||||
15
elisp/extras.el
Normal file
15
elisp/extras.el
Normal file
@@ -0,0 +1,15 @@
|
||||
;; set default font
|
||||
(when (member "Fantasque Sans Mono" (font-family-list))
|
||||
(set-face-attribute 'default nil :font "Fantasque Sans Mono-15"))
|
||||
|
||||
;; load my packages
|
||||
(require 'geiser)
|
||||
|
||||
;; load my custom setups
|
||||
(load "~/.emacs.d/elisp/org-setup.el")
|
||||
;(load "~/.emacs.d/elisp/slime-setup.el")
|
||||
(load "~/.emacs.d/elisp/polymode-setup.el")
|
||||
(load "~/.emacs.d/elisp/outline-keymap.el")
|
||||
(load "~/.emacs.d/elisp/bibtex-setup.el")
|
||||
(load "~/.emacs.d/elisp/ivy-setup.el")
|
||||
;(load "~/.emacs.d/elisp/geiser-setup.el")
|
||||
27
elisp/ivy-setup.el
Normal file
27
elisp/ivy-setup.el
Normal file
@@ -0,0 +1,27 @@
|
||||
;; Enable ivy completion everywhere
|
||||
(ivy-mode 1)
|
||||
|
||||
;; Begginer configuration
|
||||
(setq ivy-use-virtual-buffers t)
|
||||
(setq ivy-count-format "(%d/%d) ")
|
||||
|
||||
(global-set-key (kbd "C-s") 'swiper)
|
||||
(global-set-key (kbd "M-x") 'counsel-M-x)
|
||||
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
|
||||
;(global-set-key (kbd "<f1> f") 'counsel-describe-function)
|
||||
;(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
|
||||
;(global-set-key (kbd "<f1> l") 'counsel-find-library)
|
||||
;(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
|
||||
;(global-set-key (kbd "<f2> u") 'counsel-unicode-char)
|
||||
|
||||
;; ivy-bibtex
|
||||
(setq bibtex-completion-bibliography
|
||||
'("~/repos/notabug/pesquisa/memory.bib"))
|
||||
;; where are the pdfs
|
||||
(setq bibtex-completion-library-path
|
||||
'("~/repos/notabug/pesquisa/memory"))
|
||||
;; where is the notes
|
||||
(setq bibtex-completion-notes-path "~/repos/notabug/paper_notes.org")
|
||||
;; some handy visual markers
|
||||
(setq bibtex-completion-pdf-symbol "⌘")
|
||||
(setq bibtex-completion-notes-symbol "✎")
|
||||
15
elisp/keypad.el
Normal file
15
elisp/keypad.el
Normal file
@@ -0,0 +1,15 @@
|
||||
;; number pad keys
|
||||
|
||||
(global-set-key (kbd "<kp-decimal>") 'other-window)
|
||||
(global-set-key (kbd "<kp-0>") 'delete-window)
|
||||
(global-set-key (kbd "<kp-1>") 'delete-other-windows)
|
||||
(global-set-key (kbd "<kp-2>") 'split-window-below)
|
||||
(global-set-key (kbd "<kp-3>") 'xah-open-file-at-cursor)
|
||||
|
||||
(global-set-key (kbd "<kp-subtract>") 'xah-close-current-buffer)
|
||||
(global-set-key (kbd "<kp-divide>") 'xah-previous-user-buffer)
|
||||
(global-set-key (kbd "<kp-multiply>") 'xah-next-user-buffer)
|
||||
|
||||
;; with control key down
|
||||
(global-set-key (kbd "<C-kp-divide>") 'xah-previous-emacs-buffer)
|
||||
(global-set-key (kbd "<C-kp-multiply>") 'xah-next-emacs-buffer)
|
||||
126
elisp/org-bullets.el
Normal file
126
elisp/org-bullets.el
Normal file
@@ -0,0 +1,126 @@
|
||||
;;; org-bullets.el --- Show bullets in org-mode as UTF-8 characters
|
||||
;;; Version: 0.2.4
|
||||
;;; Author: sabof
|
||||
;;; URL: https://github.com/sabof/org-bullets
|
||||
|
||||
;; This file is NOT part of GNU Emacs.
|
||||
;;
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU General Public License as
|
||||
;; published by the Free Software Foundation; either version 3, or (at
|
||||
;; your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful, but
|
||||
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;; General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program ; see the file COPYING. If not, write to
|
||||
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; The project is hosted at https://github.com/sabof/org-bullets
|
||||
;; The latest version, and all the relevant information can be found there.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'cl))
|
||||
|
||||
(defgroup org-bullets nil
|
||||
"Display bullets as UTF-8 characters"
|
||||
:group 'org-appearance)
|
||||
|
||||
;; A nice collection of unicode bullets:
|
||||
;; http://nadeausoftware.com/articles/2007/11/latency_friendly_customized_bullets_using_unicode_characters
|
||||
(defcustom org-bullets-bullet-list
|
||||
'(;;; Large
|
||||
"◉"
|
||||
"○"
|
||||
"✸"
|
||||
"✿"
|
||||
;; ♥ ● ◇ ✚ ✜ ☯ ◆ ♠ ♣ ♦ ☢ ❀ ◆ ◖ ▶
|
||||
;;; Small
|
||||
;; ► • ★ ▸
|
||||
)
|
||||
"This variable contains the list of bullets.
|
||||
It can contain any number of symbols, which will be repeated."
|
||||
:group 'org-bullets
|
||||
:type '(repeat (string :tag "Bullet character")))
|
||||
|
||||
(defcustom org-bullets-face-name nil
|
||||
"This variable allows the org-mode bullets face to be
|
||||
overridden. If set to a name of a face, that face will be
|
||||
used. Otherwise the face of the heading level will be used."
|
||||
:group 'org-bullets
|
||||
:type 'symbol)
|
||||
|
||||
(defvar org-bullets-bullet-map
|
||||
'(keymap
|
||||
(mouse-1 . org-cycle)
|
||||
(mouse-2
|
||||
. (lambda (e)
|
||||
(interactive "e")
|
||||
(mouse-set-point e)
|
||||
(org-cycle))))
|
||||
"Mouse events for bullets.
|
||||
Should this be undesirable, one can remove them with
|
||||
|
||||
\(setcdr org-bullets-bullet-map nil\)")
|
||||
|
||||
(defun org-bullets-level-char (level)
|
||||
(string-to-char
|
||||
(nth (mod (1- level)
|
||||
(length org-bullets-bullet-list))
|
||||
org-bullets-bullet-list)))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode org-bullets-mode
|
||||
"UTF8 Bullets for org-mode"
|
||||
nil nil nil
|
||||
(let* (( keyword
|
||||
`(("^\\*+ "
|
||||
(0 (let* (( level (- (match-end 0) (match-beginning 0) 1))
|
||||
( is-inline-task
|
||||
(and (boundp 'org-inlinetask-min-level)
|
||||
(>= level org-inlinetask-min-level))))
|
||||
(compose-region (- (match-end 0) 2)
|
||||
(- (match-end 0) 1)
|
||||
(org-bullets-level-char level))
|
||||
(when is-inline-task
|
||||
(compose-region (- (match-end 0) 3)
|
||||
(- (match-end 0) 2)
|
||||
(org-bullets-level-char level)))
|
||||
(when (facep org-bullets-face-name)
|
||||
(put-text-property (- (match-end 0)
|
||||
(if is-inline-task 3 2))
|
||||
(- (match-end 0) 1)
|
||||
'face
|
||||
org-bullets-face-name))
|
||||
(put-text-property (match-beginning 0)
|
||||
(- (match-end 0) 2)
|
||||
'face (list :foreground
|
||||
(face-attribute
|
||||
'default :background)))
|
||||
(put-text-property (match-beginning 0)
|
||||
(match-end 0)
|
||||
'keymap
|
||||
org-bullets-bullet-map)
|
||||
nil))))))
|
||||
(if org-bullets-mode
|
||||
(progn
|
||||
(font-lock-add-keywords nil keyword)
|
||||
(font-lock-fontify-buffer))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(font-lock-remove-keywords nil keyword)
|
||||
(while (re-search-forward "^\\*+ " nil t)
|
||||
(decompose-region (match-beginning 0) (match-end 0)))
|
||||
(font-lock-fontify-buffer))
|
||||
)))
|
||||
|
||||
(provide 'org-bullets)
|
||||
|
||||
;;; org-bullets.el ends here
|
||||
67
elisp/org-setup.el
Normal file
67
elisp/org-setup.el
Normal file
@@ -0,0 +1,67 @@
|
||||
;; The following lines are always needed. Choose your own keys.
|
||||
;; Org mode keys
|
||||
(global-set-key "\C-cl" 'org-store-link)
|
||||
(global-set-key "\C-ca" 'org-agenda)
|
||||
(global-set-key "\C-cc" 'org-capture)
|
||||
(global-set-key "\C-cb" 'org-iswitchb)
|
||||
|
||||
;; org publish
|
||||
(require 'ox-publish)
|
||||
(setq org-publish-project-alist
|
||||
'(("org-notes"
|
||||
:base-directory "~/org/"
|
||||
:base-extension "org"
|
||||
:publishing-directory "~/html/"
|
||||
:recursive t
|
||||
:publishing-function org-html-publish-to-html
|
||||
:headline-leves 4 ;Just the default for this project.
|
||||
:with-toc nil
|
||||
:section-numbers nil
|
||||
:with-author f
|
||||
:with-creator nil
|
||||
:with-date nil
|
||||
:with-timestamps nil
|
||||
:with-tage nil
|
||||
|
||||
:html-preamble nil
|
||||
:html-postamble nil
|
||||
:html-validation-link f
|
||||
:html-doctype "html5"
|
||||
)
|
||||
|
||||
("org-static"
|
||||
:base-directory "~/org/"
|
||||
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg"
|
||||
:publishing-directory "~/html/"
|
||||
:recursive t
|
||||
:publishing-function org-publish-attachment
|
||||
)
|
||||
|
||||
("org" :components ("org-notes" "org-static"))))
|
||||
|
||||
;; some config for org-babel
|
||||
(setq org-confirm-babel-evaluate nil
|
||||
org-src-fontify-natively t
|
||||
org-src-tab-acts-natively t)
|
||||
|
||||
;;load languages babel
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((clojure . t)
|
||||
(emacs-lisp . t)
|
||||
(haskell . t)
|
||||
(scheme . t)
|
||||
(shell . t)))
|
||||
|
||||
;;bullets in org-mode
|
||||
(require 'org-bullets)
|
||||
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
|
||||
|
||||
;; default apps to open files with org-mode
|
||||
(setq org-file-apps
|
||||
(quote
|
||||
((auto-mode . emacs)
|
||||
("\\.mm\\'" . default)
|
||||
("\\.x?html?\\'" . "seamonkey")
|
||||
("\\.pdf\\'" . "mupdf %s")
|
||||
("\\.djvu\\'" . "djview %s"))))
|
||||
10
elisp/outline-keymap.el
Normal file
10
elisp/outline-keymap.el
Normal file
@@ -0,0 +1,10 @@
|
||||
; Outline-minor-mode key map
|
||||
(define-prefix-command 'cm-map nil "Outline-")
|
||||
; HIDE
|
||||
(define-key cm-map "t" 'hide-body) ; Hide everything but headings (all body lines)
|
||||
(define-key cm-map "c" 'hide-entry) ; Hide this entry's body
|
||||
; SHOW
|
||||
(define-key cm-map "a" 'show-all) ; Show (expand) everything
|
||||
(define-key cm-map "e" 'show-entry) ; Show this heading's body
|
||||
|
||||
(global-set-key "\M-o" cm-map)
|
||||
6
elisp/polymode-setup.el
Normal file
6
elisp/polymode-setup.el
Normal file
@@ -0,0 +1,6 @@
|
||||
(require 'poly-c)
|
||||
|
||||
;; C
|
||||
(add-to-list 'auto-mode-alist '("\\.nw$" . poly-noweb+c-mode))
|
||||
|
||||
(provide 'polymode-configuration)
|
||||
98
elisp/settings.el
Normal file
98
elisp/settings.el
Normal file
@@ -0,0 +1,98 @@
|
||||
;; Write custom set variables to different file
|
||||
(setq custom-file "~/.emacs.d/elisp/custom.el")
|
||||
|
||||
;; Set my color theme
|
||||
(load-theme 'zenburn t)
|
||||
|
||||
;; Set default encoding
|
||||
(setq current-language-environment "UTF-8")
|
||||
|
||||
;; Always do syntax highlighting
|
||||
(global-font-lock-mode 1)
|
||||
|
||||
;; Also highlight parens
|
||||
(setq show-paren-delay 0
|
||||
show-paren-style 'parenthesis)
|
||||
(show-paren-mode 1)
|
||||
|
||||
;; This is the binary name of my scheme implementation
|
||||
(setq scheme-program-name "racket")
|
||||
|
||||
;; C default style
|
||||
(add-hook 'c-mode-hook
|
||||
(lambda ()
|
||||
(c-set-style "linux")))
|
||||
|
||||
;; Adding MELPA
|
||||
(when (>= emacs-major-version 24)
|
||||
(require 'package)
|
||||
(add-to-list
|
||||
'package-archives
|
||||
'("melpa" . "http://melpa.org/packages/")
|
||||
'("gnu" . "http://elpa.gnu.org/packages/"))
|
||||
(package-initialize))
|
||||
(put 'erase-buffer 'disabled nil)
|
||||
|
||||
;; remove trailing white spaces before saving
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
||||
;; disable bars
|
||||
(tool-bar-mode -1)
|
||||
;(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
|
||||
;; disable cursor blinking
|
||||
(setq blink-cursor-mode nil)
|
||||
|
||||
;; collumn numbers
|
||||
(column-number-mode 1)
|
||||
|
||||
;;fix deadkeys
|
||||
(require 'iso-transl)
|
||||
(prefer-coding-system 'utf-8)
|
||||
(set-default-coding-systems 'utf-8)
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
(setq default-input-method "latin-1-prefix")
|
||||
(defun my-set-default-input-method ()
|
||||
(set-input-method 'latin-1-prefix))
|
||||
(add-hook 'text-mode-hook 'my-set-default-input-method)
|
||||
|
||||
;; default fill-region size
|
||||
(setq-default fill-column 80)
|
||||
|
||||
;; stop creating ~ files
|
||||
(setq make-backup-files nil)
|
||||
|
||||
; Makes *scratch* empty.
|
||||
(setq initial-scratch-message "")
|
||||
|
||||
;; Removes *scratch* from buffer after the mode has been set.
|
||||
(defun remove-scratch-buffer ()
|
||||
(if (get-buffer "*scratch*")
|
||||
(kill-buffer "*scratch*")))
|
||||
(add-hook 'after-change-major-mode-hook 'remove-scratch-buffer)
|
||||
|
||||
;; Removes *messages* from the buffer.
|
||||
;;(setq-default message-log-max nil)
|
||||
;;(kill-buffer "*Messages*")
|
||||
|
||||
;; Removes *Completions* from buffer after you've opened a file.
|
||||
(add-hook 'minibuffer-exit-hook
|
||||
'(lambda ()
|
||||
(let ((buffer "*Completions*"))
|
||||
(and (get-buffer buffer)
|
||||
(kill-buffer buffer)))))
|
||||
|
||||
;; Don't show *Buffer list* when opening multiple files at the same time.
|
||||
(setq inhibit-startup-buffer-menu t)
|
||||
|
||||
;; Show only one active window when opening multiple files at the same time.
|
||||
(add-hook 'window-setup-hook 'delete-other-windows)
|
||||
|
||||
;; No more typing the whole yes or no. Just y or n will do.
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;; Make seamonkey available for use
|
||||
(setq browse-url-browser-function 'browse-url-generic
|
||||
browse-url-generic-program "seamonkey")
|
||||
3
elisp/slime-setup.el
Normal file
3
elisp/slime-setup.el
Normal file
@@ -0,0 +1,3 @@
|
||||
;;slime setup
|
||||
(setq inferior-lisp-program "/usr/local/bin/sbcl")
|
||||
(setq slime-contribs '(slime-fancy))
|
||||
Reference in New Issue
Block a user