Skip to content

Instantly share code, notes, and snippets.

@smarky7CD
Last active September 2, 2020 22:23
Show Gist options
  • Save smarky7CD/a2b24e8bf63f654889c6de63c6c921e5 to your computer and use it in GitHub Desktop.
Save smarky7CD/a2b24e8bf63f654889c6de63c6c921e5 to your computer and use it in GitHub Desktop.
My emacs config
;;; package --- Summary
;; Sam A. Markelon (smarky)
;; 08-24-20
;;; Code:
(setq package-enable-at-startup nil)
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; Bootstrap `use-package`
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(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.
'(inhibit-startup-screen t)
'(package-selected-packages
(quote
(rust-mode markdown-mode markdown-preview-mode pdf-tools smex use-package))))
(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.
)
;; cyberpunk theme
;; edited out boxes and strikethrough at ~line 222
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme `cyberpunk-2019 t)
;; Minimal UI
(toggle-scroll-bar -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(add-hook 'prog-mode-hook 'linum-mode)
;; handle back ups correctly
(setq backup-directory-alist `(("." . "~/.saves")))
(setq backup-by-copying t)
(setq delete-old-versions t ;; nitty gritty
kept-new-versions 6
kept-old-versions 2
version-control t)
;; spell check
(defvar ispell-program-name)
(defvar ispell-dictionary)
(setq ispell-program-name "aspell")
(setq ispell-dictionary "english")
;; ido-mode
(progn
;; make buffer switch command do suggestions, also for find-file command
(require 'ido)
(ido-mode 1)
;; show choices vertically
(if (version< emacs-version "25")
(progn
(make-local-variable 'ido-separator)
(setq ido-separator "\n"))
(progn
(make-local-variable 'ido-decorations)
(setf (nth 2 ido-decorations) "\n")))
;; show any name that has the chars you typed
(setq ido-enable-flex-matching t)
;; use current pane for newly opened file
(setq ido-default-file-method 'selected-window)
;; use current pane for newly switched buffer
(setq ido-default-buffer-method 'selected-window)
;; stop ido from suggesting when naming new file
(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil))
;; big minibuffer height, for ido to show choices vertically
(setq max-mini-window-height 0.5)
(require 'ido)
;; stop ido suggestion when doing a save-as
(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)
;;org
;; for agenda
(global-set-key (kbd "C-c a") 'org-agenda)
(setq org-agenda-files (quote ("~/todo.org")))
(setq org-agenda-window-setup (quote current-window))
'(org-todo-keywords (quote ((sequence "TODO(t)" "CANCEL(c)" "DONE(x)"))))
;;capture todo items using C-c c t
(define-key global-map (kbd "C-c c") 'org-capture)
(setq org-capture-templates
'(("t" "todo" entry (file+headline "~/notes/ntodo.org" "todo")
"* TODO %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")))
;; for notes
(defvar org-startup-indented)
(with-eval-after-load 'org
(setq org-startup-indented t)
(add-hook 'org-mode-hook #'visual-line-mode))
(setq org-list-description-max-indent 5)
(setq org-adapt-indentation nil)
;; Tex
(defun turn-on-outline-minor-mode ()
"Toggle outline minor mode to on."
(outline-minor-mode 1))
(defvar TeX-auto-save)
(defvar TeX-parse-self)
(defvar TeX-save-query)
(defvar TeX-PDF-mode)
(defvar outline-minor-mode-prefix)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-save-query nil)
(setq TeX-PDF-mode t)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-buffer)
(add-hook 'LaTeX-mode-hook 'turn-on-outline-minor-mode)
(add-hook 'latex-mode-hook 'turn-on-outline-minor-mode)
(setq outline-minor-mode-prefix "\C-c \C-o")
(provide '.emacs)
;;; .emacs ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment