vcs: + +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit + switch github-browse-file for browse-at-remote + fix <leader>ob; add <leader>d[./sr] vc bindings + vc-annotate bindings and initial state Workgroups2 integration: + don't mess with buffers (speeds up emacs a lot!) + unicode numbers in display + single display function + remember workgroup uid instead (and smarter :tabrename) + clean up after wg update Org-mode + give highlight precedence to links in org-mode + enable encryption + config clean up + use different font for org + exclude attachments in recentf + redo latex and inline-image config + add narf/org-open-notes + update file templates for org CRM Mode-line + polish mode-line + decouple from spaceline-segments.el + refactor narf|spaceline-env-update + add macro-recording and buffer-size indicators to mode-line + python: '2>&1' in env-command + flycheck fringe indicator: change to arrow Aesthetics + update narf-dark-theme + add narf-minibuffer-active face + change writing indicator in writing-mode Misc + fix whitespace in display-startup-echo-area-message + reset fonts for more unicode characters + custom imenu entries + helm-imenu fontification + enable yascroll-bar in REPLs + reorganize my-commands.el + force quit iedit on ESC in normal mode + update snippets submodule + remove ido init (helm handles it all) [EXPERIMENTAL] + back to Terminus(TTF) font + popwin: update config for git-gutter and vc-diff windows + highlight :g[lobal] and :al[ign] matches + decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list + fix narf/helm-buffers-dwim (add interactive form)
96 lines
3.4 KiB
EmacsLisp
96 lines
3.4 KiB
EmacsLisp
;;; module-writing.el
|
|
|
|
;; From <https://github.com/joostkremers/visual-fill-column/pull/6>
|
|
(after! visual-fill-column
|
|
(advice-add 'split-window :around #'visual-fill-column--disable-on-split-window))
|
|
(defun visual-fill-column--disable-on-split-window (fn window &rest args)
|
|
"Undo the effects of `visual-fill-column-mode' for splitting window."
|
|
(if (and (or (not window) (window-live-p window))
|
|
(buffer-local-value 'visual-fill-column-mode
|
|
(window-buffer (or window (selected-window)))))
|
|
(let ((inhibit-redisplay t))
|
|
(set-window-fringes (or window (selected-window)) nil)
|
|
(set-window-margins (or window (selected-window)) 0 0)
|
|
(unwind-protect (apply fn window args)
|
|
(save-selected-window
|
|
(when window (select-window window 'norecord))
|
|
(visual-fill-column--adjust-window))))
|
|
(apply fn window args)))
|
|
|
|
;;;
|
|
(setq-default visual-fill-column-center-text nil)
|
|
(defvar writing-mode--last-mode-line mode-line-format)
|
|
(defvar writing-mode--last-line-spacing line-spacing)
|
|
(define-minor-mode writing-mode "Mode for writing research papers or fiction."
|
|
:lighter "swrite"
|
|
:keymap (make-sparse-keymap)
|
|
(let* ((mode-p writing-mode)
|
|
(on-off (if mode-p +1 -1)))
|
|
(visual-fill-column-mode on-off)
|
|
(visual-line-mode on-off)
|
|
|
|
(if mode-p (setq writing-mode--last-line-spacing line-spacing))
|
|
(setq line-spacing (if mode-p '4 writing-mode--last-line-spacing))
|
|
|
|
(setq mode-line-format
|
|
(if mode-p
|
|
'("%e" (:eval (spaceline--prepare
|
|
'("[W]" narf-anzu narf-iedit narf-evil-substitute
|
|
(narf-buffer-path remote-host)
|
|
narf-buffer-modified)
|
|
'((selection-info :face highlight-face :skip-alternate t)
|
|
narf-hud
|
|
))))
|
|
writing-mode--last-mode-line))
|
|
|
|
(when IS-MAC
|
|
(setq ;; sane trackpad/mouse scroll settings
|
|
mac-mouse-wheel-smooth-scroll mode-p
|
|
mouse-wheel-progressive-speed mode-p))))
|
|
|
|
;;; LaTeX
|
|
|
|
(setq TeX-auto-save t)
|
|
(setq TeX-parse-self t)
|
|
(setq bibtex-dialect 'biblatex)
|
|
(setq bibtex-align-at-equal-sign t)
|
|
(setq bibtex-text-indentation 20)
|
|
(add-hook! bibtex-mode
|
|
(local-set-key (kbd "C-c \\") 'bibtex-fill-entry)
|
|
(setq fill-column 140))
|
|
(add-hook! latex-mode 'turn-on-auto-fill)
|
|
(add-hook! LaTeX-mode 'turn-on-auto-fill)
|
|
|
|
(defvar biblio-directory (concat narf-dropbox-dir "docs/biblio/") "docstring")
|
|
(use-package reftex
|
|
:config
|
|
(add-hook 'latex-mode-hook 'turn-on-reftex)
|
|
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
|
|
(setq reftex-plug-into-AUCTeX t
|
|
reftex-ref-style-default-list '("Cleveref" "Hyperref" "Fancyref")
|
|
reftex-default-bibliography
|
|
`(,(expand-file-name "phys.bib" biblio-directory))))
|
|
|
|
|
|
;;; Bibtex
|
|
|
|
;; NOTE: http://bibdesk.sourceforge.net/
|
|
|
|
(use-package helm-bibtex
|
|
:defer t
|
|
:config
|
|
(setq helm-bibtex-bibliography
|
|
`(,(expand-file-name "phys.bib" biblio-directory))
|
|
|
|
helm-bibtex-library-path
|
|
`(,(expand-file-name "phys-pdf" biblio-directory))
|
|
|
|
helm-bibtex-notes-path (expand-file-name "notes" biblio-directory)
|
|
helm-bibtex-notes-extension ".org"
|
|
|
|
helm-bibtex-pdf-open-function
|
|
(lambda (fpath) (async-start-process "open-pdf" "/usr/bin/open" nil fpath))))
|
|
|
|
|
|
(provide 'module-writing)
|
|
;;; module-writing.el ends here
|