From f5fd21ad3aa115c5a11a6fec3deaefe9961302dc Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 14 Dec 2019 21:15:56 +0000 Subject: starting from scratch and rebuilding init.el --- bookmarks | 18 ++-- configuration.el | 4 +- configuration.org | 4 +- custom-settings.el | 6 +- init.el | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 267 insertions(+), 21 deletions(-) diff --git a/bookmarks b/bookmarks index 1483780..326c1c7 100644 --- a/bookmarks +++ b/bookmarks @@ -4,17 +4,17 @@ ;;; -*- End Of Bookmark File Format Version Stamp -*- (("org-capture-last-stored-marker" (filename . "~/Nextcloud/org/todo.org") - (front-context-string . "** TODO Look int") - (rear-context-string . " Personal Tasks\n") - (position . 938)) + (front-context-string . "** TODO Sort out") + (rear-context-string . "ily\n* Computing\n") + (position . 101)) ("org-refile-last-stored" (filename . "~/Nextcloud/org/todo.org") - (front-context-string . "** TODO Look int") - (rear-context-string . " Personal Tasks\n") - (position . 938)) + (front-context-string . "** TODO Sort out") + (rear-context-string . "ily\n* Computing\n") + (position . 101)) ("org-capture-last-stored" (filename . "~/Nextcloud/org/todo.org") - (front-context-string . "* TODO Look into") - (rear-context-string . " :caf:\n") - (position . 2800)) + (front-context-string . "* TODO Sort out ") + (rear-context-string . "\n Chunky body.\n") + (position . 4337)) ) \ No newline at end of file diff --git a/configuration.el b/configuration.el index f18f15a..675d12d 100644 --- a/configuration.el +++ b/configuration.el @@ -310,7 +310,7 @@ (setq helm-scroll-amount 5) (setq helm-ff-file-name-history-use-recentf t) -(evil-mode t) +(evil-mode 0) ;; Enable "M-x" in evil mode (global-set-key (kbd "M-x") 'execute-extended-command) @@ -325,7 +325,7 @@ (require 'evil-surround) (global-evil-surround-mode 1) -(global-evil-mc-mode 1) +(global-evil-mc-mode 0) (define-key evil-normal-state-map (kbd "{") 'evil-next-buffer) (define-key evil-normal-state-map (kbd "}") 'evil-prev-buffer) diff --git a/configuration.org b/configuration.org index 3dd0e97..6c0effa 100644 --- a/configuration.org +++ b/configuration.org @@ -568,7 +568,7 @@ with modal editing through semantic commands and Emacs being a LISP REPL. ** Enable Evil #+BEGIN_SRC emacs-lisp - (evil-mode t) + (evil-mode 0) ;; Enable "M-x" in evil mode (global-set-key (kbd "M-x") 'execute-extended-command) #+END_SRC @@ -607,7 +607,7 @@ cursor forward use =C-t= or =grn= and backward =grp=. Finally use *** Enable =evil-mc= for all buffers #+BEGIN_SRC emacs-lisp -(global-evil-mc-mode 1) +(global-evil-mc-mode 0) #+END_SRC ** Fast switching between buffers diff --git a/custom-settings.el b/custom-settings.el index 2ac7b79..460f7b1 100644 --- a/custom-settings.el +++ b/custom-settings.el @@ -9,7 +9,7 @@ ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"]) '(company-quickhelp-color-background "#4F4F4F") '(company-quickhelp-color-foreground "#DCDCCC") - '(custom-enabled-themes (quote (manoj-dark))) + '(custom-enabled-themes nil) '(custom-safe-themes (quote ("8f97d5ec8a774485296e366fdde6ff5589cf9e319a584b845b6f7fa788c9fa9a" default))) @@ -38,10 +38,10 @@ '(nrepl-message-colors (quote ("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3"))) - '(org-sort-agenda-notime-is-late nil) + '(org-sort-agenda-notime-is-late nil t) '(package-selected-packages (quote - (ac-cider magit blacken py-autopep8 flycheck elpy yasnippet company-lsp company lsp-ui go-autocomplete lsp-mode go-mode markdown-mode gruvbox-theme helm org cider slime evil))) + (org-plus-contrib use-package ac-cider magit blacken py-autopep8 flycheck elpy yasnippet company-lsp company lsp-ui go-autocomplete lsp-mode go-mode markdown-mode gruvbox-theme helm org cider slime evil))) '(pdf-view-midnight-colors (quote ("#fdf4c1" . "#282828"))) '(pos-tip-background-color "#36473A") '(pos-tip-foreground-color "#FFFFC8") diff --git a/init.el b/init.el index 649da06..eca18a9 100644 --- a/init.el +++ b/init.el @@ -6,11 +6,257 @@ (if (and (version< emacs-version "26.3") (>= libgnutls-version 30604)) (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) +(require 'package) + +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa")) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages")) + +(setq package-enable-at-startup nil) (package-initialize) -(defun load-config() - "Load the actual configuration in literate 'org-mode' elisp." - (interactive) - (org-babel-load-file "~/.emacs.d/configuration.org")) +;;(load-config) +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(eval-when-compile + (require 'use-package)) + +;; always ensure package +(require 'use-package-ensure) +(setq use-package-always-ensure t) + +;; Deal with history +(setq savehist-file "~/.emacs.d/savehist") +(savehist-mode +1) +(setq savehist-save-minibuffer-history +1) +(setq savehist-additional-vriables + '(kill-ring + search-ring + regexp-search-ring)) + +;; GUI stuff +(scroll-bar-mode -1) +(tool-bar-mode -1) +(tooltip-mode -1) +(menu-bar-mode -1) + +;; Garbage collection +(setq gc-cons-threshold 20000000) + +;; No backup files! +(setq make-backup-files nil) + +;; Put backups in /tmp where they belong +(setq backup-directory-alist + `((".*" . ,temporary-file-directory))) +(setq auto-save-file-name-transforms + `((".*" ,temporary-file-directory t))) + +;; Always follow symlinks +(setq vc-follow-symlinks t) + +;; Confirm before quitting emacs +(setq confirm-kill-emacs 'y-or-n-p) + +;; dired config +;; use current buffer with "a" instead of RET +(put 'dired-find-alternate-file 'disabled nil) + +;; human readable +(setq-default dired-listing-switches "-alh") + +;; recursively copy by default +(setq dired-recursive-copies 'always) + +;; y or n instead of yes or no +(fset 'yes-or-no-p 'y-or-n-p) + +;; auto revert files +(global-auto-revert-mode t) + +;; Inhibit splash +(setq inhibit-splash-screen t) +(setq inhibit-startup-message t) + +;; Display the current time +(display-time-mode t) + +;; Enable narrow region (disabled by default) +(put 'narrow-to-region 'disabled nil) + +;; Enable cursor position when reopening files +(setq save-place-file "~/.emacs.d/saveplace") +(setq-default save-place t) +(require 'saveplace) + +;; Windmove - use Shift and arrow keys to move in windows +(when (fboundp 'windmove-default-keybindings) + (windmove-default-keybindings)) + +;; Winner mode - undo and redo changes in window config +;; with C-c left and C-c right + (when (fboundp 'winner-mode) + (winner-mode 1)) + +;; Don't ring the system bell +(setq visible-bell t) + +;; Use a separation file for custom commands +(setq custom-file "~/.emacs.d/custom-settings.el") +(load custom-file t) + +;; Basic auto-complete +(use-package auto-complete + :config + (ac-config-default)) + + +;; Handling tabs (for programming) +(setq-default tab-width 2) +(setq-default tab-width 2 indent-tabs-mode nil) +(setq-default indent-tabs-mode nil) +(setq js-indent-level 2) +(setq coffee-tab-width 2) +(setq python-indent 2) +(setq css-indent-offset 2) +(add-hook 'sh-mode-hook + (lambda () + (setq sh-basic-offset 2 + sh-indentation 2))) +(setq web-mode-markup-indent-offset 2) + +;; flycheck syntax highlighting +(use-package flycheck + :ensure t + :init (global-flycheck-mode)) + +;; Auto-indent with RET +(define-key global-map (kbd "RET") 'newline-and-indent) + +;; Highlight matching parens +(show-paren-mode t) + +;; Code folding (hide show mode) +;;- zc: Fold +;;- za: Unfold +;;- zR: Unfold everything +(add-hook 'prog-mode-hook #'hs-minor-mode) + +;; Line numbers +(add-hook 'prog-mode-hook '(lambda () + (if (version<= emacs-version "26.0.50") + (linum-mode) + (display-line-numbers-mode)))) + +;; org mode config +(use-package org + :config + (global-set-key "\C-cl" 'org-store-link) + (global-set-key "\C-ca" 'org-agenda) + (global-set-key "\C-cb" 'org-iswitchb) + (global-set-key "\C-cc" 'org-capture) + (setq org-sort-agenda-notime-is-late nil) + (setq org-directory "~/Nextcloud/org") + (setq org-agenda-files '("~/Nextcloud/org")) + (setq org-default-notes-file (concat org-directory "/refile.org")) + (setq diary-file "~/Nextcloud/org/diary") + (setq org-agenda-include-diary t) + (setq org-agenda-skip-deadline-if-done t) + (setq org-reverse-note-order t) + (setq org-sort-agenda-notime-is-late nil) + + (setq org-archive-location "~/Nextcloud/org/archive.org::* From %s") + + (setq org-refile-targets (quote ((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9)))) + + (setq org-agenda-custom-commands + '(("N" "Agenda and NEXT TODOs" ((agenda "") (todo "NEXT"))) + ("y" "Agenda and All TODOS" ((agenda "") (alltodo "") )) + ("w" "Agenda and WAITING" ((agenda "") (todo "WAITING"))) + ("p" "Agenda and PROJECTs" ((agenda "") (todo "PROJECT"))))) + (define-key global-map "\C-cc" 'org-capture) + (setq org-default-notes-file "~/Nextcloud/org/refile.org") + (setq org-capture-templates + (quote (("t" "Todo" entry (file "~/Nextcloud/org/todo.org") + "* TODO %?") + ("j" "Journal" entry (file+datetree "~/Nextcloud/org/journal.org") + "* %?\nEntered on %U\n %i\n %a") + ("e" "Emacs Tip" entry (file+headline "~/Nextcloud/org/emacs-tips.org" "Emacs Tips") + "* %?\n %i\n %a")))) + (setq org-todo-keywords + (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") + (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE" "MEETING" "PROJECT")))) + (setq org-todo-keyword-faces + (quote (("TODO" :foreground "red" :weight bold) + ("NEXT" :foreground "blue" :weight bold) + ("DONE" :foreground "forest green" :weight bold) + ("WAITING" :foreground "orange" :weight bold) + ("HOLD" :foreground "magenta" :weight bold) + ("CANCELLED" :foreground "forest green" :weight bold) + ("MEETING" :foreground "forest green" :weight bold) + ("PROJECT" :foreground "OrangeRed2" :weight bold) + ("PHONE" :foreground "forest green" :weight bold)))) + + ;; tag stuff automatically dependent on a change of state + (setq org-todo-state-tags-triggers + (quote (("CANCELLED" ("CANCELLED" . t)) + ("WAITING" ("WAITING" . t)) + ("HOLD" ("WAITING") ("HOLD" . t)) + (done ("WAITING") ("HOLD")) + ("TODO" ("WAITING") ("CANCELLED") ("HOLD")) + ("NEXT" ("WAITING") ("CANCELLED") ("HOLD")) + ("DONE" ("WAITING") ("CANCELLED") ("HOLD"))))) + + (setq org-priority-faces + '((?A . (:foreground "#CC0000" :background "#FFE3E3")) + (?B . (:foreground "#64992C" :background "#EBF4DD")) + (?C . (:foreground "#64992C" :background "#FFFFFF")))) + + (setq org-ellipsis "...") + ) + +;; Interactively Do Things (ido) +(use-package ido + :config + (ido-mode t) + (ido-everywhere t) + (setq ido-emable-flex-matching t)) + +;; Python programming +(use-package elpy + :ensure py-autopep8 + :config + (add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save) + (setq python-shell-interpreter "ptipython" + python-shell-interpreter-args "console --simple-prompt" + python-shell-prompt-detect-failure-warning nil) + (add-to-list 'python-shell-completion-native-disabled-interpreters + "ptipython") + + (when (require 'flycheck nil t) + (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) + (add-hook 'elpy-mode-hook 'flycheck-mode))) + +;; Go programming +(use-package lsp-mode + :hook (go-mode . lsp-deferred) + :commands (lsp lsp-deferred) + :config + (add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode))) + +(use-package lsp-ui + :hook (lsp-mode-hook . lsp-ui-mode) + :commands lsp-ui-mode + :init) + +(use-package yasnippet + :commands yas-minor-mode + :hook (go-mode . yas-minor-mode)) -(load-config) +(setq lsp-ui-doc-enable nil + lsp-ui-peek-enable t + lsp-ui-sideline-enable t + lsp-ui-imenu-enable t + lsp-ui-flycheck-enable t) -- cgit v1.2.3