diff --git a/TODO.org b/TODO.org index 7142dcc8d..067b1cb33 100644 --- a/TODO.org +++ b/TODO.org @@ -1,22 +1,98 @@ * Changelog -** Unreleased [41/54] -- Potential plugins +*Legend:* ++ [ ] Unfinished ++ [-] Work-in-progress ++ [X] Complete + +** Unreleased [44/115] +- [0/0] Test +- [1/6] Potential plugins + [ ] feature/version-control: [[https://github.com/sshaw/git-link][git-link]] (replacement for browse-at-remote) - + [X] feature/version-control: [[https://github.com/pidu/git-timemachine][git-timemachine]] (replacement for vc-annotate) + [ ] lang/org: [[https://github.com/Malabarba/latex-extra][orgit]] (org links to magit buffers) + [ ] lang/latex: [[https://github.com/Malabarba/latex-extra][latex-extra]] (utility commands) + [ ] lang/latex: [[**https://github.com/jsinglet/latex-preview-pane][latex-preview-pane]] -+ [-] app/finance -+ [-] app/crm -+ [-] Improve send-to-REPL workflow + + [ ] lang/julia: [[ https://github.com/dennisog/julia-shell-mode][julia-shell]] (unsure if better than inferior-julia in julia-mode) + + [X] feature/version-control: [[https://github.com/pidu/git-timemachine][git-timemachine]] (replacement for vc-annotate) +- [0/2] New modules + + [ ] app/finance + + [-] app/crm +- [1/57] Add READMEs to modules + + [0/8] :tools + + [ ] dired + + [ ] electric-indent + + [ ] eshell + + [ ] macos + + [ ] rotate-text + + [ ] term + + [ ] tmux + + [ ] upload + + [1/25] :lang + + [ ] assembly + + [ ] cc + + [ ] crystal + + [ ] csharp + + [ ] data + + [ ] emacs-lisp + + [X] go + + [ ] haskell + + [ ] java + + [ ] javascript + + [ ] julia + + [ ] latex + + [ ] lua + + [ ] markdown + + [ ] org + + [ ] php + + [ ] python + + [ ] rest + + [ ] ruby + + [ ] rust + + [ ] scala + + [ ] sh + + [ ] swift + + [ ] typescript + + [ ] web + + [0/10] :feature + + [ ] debug + + [ ] eval + + [ ] evil + + [ ] file-templates + + [ ] jump + + [ ] snippets + + [ ] spellcheck + + [ ] syntax-checker + + [ ] version-control + + [ ] workspaces + + [0/5] :ui + + [ ] doom + + [ ] doom-dashboard + + [ ] doom-modeline + + [ ] doom-quit + + [ ] hl-todo + + [0/4] :completion + + [ ] ivy + + [ ] company + + [ ] ido + + [ ] helm + + [0/5] :app + + [ ] /app/email + + [ ] /app/write + + [ ] /app/rss + + [ ] /app/twitter + + [ ] /app/present +- [ ] Replace bootstrap system with informative READMEs + Bootstaps aren't robust and are too opinionated, even for my own needs. ++ [ ] send-to-REPL workflow: does it still work? (see ~:repl~ & ~+eval/repl-send-region~) ++ [ ] Fix ~M-z~ key in minibuffer (replace zap-to-char with undo) + [ ] Update screenshots -+ [ ] New (tools/upload): add ~+upload/open-remote-file~ command -+ [ ] Fix 0/0 modeline display (caused by leftover anzu state) -+ [ ] Fix snippet-mode detection in snippets -+ [X] lang/org: by default, unfold level 1 (keep rest folded) -+ [ ] lang/org: Add bootstrap to install latex tools -+ [ ] lang/org: test inline latex preview support ++ [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP) ++ [ ] Fix ~0/0~ displaying in modeline (caused by leftover anzu state) ++ [ ] Fix snippet-mode detection (perhaps use ~magic-mode-alist~? may) ++ [-] lang/org: fix flickering line indentation while typing (caused by ~show-paren-mode~ in insert mode) ++ [X] lang/org: fontify items with all subitems done, e.g. ~+ [0/0] headline~ ++ [X] lang/org: fontify checked-checkbox items the same way DONE headlines are ++ [X] lang/org: by default, unfold level 1 on startup (keep rest folded) + [X] Fix lack of syntax highlighting in ~:x~ scratch buffer + [X] Fix modeline disappearing due to loss of state (~doom--modeline-format~ being killed on major mode change) + [X] lang/web: fix HTML encode/decode entities commands @@ -32,14 +108,14 @@ + [X] lang/python: add ipython detection & REPL support + [X] TAB autocompletion in comint/repl buffers + [X] Fix Emacs daemon compatibility - The config assumes a frame will be visible on startup, causing errors when - Emacs is launched as a daemon. ++ The config assumes a frame will be visible on startup, causing errors when ++ Emacs is launched as a daemon. + [X] ~ace-maximize-window~ is obsolete + [X] Fix whitespace adjustment in highlight-indentation-current-column-mode + [X] Toggle-able "pretty" mode for org-mode - Sometimes, fontification (like prettified entities or hidden regions) make editing difficult. Make this toggleable. ++ Sometimes, fontification (like prettified entities or hidden regions) make editing difficult. Make this toggleable. + [X] Simplify matchit key (%) in python - It prioritizes jumps between if-else and other blocks over brackets. Annoying! ++ It prioritizes jumps between if-else and other blocks over brackets. Annoying! + [X] Fix over-eager ESC killing popups + [X] Refactor out s.el dependency + [X] Use sharp-quote for functions (make byte-compiler more helpful) @@ -49,8 +125,8 @@ + [X] Fix ~:x~ ex command (open scratch buffer) + [X] Colored output from package management commands + [X] ~message!~ & ~format!~ (doom messaging system) - Prints to a DOOM message buffer in interactive sessions, and to stdout (w/ - ansi codes) in noninteractive sessions. ++ Prints to a DOOM message buffer in interactive sessions, and to stdout (w/ ++ ansi codes) in noninteractive sessions. + [X] Make ~+doom-folded-face~ more subtle + [X] tools/term (term/multi-term support) + [X] completion/ivy: escape regexp on ~:ag~ search diff --git a/core/core-lib.el b/core/core-lib.el index 91d79cffb..0e37eed8c 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -182,6 +182,7 @@ Body forms can access the hook's arguments through the let-bound variable (defun ,hook-name () (when (and (boundp ',mode) (not ,mode) + (and buffer-file-name (not (file-remote-p buffer-file-name))) ,(if match `(if buffer-file-name (string-match-p ,match buffer-file-name)) t) ,(if files (doom--resolve-paths files) t) ,(or pred-form t)) diff --git a/modules/feature/version-control/+git.el b/modules/feature/version-control/+git.el index 9adfe9d61..02e7fe272 100644 --- a/modules/feature/version-control/+git.el +++ b/modules/feature/version-control/+git.el @@ -31,19 +31,50 @@ (def-package! browse-at-remote :commands (browse-at-remote browse-at-remote-get-url)) + (def-package! git-timemachine :commands (git-timemachine git-timemachine-toggle) :config (require 'magit-blame) - (add-hook! 'git-timemachine-mode-hook #'evil-force-normal-state) + + ;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of + ;; showing revision details in the minibuffer, show them in + ;; `header-line-format', which is always visible. + (setq git-timemachine-show-minibuffer-details nil) + + (defun +vcs|toggle-header-line () + (if git-timemachine-mode + (+vcs*update-header-line) + (setq-local header-line-format nil))) + + (defun +vcs*update-header-line (&rest _) + (when (and git-timemachine-mode git-timemachine-revision) + (let* ((revision git-timemachine-revision) + (date-relative (nth 3 revision)) + (date-full (nth 4 revision)) + (author (if git-timemachine-show-author (concat (nth 6 revision) ": ") "")) + (sha-or-subject (if (eq git-timemachine-minibuffer-detail 'commit) (car revision) (nth 5 revision)))) + (setq-local + header-line-format + (format "%s%s [%s (%s)]" + (propertize author 'face 'git-timemachine-minibuffer-author-face) + (propertize sha-or-subject 'face 'git-timemachine-minibuffer-detail-face) + date-full date-relative))))) + + (add-hook 'git-timemachine-mode-hook #'+vcs|toggle-header-line) + (advice-add #'git-timemachine-show-revision :after #'+vcs*update-header-line) + + ;; Force evil to rehash keybindings for the current state + (add-hook 'git-timemachine-mode-hook #'evil-force-normal-state) (map! :map git-timemachine-mode-map - :nv "p" 'git-timemachine-show-previous-revision - :nv "n" 'git-timemachine-show-next-revision - :nv "g" 'git-timemachine-show-nth-revision - :nv "q" 'git-timemachine-quit - :nv "w" 'git-timemachine-kill-abbreviated-revision - :nv "W" 'git-timemachine-kill-revision - :nv "b" 'git-timemachine-blame)) + :nv "p" #'git-timemachine-show-previous-revision + :nv "n" #'git-timemachine-show-next-revision + :nv "g" #'git-timemachine-show-nth-revision + :nv "q" #'git-timemachine-quit + :nv "w" #'git-timemachine-kill-abbreviated-revision + :nv "W" #'git-timemachine-kill-revision + :nv "b" #'git-timemachine-blame)) + (def-package! magit :commands magit-status diff --git a/modules/lang/go/README.md b/modules/lang/go/README.md deleted file mode 100644 index c2421206d..000000000 --- a/modules/lang/go/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Go - -Go support, including auto-completion (gocode), eldoc support (go-eldoc), REPL -support (gore), refactoring commands (gorename), syntax-checking (flycheck), -auto-formatting (gofmt), and snippets (yasnippet). - -Snippets can be found in `private/hlissner/snippets/go-mode`. - -## External Dependencies - -Run `make bootstrap go` to install these. - -+ Go (`brew install go`, `pacman -S go`) -+ gocode `go get -u github.com/nsf/gocode` (completion) -+ gore `go get -u github.com/motemen/gore` (REPL) -+ guru `golang.org/x/tools/cmd/guru` (code navigation commands) -+ gorename `golang.org/x/tools/cmd/gorename` (refactoring commands) - diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org new file mode 100644 index 000000000..580625358 --- /dev/null +++ b/modules/lang/go/README.org @@ -0,0 +1,37 @@ +* Go + +Go support, including auto-completion, eldoc support (go-eldoc), REPL support, +refactoring commands, syntax-checking (flycheck), auto-formatting (gofmt) and +snippets (yasnippet). + ++ [[https://golang.org][Homepage]] ++ [[../../modules/private/hlissner/snippets/go-mode][Snippets]] ++ [[../../modules/feature/file-templates/templates/go-mode][File templates]] + +** Installation +*** MacOS +#+BEGIN_SRC sh :results output +brew install go +#+END_SRC + +*** Arch Linux +#+BEGIN_SRC sh :dir /sudo:: :results output +pacman --needed --noconfirm -S go +#+END_SRC + +** Dependencies +You'll need to set up ~GOPATH~. This is mine: + +#+BEGIN_SRC sh +export GOPATH=~/.go +#+END_SRC + +Then install the necessary packages: + +#+BEGIN_SRC sh :results output +go get -u github.com/nsf/gocode # completion +go get -u github.com/motemen/gore # REPL +go get -u golang.org/x/tools/cmd/guru # code navigation commands +go get -u golang.org/x/tools/cmd/gorename # refactoring commands +#+END_SRC + diff --git a/modules/lang/org/+agenda.el b/modules/lang/org/+agenda.el index fbc132c99..a37ab81b2 100644 --- a/modules/lang/org/+agenda.el +++ b/modules/lang/org/+agenda.el @@ -17,7 +17,7 @@ (add-to-list 'recentf-exclude #'+org-is-agenda-file) ;; - (map! :map org-agenda-mode-amp + (map! :map org-agenda-mode-map :e "" #'org-agenda-Quit :e "m" #'org-agenda-month-view :e "C-j" #'org-agenda-next-item diff --git a/modules/lang/org/+babel.el b/modules/lang/org/+babel.el index 98040d77b..4f70f48e7 100644 --- a/modules/lang/org/+babel.el +++ b/modules/lang/org/+babel.el @@ -34,6 +34,14 @@ translate ))) + ;; In a recent update, `org-babel-get-header' was removed from org-mode, which + ;; is something a fair number of babel plugins use. So until those plugins update... + (defun org-babel-get-header (params key &optional others) + (delq nil + (mapcar + (lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p)) + params))) + ;; I prefer C-c C-c for confirming over the default C-c ' (map! :map org-src-mode-map "C-c C-c" 'org-edit-src-exit) ;; I know the keybindings, no need for the header line diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 0dcaab315..4ef1ee072 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -146,7 +146,9 @@ with `org-cycle'). Also removes babel result blocks, if run from a code block." (cond ((org-at-heading-p) (outline-toggle-children)) ((org-at-item-p) - (org-cycle)))) + (let ((window-beg (window-start))) + (org-cycle) + (set-window-start nil window-beg))))) ;;;###autoload (defun +org/dwim-at-point () diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 25c6f42cb..9e0aa9963 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -44,10 +44,11 @@ (defun +org|hook () "Run everytime `org-mode' is enabled." + (setq line-spacing 1) + + (visual-line-mode +1) (when (and (featurep 'evil) evil-mode) (evil-org-mode +1)) - (visual-line-mode +1) - (setq line-spacing 1) (unless org-agenda-inhibit-startup ;; My version of the 'overview' #+STARTUP option: expand first-level @@ -106,11 +107,11 @@ outline-blank-line t org-indent-mode-turns-on-hiding-stars t org-adapt-indentation nil - org-blank-before-new-entry '((heading . nil) (plain-list-item . auto)) org-cycle-separator-lines 1 org-cycle-include-plain-lists t - org-ellipsis " ... " - org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭") + ;; org-ellipsis " ... " + org-ellipsis "  " + org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭") ("sharp" "\\sharp" nil "" "" "266F" "♯")) org-fontify-done-headline t org-fontify-quote-and-verse-blocks t @@ -119,6 +120,7 @@ org-hide-emphasis-markers nil org-hide-leading-stars t org-hide-leading-stars-before-indent-mode t + org-hidden-keywords nil org-image-actual-width nil org-indent-indentation-per-level 2 org-pretty-entities nil @@ -130,17 +132,14 @@ org-use-sub-superscripts '{} ;; Behavior + org-blank-before-new-entry '((heading . nil) (plain-list-item . auto)) org-catch-invisible-edits 'show org-checkbox-hierarchical-statistics nil - org-enforce-todo-checkbox-dependencies t - org-completion-use-ido nil ; Use ivy/counsel for refiling + org-enforce-todo-checkbox-dependencies nil org-confirm-elisp-link-function nil org-default-priority ?C - org-hidden-keywords nil org-hierarchical-todo-statistics t - org-log-done t org-loop-over-headlines-in-active-region t - org-outline-path-complete-in-steps nil org-refile-use-outline-path t org-special-ctrl-a/e t @@ -148,7 +147,6 @@ org-archive-location (concat +org-dir "/archived/%s::") org-refile-targets '((nil . (:maxlevel . 2))) ; display full path in refile completion - ;; Latex org-highlight-latex-and-related '(latex) org-latex-create-formula-image-program 'dvipng @@ -173,6 +171,12 @@ 'default) :background nil t))) + ;; Use ivy/helm if either is available + (when (or (featurep! :completion ivy) + (featurep! :completion helm)) + (setq-default org-completion-use-ido nil + org-outline-path-complete-in-steps nil)) + (let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM" "gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm")))) (setq iimage-mode-image-regex-alist @@ -180,25 +184,20 @@ ext-regexp "\\)\\(\\]\\]\\|>\\|'\\)?") . 2) (,(concat "<\\(http://.+\\." ext-regexp "\\)>") . 1)))) - ;; Fontify checkboxes and dividers - (defface org-list-bullet - '((t (:inherit font-lock-keyword-face))) - "Face for list bullets" - :group 'doom) + ;;; Custom fontification ;; I like how org-mode fontifies checked TODOs and want this to extend to ;; checked checkbox items, so we remove the old checkbox highlight rule... (font-lock-remove-keywords - 'org-mode - '(("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)" - 1 'org-checkbox prepend))) + 'org-mode '(("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)" + 1 'org-checkbox prepend))) (font-lock-add-keywords 'org-mode '(;; ...and replace it with my own - ("^[ \t]*\\(\\(?:[-+]\\|[0-9]+[).]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[X\\][^\n]*\n\\)" + ("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" 1 'org-headline-done t) ("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- ]\\]\\)" - 1 'org-checkbox prepend) + 1 'org-checkbox append) ;; Also highlight list bullets - ("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-bullet append) + ("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-dt append) ;; and separators ("^ *\\(-----+\\)$" 1 'org-meta-line)))