@@ -1,5 +1,5 @@
#+TITLE: Emacs Configuration
#+AUTHOR: Mitch Tishmack
#+AUTHOR: Mitchell Tishmack
#+STARTUP: hidestars
#+STARTUP: odd
#+BABEL: :cache yes
@@ -23,8 +23,16 @@ Setup the builtin emacs package manager.
(package-initialize)
#+END_SRC
Add in standard package archive urls. Marmalade is gone as its ssl cert expired
in 2018, so don't think its even worth using.
This is out of place but to catch the gui elements early.
#+BEGIN_SRC emacs-lisp
(tool-bar-mode -1)
(scroll-bar-mode -1)
(when (not (window-system))
(menu-bar-mode -1))
#+END_SRC
Add in standard package archive urls. Marmalade is gone as its ssl cert expired in 2018, so don't think its even worth using.
#+BEGIN_SRC emacs-lisp
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
@@ -37,8 +45,7 @@ in 2018, so don't think its even worth using.
Duplicated from tangle.el just to make using org easier.
TODO: make this stuff work sanely in emacs org mode and
via external tangling. Not tangled for now.
TODO: make this stuff work sanely in emacs org mode and via external tangling. Not tangled for now.
#+BEGIN_SRC emacs-lisp
(defun tangle/yn (p) (if (bound-and-true-p p) "yes" "no"))
@@ -60,10 +67,18 @@ via external tangling. Not tangled for now.
*** use-package bootstrap
This configuration is using *use-package* extensively. Install it earlyso we can use it elsewhere.
This configuration is using *use-package* extensively. Install it early so we can
use it elsewhere.
First strip out any existing org load-path prior to package initialization.
#+BEGIN_SRC emacs-lisp
(require 'cl)
(setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) load-path))
(setq load-path (remove-if (lambda (x) (string-match-p "org-" x)) load-path))
#+END_SRC
#+BEGIN_SRC emacs-lisp
(package-refresh-contents)
(unless (package-installed-p 'use-package)
(progn
(package-refresh-contents)
@@ -74,18 +89,23 @@ This configuration is using *use-package* extensively. Install it earlyso we can
(setq use-package-verbose t)
#+END_SRC
*** TODO test diminish updates :validation:
Then, before doing *ANY* package initialization, make use-package setup/use org
from the package repos and pin it so that other packages can't muck that up.
#+BEGIN_SRC emacs-lisp
(use-package org
:ensure org-plus-contrib
:pin org)
#+END_SRC
*** auto-package-update
Keep the mode line less cluttered with crap from modes I don't care about.
Make updating use-package installed package.el packages easy peasy .
#+BEGIN_SRC emacs-lisp
(use-package diminish
(use-package auto-package-update
:ensure t
:config
(diminish 'flyspell-mode)
(diminish 'whitespace-mode)
(diminish 'visual-line-mode)
)
:defer t)
#+END_SRC
*** match end of string function
@@ -104,7 +124,7 @@ Keep the mode line less cluttered with crap from modes I don't care about.
Not having to start *emacs* with *--debug-init* is useful.
#+BEGIN_SRC emacs-lisp
(setq debug-on-error t)
(setq-default debug-on-error t)
#+END_SRC
*** emacs server
@@ -118,10 +138,14 @@ Start up the emacs server if it isn't running.
*** theme
Solarized light is decent. I'll just use that. Note, to prevent flicker this is setup early in startup.
Sick of solarized, going back to good old black on white minimalism like paper.
TODO: Maybe get this to go dark automagically?
#+BEGIN_SRC emacs-lisp
(use-package solarized-theme :ensure t :init (load-theme 'solarized-light 't))
(use-package minimal-theme
:ensure t
:config (load-theme 'minimal-light t))
#+END_SRC
*** os detection
@@ -146,6 +170,7 @@ Like the startup screen and the echo hooey.
'(inhibit-startup-screen t)
'(inhibit-startup-message t)
'(inhibit-startup-echo-area-message t)
'(initial-scratch-message nil)
)
#+END_SRC
@@ -237,8 +262,10 @@ So if we don't know, call it text-mode.
utf8 is the best. Default to it.
#+BEGIN_SRC emacs-lisp
(use-package unicode-escape :ensure t)
(set-language-environment "UTF-8")
(use-package unicode-escape
:init
(set-language-environment "UTF-8")
:ensure t)
#+END_SRC
#+BEGIN_SRC emacs-lisp
@@ -273,6 +300,27 @@ computers.
(set-default 'sentence-end-double-space nil)
#+END_SRC
*** long line speedups
Improve the performance of emacs with files that contain long lines. Disable
left to right and right to left in the same buffer support. Until or if I learn
a language that needs this I can deal with it then.
#+BEGIN_SRC emacs-lisp
(setq-default bidi-paragraph-direction 'left-to-right)
#+END_SRC
Also disable this algorithm, which may unbalance ()'s in bidirectional language
detection. But again as I don't use/speak/read them. Ok tradeoff.
#+BEGIN_SRC emacs-lisp
(if (version<= "27.1" emacs-version)
((setq bidi-inhibit-bpa t)
(global-so-long-mode 1)))
#+END_SRC
Ref: https://200ok.ch/posts/2020-09-29_comprehensive_guide_on_handling_long_lines_in_emacs.html
*** sentence end
Semi related to the above, make the sentence endings a bit more code-ish.
@@ -310,6 +358,10 @@ Customize whitespace mode to make tabs obvious as boxes, and to highlight lines
(set-face-attribute 'whitespace-line nil
:foreground "#2075c7"
:background "lightgrey")
(add-hook 'prog-mode 'whitespace-mode)
(add-hook 'prog-mode 'hl-line-mode)
(add-hook 'prog-mode 'visual-line-mode)
#+END_SRC
*** uncategorized
@@ -409,24 +461,25 @@ Global key bindings.
)
#+END_SRC
* appearance
*** gui
When i'm running in a terminal emacs, most of this junk isn't needed. For that matter gui counts for most.
Basically, never show the tool bar or the scroll bar in gui or tty. In gui its ok to show the menu-bar.
*** TODO fonts setup doesn't work :broken:
Also have the scratch buffer be empty instead of have the derp message I never read anyway .
Trying something new here.
#+BEGIN_SRC emacs-lisp
(tool-bar-mode -1)
(scroll-bar-mode -1)
(when (not window-system)
(menu-bar-mode -1))
(custom-set-variables '(initial-scratch-message nil))
(setq default-frame-alist
(append (list
'(right-fringe . 0)
'(font . "Comic Code 14")
'(min-height . 1)
'(height . 42)
'(foreground-color . "#333333")
'(background-color . "#ffffff")
'(cursor-color . "black")
'(internal-border-width . 1)
'(tool-bar-lines . 0)
'(menu-bar-lines . 0))))
#+END_SRC
*** TODO fonts setup doesn't work :broken:
List of fonts in order of preference. Set preferred font list when we're in a
gui emacs session.
@@ -492,7 +545,7 @@ If editorconfig is around use it.
#+BEGIN_SRC emacs-lisp
(use-package tramp
:defer t
:defer 5
:custom
(tramp-default-method "ssh")
:config
@@ -507,51 +560,98 @@ Turns out that someone wrote this exact thing already. Yay get to drop my own cr
#+BEGIN_SRC emacs-lisp
(use-package exec-path-from-shell
:ensure t
:init (if on-osx (exec-path-from-shell-initialize))
:if (memq window-system '(mac ns))
:config
(exec-path-from-shell-initialize)
)
#+END_SRC
*** osx-clipboard-mode
#+BEGIN_SRC emacs-lisp
(when on-osx
(use-package osx-clipboard
:ensure t
:config
(progn
(osx-clipboard-mode +1)
)
)
)
(use-package osx-clipboard
:if (memq window-system '(mac ns))
:ensure t
:config
(osx-clipboard-mode +1))
#+END_SRC
*** spaceline theme
*** mode-line setup
Using some hacked together minimal mode line stuff now, spaceline too too much
oomph with all the crap it did.
Just use the silly spacemacs smart modeline theme cause I'm lazy.
#+BEGIN_SRC emacs-lisp
(defun my-flycheck-lighter (state)
"formats the mode-line fycheck error/warning/note junk"
(let* ((counts (flycheck-count-errors flycheck-current-errors))
(errorp (flycheck-has-current-errors-p state))
(err (or (cdr (assq state counts)) "?"))
(running (eq 'running flycheck-last-status-change)))
(if (or errorp running) (format "•%s" err))))
#+END_SRC
TODO: Use or ditch?
#+BEGIN_SRC emacs-lisp :tangle no
(use-package org-protocol-capture-html
:after quelpa-use-package
:quelpa (org-protocol-capture-html :repo "alphapapa/org-protocol-capture-html" :fetcher github))
#+END_SRC
#+BEGIN_SRC emacs-lisp
(use-package spaceline :ensure t :init (progn (require 'spaceline-config) (spaceline-spacemacs-theme)))
(use-package quelpa-use-package
:ensure t)
(use-package s :ensure t)
(use-package mini-modeline
:ensure t
:after quelpa-use-package
:quelpa (mini-modeline :repo "kiennq/emacs-mini-modeline" :fetcher github)
:config
(mini-modeline-mode)
:custom
(mini-modeline-truncate-p nil)
(mini-modeline-echo-duration 5)
(mini-modeline-face-attr '(:background "white" :weight normal :box (:line-width 2 :color "#ffffff")))
(mini-modeline-display-gui-line nil)
(mini-modeline-r-format '((:eval
(when (and (bound-and-true-p flycheck-mode)
(or flycheck-current-errors
(eq 'running flycheck-last-status-change)))
(concat
" "
(cl-loop for state in '((error . "#FB4933")
(warning . "#FABD2F")
(info . "#83A598"))
as lighter = (my-flycheck-lighter (car state))
when lighter
concat (propertize
lighter
'face `(:foreground ,(cdr state))))
)))
"%e %b %c"
(:eval (if (use-region-p)
(if (eq (point) (region-beginning))
(format "%%l … %d" (line-number-at-pos (region-end)))
(format "%d … %%l" (line-number-at-pos (region-beginning))))
":%l")))))
#+END_SRC
*** yasnippet
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:diminish yas-minor-mode
:ensure t
:init
(setq yas-snippet-dirs
'("~/.emacs.d/snippets"
"~/.emacs.d/snippets-upstream"
))
:config
(yas/reload-all)
(add-hook 'prog-mode-hook
'(lambda ()
(yas-minor-mode)))
(add-hook 'org-mode-hook
'(lambda ()
(yas-minor-mode)))
)
:config
(yas/reload-all)
:hook ((prog-mode . yas-minor-mode)
(org-mode . yas-minor-mode))
)
#+END_SRC
*** semantic
@@ -562,21 +662,23 @@ Note that not all these functions are defined at package install time
(use-package semantic
:ensure t
:config
;; (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
(custom-set-variables
'(global-semantic-decoration-mode t)
'(global-semantic-highlight-func-mode t)
'(global-semantic-idle-scheduler-mode t)
'(global-semantic-idle-local-symbol-highlight-mode t)
)
:init (semantic-mode t)
)
:init
(semantic-mode t) )
#+END_SRC
*** expand-region
#+BEGIN_SRC emacs-lisp
(use-package expand-region :ensure t :bind ("C-]" . er/expand-region))
(use-package expand-region
:ensure t
:bind ("C-]" . er/expand-region))
#+END_SRC
*** ivy/swiper/projectile
@@ -585,10 +687,9 @@ Switching to ivy mode+swiper
#+BEGIN_SRC emacs-lisp
(use-package projectile
:diminish projectile-mode
:ensure t
:init (projectile-global-mode)
)
:init
(projectile-global-mode) )
(use-package counsel
:ensure t
@@ -600,12 +701,10 @@ Switching to ivy mode+swiper
("C-S-o" . counsel-rhythmbox)
("C-c C-r" . ivy-resume))
:custom
(counsel-find-file-at-point t)
)
(counsel-find-file-at-point t))
(use-package swiper
:ensure t
:diminish ivy-mode
:bind (("C-s" . swiper)
("M-x" . counsel-M-x))
:config
@@ -615,8 +714,7 @@ Switching to ivy mode+swiper
(magit-completing-read-function 'ivy-completing-read)
(ivy-use-virtual-buffers t)
(ivy-height 10)
(ivy-count-format "(%d/%d) ")
)
(ivy-count-format "(%d/%d) "))
#+END_SRC
*** magit
@@ -625,7 +723,6 @@ Make git not ass to use. At least in emacs. magit is the best git interface... i
#+BEGIN_SRC emacs-lisp
(use-package magit
:diminish magit-mode
:ensure t
:commands (magit-init
magit-status
@@ -640,11 +737,19 @@ Make git not ass to use. At least in emacs. magit is the best git interface... i
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defadvice magit-quit-window (around magit-restore-screen activate)
ad-do-it
(jump-to-register :magit-fullscreen))
)
(jump-to-register :magit-fullscreen)))
#+END_SRC
And add TODO detection to the magit buffer. That way they get bubbled up to the
top to look at.
#+BEGIN_SRC emacs-lisp
(use-package magit-todos
:ensure t
:after magit
:hook (magit-mode . magit-todos-mode))
#+END_SRC
*** TODO workgroups2 :broken:
@@ -654,12 +759,12 @@ Save workgroup layouts. Similar..ish to desktop-save.
#+BEGIN_SRC emacs-lisp :tangle no
(use-package workgroups2
:ensure t
:diminish (workgroups-mode . "")
:custom
(wg-session-file "~/.emacs.d/workgroups")
(wg-prefix-key (kbd "C-c C-w"))
(wg-mode-line-display-on nil)
:init (workgroups-mode 1)
:init
(workgroups-mode 1)
)
#+END_SRC
@@ -683,30 +788,130 @@ Todo is to figure out what needs to happen for the capture templates and
validate the agenda changes.
#+BEGIN_SRC emacs-lisp
;; (defun org-roam-monolith-capture-date-file(path &optional extension)
;; (mkdir-base-path path)
;; (format "%s/%s%s" base (format-time-string "%Y-%m-%d:%H:%M:%S")
;; ))
;; (defun org-roam-monolith-base-path(path)
;; (expand-file-name (concat path (format-time-string "/%Y/%B"))))
;; (defun org-roam-monolith-mkdir-base-path(path)
;; (mkdir (base-path path) t))
;; (defun org-roam-monolith-file-extension(extension)
;; (if (eq extension nil) ""
;; (if (string-match-p "\\." extension)
;; extension
;; (concat "." extension))))
;; (defun org-roam-monolith-ref-url(url path)
;; (setq base (org-roam-monolith-base-path path))
;; ;; (setq file-string (format-time-string "%Y-%m-%d:%H:%M:%S"))
;; (setq file-string "test")
;; (org-roam-monolith-mkdir-base-path(base))
;; (setq file-prefix (format "%s/%s" base, file-string))
;; (setq title (org-web-tools--html-title url))
;; (setq )
;; (append-to-file
;; (format "#+TITLE: %s\n#+ROAM_KEY: %s\n\n Monolith archive [[%s][%s]]\n" title url
;; title url (mt/insert-url-as-org url))
;; nil
;; reffile)
;; (find-file-other-window reffile)
;; )
;; (defun mt/roam-ref-url()
;; (interactive)
;; (progn
;; (setq url (read-string "url: "))
;; (setq reffile (capture-date-file "~/src/org/ref/url"))
;; (append-to-file
;; (format "#+TITLE: %s\n#+ROAM_KEY: %s\n\n\n* Content\n%s"
;; (org-web-tools--html-title url) url (mt/insert-url-as-org url))
;; nil
;; reffile)
;; (find-file-other-window reffile)))
;; (defun mt/insert-url-as-org(url)
;; (org-web-tools--html-to-org-with-pandoc
;; (org-web-tools--get-url url)))
(defun capture-file-extension(extension)
(if (eq extension nil) ""
(if (string-match-p "\\." extension)
extension
(concat "." extension))))
(defun capture-date-file(path &optional extension)
(setq prefix (expand-file-name (concat path (format-time-string "/%Y/%B"))))
(mkdir prefix t)
(setq file-name (format-time-string "%Y-%m-%d:%H:%M:%S"))
(format "%s/%s%s" prefix file-name (capture-file-extension extension)))
(use-package org
:ensure t
:ensure org-plus-contrib
:pin org
:bind (("C-c a" . org-agenda)
("C-c b" . org-iswitchb)
("C-c c" . org-capture)
("C-c l" . org-store-link)
("C-c p" . org-latex-export-to-pdf))
:config
(add-to-list 'org-structure-template-alist '("el" . "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
(add-to-list 'org-structure-template-alist '("hs" . "#+BEGIN_SRC haskell\n?\n#+END_SRC"))
(add-to-list 'org-structure-template-alist '("pl" . "#+BEGIN_SRC perl\n?\n#+END_SRC"))
(add-to-list 'org-structure-template-alist '("py" . "#+BEGIN_SRC python\n?\n#+END_SRC"))
(add-to-list 'org-structure-template-alist '("sh" . "#+BEGIN_SRC sh\n?\n#+END_SRC"))
(org-babel-do-load-languages
'org-babel-load-languages
(append org-babel-load-languages
'(
(C . t)
(ditaa . t)
(emacs-lisp . t)
(haskell . t)
(latex . t)
(perl . t)
(python . t)
(ruby . t)
(shell . t)
)))
:custom
(org-agenda-span 'fortnight)
(org-log-done t)
(org-hide-leading-stars t)
(org-hide-emphasis-markers t)
(org-confirm-babel-evaluate nil)
(org-src-strip-leading-and-trailing-blank-lines t)
(org-src-preserve-indentation t)
(org-directory "~/src/org")
;; Don't sort-lines ^^^
(org-agenda-span 'fortnight)
(org-archive-directory "~/src/org/attic")
(org-confirm-babel-evaluate nil)
(org-default-notes-file (concat org-directory "/notes.org"))
(org-fontify-done-headline t)
(org-hide-emphasis-markers t)
(org-hide-leading-stars t)
(org-log-done t)
(org-pretty-entities t)
(org-src-preserve-indentation t)
(org-src-strip-leading-and-trailing-blank-lines t)
;; Ref https://orgmode.org/manual/Template-elements.html for more detail.
(org-agenda-files
(list "~/src/org"
"~/src/git.functionalidiot.com/mitchty/dotfiles"))
"~/src/git.mitchty.net/mitchty/dotfiles"))
;; "#+TITLE: %a\n#+ROAM_KEY: %U\n\n [[%U][%U]]\n"
(org-capture-templates
'(
;; TODO: make this crap work somehow
;; ("w" "website"
;; entry (file (capture-date-file "~/src/org/ref/url" "org"))
;; ;; "#+TITLE: %a\n#+ROAM_KEY: %U\n\n%? [[%U][%U]]\n"
;; "%?"
;; :prepend t :empty-lines 1)
;; ("u" "unsorted note"
;; entry (file capture-date-file "~/src/org/unsorted" "org")
;; "\n* %?\nRandom Note entered on %U\n %i\n %a\n"
;; :prepend t :empty-lines 1)
;; ("r" "ref url"
;; entry (file capture-date-file "~/src/org/ref/url")
;; "\n* %?\nRandom Note entered on %U\n %i\n %a\n"
;; :prepend t :empty-lines 1)
("d" "deadline"
entry (file+headline org-default-notes-file "Todos")
"* PRIO %? \nDEADLINE: %t"
@@ -725,8 +930,8 @@ validate the agenda changes.
:prepend t :empty-lines 1 :clock-in t :clock-resume t)
("u" "urls"
entry (file+headline org-default-notes-file "Urls")
"\n* %? :url:\n%i \n"
:prepend t :empty-lines 1 :clock-in t :clock-resume t )
"\n** TODO read url :url:\n[[%?]] \n"
:prepend t :empty-lines 1)
("i" "interruption"
entry (file+headline org-default-notes-file "Interruptions")
"\n* BLOCKED by %? :BLOCKED:\n%t"
@@ -735,57 +940,46 @@ validate the agenda changes.
entry (file (concat org-directory "/journal.org"))
"* %?\n%U\n"
:prepend t :empty-lines 1 :clock-in t :clock-resume t)
))
:config
(add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC" ""))
(add-to-list 'org-structure-template-alist '("hs" "#+BEGIN_SRC haskell\n?\n#+END_SRC" ""))
(add-to-list 'org-structure-template-alist '("pl" "#+BEGIN_SRC perl\n?\n#+END_SRC" ""))
(add-to-list 'org-structure-template-alist '("py" "#+BEGIN_SRC python\n?\n#+END_SRC" ""))
(add-to-list 'org-structure-template-alist '("sh" "#+BEGIN_SRC sh\n?\n#+END_SRC" ""))
(org-babel-do-load-languages 'org-babel-load-languages
(append org-babel-load-languages
'(
(C . t)
(ditaa . t)
(emacs-lisp . t)
(haskell . t)
(latex . t)
(perl . t)
(python . t)
(ruby . t)
(shell . t)
)))
(add-hook 'after-init-hook (lambda () (org-reload)))
)
#+END_SRC
**** TODO Org-roam testing :validation:
DEADLINE: <2020-09-11 Fri>
:LOGBOOK:
CLOCK: [2020-09-07 Mon 10:59]--[2020-09-07 Mon 11:00] => 0:01
:END:
Figure out how the hell to use this thing.
)))
#+END_SRC
**** Org-roam testing
Ref:
- https://github.com/org-roam/org-roam
- https://www.orgroam.com/manual/
#+BEGIN_SRC emacs-lisp :tangle no
Starting out simple..ish.
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:after org
:ensure t
:hook
(after-init . org-roam-mode)
:hook after-init
:custom
(org-roam-directory "~/src/org/roam")
:bind (:map org-roam-mode-map
(("C-c n l" . org-roam)
("C-c n f" . org-roam-find-file)
("C-c n g" . org-roam-graph-show))
:map org-mode-map
(("C-c n i" . org-roam-insert))
(("C-c n I" . org-roam-insert-immediate))))
(org-roam-directory "~/src/org")
(org-roam-index-file "~/src/org/roam.org")
(org-roam-tag-sources '(prop all-directories))
(org-roam-capture-templates
'(("d" "default" plain (function org-roam--capture-get-point)
"%?"
:file-name "~/src/org/${slug}"
:unnarrowed t
:head "#+TITLE: ${title}\n")))
(org-roam-capture-ref-templates
'(("r" "ref" plain (function org-roam-capture--get-point)
"%?"
:file-name "~/src/org/ref/${slug}")
:unnarrowed t
:head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n- source :: ${ref}\n"))
:bind
(:map org-roam-mode-map
(("C-c n l" . org-roam)
("C-c n f" . org-roam-find-file)
("C-c n g" . org-roam-graph))
:map org-mode-map
(("C-c n i" . org-roam-insert))
(("C-c n I" . org-roam-insert-immediate))))
#+END_SRC
**** TODO org babel ob-async testing :validation:
@@ -793,7 +987,9 @@ Ref:
Validate that this installs from scratch fine, blocking babel executions is ass.
#+BEGIN_SRC emacs-lisp
(use-package ob-async :after org :ensure t)
(use-package ob-async
:after org
:ensure t)
#+END_SRC
**** TODO org-habit customization :testing:
@@ -803,7 +999,7 @@ Figure out the customization needed here.
#+BEGIN_SRC emacs-lisp
(use-package org-habit
:after org
:diminish
:ensure t
:custom
(org-habit-graph-column 44)
(org-habit-preceding-days 31)
@@ -819,9 +1015,10 @@ https://github.com/integral-dw/org-superstar-mode
:after org
:ensure t
:custom
(org-bullets-bullet-list '("①" "②" "③" "④" "⑤"))
(org-bullets-bullet-list '("◉" "○" "✸" "✿" "✜" "◆" "▶"))
(org-ellipsis "↴")
:hook (org-mode . org-bullets-mode)
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(when window-system
(let* ((variable-tuple (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
@@ -846,6 +1043,14 @@ https://github.com/integral-dw/org-superstar-mode
)
#+END_SRC
TODO: testing
#+BEGIN_SRC emacs-lisp :tangle no
(use-package org-num
:load-path "lisp/"
:after org
:hook (org-mode . org-num-mode))
#+END_SRC
**** TODO Keep ox-latex in org setup? :validation:broken:
Its tangle is set to no...
@@ -870,13 +1075,19 @@ Flycheck for on the fly checking of code.
#+BEGIN_SRC emacs-lisp
(use-package flycheck
:diminish flycheck-mode
:ensure t
:custom
(flycheck-indication-mode 'left-fringe)
:config
(add-hook 'prog-mode-hook 'flycheck-mode)
)
:hook (prog-mode . flycheck-mode))
#+END_SRC
TODO: see if this is better for error messages
#+BEGIN_SRC emacs-lisp :tangle no
(use-package pos-tip
:after flycheck
:hook
(flycheck-mode . flycheck-pos-tip-mode))
#+END_SRC
**** TODO pkg-config lib stuff for flycheck :broken:
@@ -910,9 +1121,8 @@ Not tangled into the config intentionally.
Auto complete functionality is nice to have.
#+BEGIN_SRC emacs-lisp :tangle no
#+BEGIN_SRC emacs-lisp
(use-package auto-complete
:diminish auto-complete-mode
:ensure t
:init
(require 'auto-complete-config)
@@ -927,11 +1137,8 @@ Helpfully inserts matching parens, can be a pita too.
#+BEGIN_SRC emacs-lisp
(use-package smartparens
:diminish smartparens-mode
:ensure t
:config
(add-hook 'prog-mode-hook 'smartparens-mode)
)
:hook (prog-mode . smartparens-mode))
#+END_SRC
*** rainbow delimiters
@@ -941,9 +1148,7 @@ Makes matching parens easier.
#+BEGIN_SRC emacs-lisp
(use-package rainbow-delimiters
:ensure t
:config
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
)
:hook (prog-mode . rainbow-delimiters-mode))
#+END_SRC
*** uniquify
@@ -985,7 +1190,6 @@ Saves buffers like with auto-save but on focus loss, when idle etc...
#+BEGIN_SRC emacs-lisp
(use-package super-save
:diminish super-save-mode
:ensure t
:config
(super-save-mode +1)
@@ -1001,16 +1205,13 @@ Highlight TODO/FIXME type messages in comments.
#+BEGIN_SRC emacs-lisp :tangle no
(use-package fic-mode
:ensure t
:init
(add-hook 'prog-mode-hook 'turn-on-fic-mode)
)
:hook (prog-mode . fic-mode))
#+END_SRC
*** git gutter
#+BEGIN_SRC emacs-lisp
(use-package git-gutter
:diminish git-gutter-mode
:ensure t
:config
(global-git-gutter-mode t)
@@ -1038,19 +1239,19 @@ Highlight TODO/FIXME type messages in comments.
*** TODO ggtags :broken:
#+BEGIN_SRC emacs-lisp :tangle no
(use-package ggtags :ensure t)
(use-package ggtags
:ensure t)
#+END_SRC
*** TODO company-mode :broken:
*** company-mode
Completion tips.
#+BEGIN_SRC emacs-lisp :tangle no
(use-package company-mode
(use-package company
:ensure t
:config
(add-hook 'after-init-hook 'global-company-mode)
)
:hook
(after-init . global-company-mode))
#+END_SRC
*** yaml-mode
@@ -1058,7 +1259,8 @@ Completion tips.
For.. yaml
#+BEGIN_SRC emacs-lisp
(use-package yaml-mode :ensure t)
(use-package yaml-mode
:ensure t)
#+END_SRC
*** writegood-mode
@@ -1066,13 +1268,15 @@ For.. yaml
So I write gooder. Me fail English? Thats unpossible.
#+BEGIN_SRC emacs-lisp
(use-package writegood-mode :ensure t)
(use-package writegood-mode
:ensure t)
#+END_SRC
*** rust-mode
#+BEGIN_SRC emacs-lisp
(use-package rust-mode :commands rust-mode :mode ("\\*.rs\\'" . rust-mode)
(use-package rust-mode
:commands rust-mode
:defer t)
#+END_SRC
*** TODO python-mode :broken:
@@ -1123,7 +1327,6 @@ Need to make haskell source be all pretty.
#+BEGIN_SRC emacs-lisp
(use-package haskell-mode
:defer t
:diminish haskell-mode
:config
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
@@ -1159,13 +1362,11 @@ Need to make haskell source be all pretty.
)
(use-package dante
:after haskell-mode
:diminish dante-mode
:config
(add-hook 'haskell-mode-hook 'dante-mode)
)
(use-package hindent
:if (executable-find "hindent")
:diminish hindent-mode
:after haskell-mode
:config
(add-hook 'haskell-mode-hook 'hindent-mode)
@@ -1245,13 +1446,10 @@ Make undo more useful, and treelike.
Color variables for easy identification, its like a rainbow puked over
everything opened in prog-mode-hook.
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(use-package color-identifiers-mode
:defer t
:diminish color-identifiers-mode
:config
(add-hook 'prog-mode-hook 'color-identifiers-mode)
)
:hook (prog-mode . color-identifiers-mode))
#+END_SRC
*** idle-highlight-mode
@@ -1259,13 +1457,9 @@ everything opened in prog-mode-hook.
Highlight a variable when you're selecting it, helps in reviewing code to see
where it exists.
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(use-package idle-highlight-mode
:defer t
:diminish idle-highlight-mode
:config
(add-hook 'prog-mode-hook 'idle-highlight-mode)
)
:hook (prog-mode . idle-highlight-mode))
#+END_SRC
*** nix
@@ -1273,8 +1467,11 @@ where it exists.
Instead of text might as well get a decent mode hook going here.
#+BEGIN_SRC emacs-lisp
(use-package nixos-options :defer t)
(use-package company-nixos-options :after company :defer t)
(use-package nixos-options
:defer t)
(use-package company-nixos-options
:after company
:defer t)
#+END_SRC
**** TODO nix-mode :broken:
@@ -1293,7 +1490,8 @@ Instead of text might as well get a decent mode hook going here.
*** docker-mode
#+BEGIN_SRC emacs-lisp
(use-package dockerfile-mode :defer t)
(use-package dockerfile-mode
:defer t)
#+END_SRC
*** TODO cscope or rtags or nuke :testing:validation:
@@ -1306,10 +1504,12 @@ Switch to rtags, or maybe even nuke entirely?
:config (cscope-setup))
#+END_SRC
*** TODO ag :validation:
*** rg
#+BEGIN_SRC emacs-lisp
(use-package ag :defer t)
(use-package rg
:ensure t
:defer t)
#+END_SRC
* mode related
@@ -1317,26 +1517,6 @@ Switch to rtags, or maybe even nuke entirely?
Common mode defaults I think are sensible.
***** TODO prog-mode hooks to use-package :broken:
ALl this crap should be moved into use-package declarations.
#+BEGIN_SRC emacs-lisp
(add-hook 'prog-mode-hook
'(lambda ()
(interactive)
(hl-line-mode)
(whitespace-mode)
(visual-line-mode)
(flyspell-prog-mode)
(custom-set-variables
'(indent-tabs-mode nil)
'(tab-width 2)
)
)
)
#+END_SRC
***** c
#+BEGIN_SRC emacs-lisp
@@ -1511,9 +1691,9 @@ Create *auto-insert-alist* so all the mode lists are the same
"# File: " (file-name-nondirectory buffer-file-name) "\n"
"# Copyright: " (substring (current-time-string) -4) " " auto-insert-copyright "\n"
"# Description: " _ "\n"
"export script =$(basename \"$0\")\n"
"export dir=$(cd \"$(dirname \"$0\")\"; pwd )\n"
"export iam=${dir}/${script} \n"
"_base =$(basename \"$0\")\n"
"_dir=$(cd -P -- \"$(dirname -- \"$(command -v -- \"$0\")\")\" && pwd -P || exit 126 )\n"
"export _base _dir \n"
)
)
auto-insert-alist)
@@ -1535,3 +1715,21 @@ Probably need to check if this file exists first...
#+BEGIN_SRC emacs-lisp :tangle no
(load-file "~/.emacs.d/local.el")
#+END_SRC
* TESTING
Stuff thats getting tested...
Iffy.... Does some jank ass wack stuff in fullscreen mode on cocoa emacs in macos.
#+BEGIN_SRC emacs-lisp :tangle no
(use-package mini-frame
:ensure t
:config
(mini-frame-mode t)
:custom
(mini-frame-show-parameters
'((top . 10))))
;; (width . 0.7)
;; (left . 0.5))))
#+END_SRC