|
105 | 105 | (require 'quelpa-use-package)) |
106 | 106 |
|
107 | 107 | ;; Auto installing OS system packages |
108 | | -(use-package system-packages :config (system-packages-update)) |
109 | 108 |
|
110 | 109 | ;; Install OS packages using `use-package`. |
111 | 110 | (use-package use-package-ensure-system-package) |
@@ -180,17 +179,13 @@ installs of pacakges that are not in our `my/installed-packages' listing. |
180 | 179 | (system-packages-ensure "licecap") ;; Use: ⌘-SPACE licecap |
181 | 180 |
|
182 | 181 | ;; Pack, ship and run any application as a lightweight container |
183 | | -(system-packages-ensure "docker") |
184 | 182 | ;; Free universal database tool and SQL client |
185 | | -(system-packages-ensure "dbeaver-community") |
186 | 183 | ;; Kubernetes IDE |
187 | | -(system-packages-ensure "lens") |
188 | 184 | ;; Platform built on V8 to build network applications |
189 | 185 | ;; Also known as: node.js, node@16, nodejs, npm |
190 | 186 | (system-packages-ensure "node") ;; https://nodejs.org/ |
191 | 187 | ;; Nice: https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/ |
192 | 188 | ;; Manage multiple Node.js versions |
193 | | -(shell-command "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash") |
194 | 189 | ;; According to https://github.com/nvm-sh/nvm, nvm shouldn't be installed via brew. |
195 | 190 |
|
196 | 191 | ;; ;; Use “brew cask install” instead of “brew install” for installing programs.; |
@@ -253,12 +248,6 @@ installs of pacakges that are not in our `my/installed-packages' listing. |
253 | 248 | ("TAB" . helm-execute-persistent-action) |
254 | 249 | ("<tab>" . helm-execute-persistent-action))) |
255 | 250 |
|
256 | | -;; Show me nice file icons when using, say, “C-x C-f” or “C-x b” |
257 | | -;; (use-package helm-icons |
258 | | -;; :defer nil |
259 | | -;; :custom (helm-icons-provider 'all-the-icons) |
260 | | -;; :config (helm-icons-enable)) |
261 | | - |
262 | 251 | ;; When I want to see the TOC of an Org file, show me down to 3 subheadings. |
263 | 252 | (setq org-imenu-depth 3) |
264 | 253 |
|
@@ -383,118 +372,10 @@ installs of pacakges that are not in our `my/installed-packages' listing. |
383 | 372 | ;; Neato doc strings for hydras |
384 | 373 | (use-package pretty-hydra :defer nil) |
385 | 374 |
|
386 | | -;; TODO convert my existing defhydras to my/defhydra. |
387 | | -(defmacro my/defhydra (key title icon-name &rest body) |
388 | | -"Make a hydra whose heads appear in a pretty pop-up window. |
389 | | -Heads are signalled by keywords and the hydra has an icon in its title. |
390 | | -
|
391 | | -KEY [String]: Global keybinding for the new hydra. |
392 | | -
|
393 | | -TITLE [String]: Either a string or a plist, as specified for pretty-hydra-define. |
394 | | - The underlying Lisp function's name is derived from the TITLE; |
395 | | - which is intentional since hydra's are for interactive, pretty, use. |
396 | | -
|
397 | | - One uses a plist TITLE to specify what a hydra should do *before* |
398 | | - any options, or to specify an alternate quit key (:q by default). |
399 | | -
|
400 | | -ICON-NAME [Symbol]: Possible FontAwesome icon-types: C-h v `all-the-icons-data/fa-icon-alist'. |
401 | | -
|
402 | | -BODY: A list of columns and entries. Keywords indicate the title |
403 | | - of a column; 3-lists (triples) indicate an entry key and |
404 | | - the associated operation to perform and, optionally, a name |
405 | | - to be shown in the pop-up. See DEFHYDRA for more details. |
406 | | -
|
407 | | -
|
408 | | -For instance, the verbose mess: |
409 | | -
|
410 | | - ;; Use ijkl to denote ↑←↓→ arrows. |
411 | | - (global-set-key |
412 | | - (kbd \"C-c w\") |
413 | | - (pretty-hydra-define my/hydra/\\t\\tWindow\\ Adjustment |
414 | | - ;; Omitting extra work to get an icon into the title. |
415 | | - (:title \"\t\tWindow Adjustment\" :quit-key \"q\") |
416 | | - (\"Both\" |
417 | | - ((\"b\" balance-windows \"balance\") |
418 | | - (\"s\" switch-window-then-swap-buffer \"swap\")) |
419 | | - \"Vertical adjustment\" |
420 | | - ((\"h\" enlarge-window \"heighten\") |
421 | | - (\"l\" shrink-window \"lower\")) |
422 | | - \"Horizontal adjustment\" |
423 | | - ((\"n\" shrink-window-horizontally \"narrow\") |
424 | | - (\"w\" enlarge-window-horizontally \"widen\" ))))) |
425 | | -
|
426 | | -Is replaced by: |
427 | | -
|
428 | | - ;; Use ijkl to denote ↑←↓→ arrows. |
429 | | - (my/defhydra \"C-c w\" \"\t\tWindow Adjustment\" windows |
430 | | - :Both |
431 | | - (\"b\" balance-windows \"balance\") |
432 | | - (\"s\" switch-window-then-swap-buffer \"swap\") |
433 | | - :Vertical_adjustment |
434 | | - (\"h\" enlarge-window \"heighten\") |
435 | | - (\"l\" shrink-window \"lower\") |
436 | | - :Horizontal_adjustment |
437 | | - (\"n\" shrink-window-horizontally \"narrow\") |
438 | | - (\"w\" enlarge-window-horizontally \"widen\"))" |
439 | | - (let* ((name (intern (concat "my/hydra/" |
440 | | - (if (stringp title) |
441 | | - title |
442 | | - (plist-get title :title))))) |
443 | | - (icon-face `(:foreground ,(face-background 'highlight))) |
444 | | - (iconised-title |
445 | | - (concat |
446 | | - (when icon-name |
447 | | - (require 'all-the-icons) |
448 | | - (concat |
449 | | - (all-the-icons-faicon (format "%s" icon-name) :face icon-face :height 1.0 :v-adjust -0.1) |
450 | | - " ")) |
451 | | - (propertize title 'face icon-face)))) |
452 | | - `(global-set-key |
453 | | - (kbd ,key) |
454 | | - (pretty-hydra-define ,name |
455 | | - ,(if (stringp title) |
456 | | - (list :title iconised-title |
457 | | - :quit-key "q") |
458 | | - title) |
459 | | - ,(thread-last body |
460 | | - (-partition-by-header #'keywordp) |
461 | | - (--map (cons (s-replace "_" " " (s-chop-prefix ":" (symbol-name (car it)))) (list (cdr it)))) |
462 | | - (-flatten-n 1)))))) |
463 | | - |
464 | | -(my/defhydra "C-n" "\t\t\t\t\tTextual Navigation" arrows |
465 | | - :Line |
466 | | - ("n" next-line) |
467 | | - ("p" previous-line) |
468 | | - ("a" beginning-of-line) |
469 | | - ("e" move-end-of-line) |
470 | | - ("g" goto-line) |
471 | | - :Word |
472 | | - ("f" forward-word "Next") |
473 | | - ("b" backward-word "Previous") |
474 | | - ("{" org-backward-element "Next Element") |
475 | | - ("}" org-forward-element "Previous Element") |
476 | | - :Screen |
477 | | - ("v" scroll-up-command "Scroll Down") |
478 | | - ("V" scroll-down-command "Scroll Up") |
479 | | - ("l" recenter-top-bottom "Center Page") |
480 | | - ("r" move-to-window-line-top-bottom "Relocate Point") |
481 | | - ("m" helm-imenu "Textual Menu")) |
482 | 375 |
|
483 | 376 | ;; C-n, next line, inserts newlines when at the end of the buffer |
484 | 377 | (setq next-line-add-newlines t) |
485 | 378 |
|
486 | | -;; Use ijkl to denote ↑←↓→ arrows. |
487 | | -(my/defhydra "C-c w" "\t\tWindow Adjustment" windows |
488 | | - :Both |
489 | | - ("b" balance-windows "balance") |
490 | | - ("s" switch-window-then-swap-buffer "swap") |
491 | | - :Vertical_adjustment |
492 | | - ("h" enlarge-window "heighten") |
493 | | - ("l" shrink-window "lower") |
494 | | - :Horizontal_adjustment |
495 | | - ("n" shrink-window-horizontally "narrow") |
496 | | - ("w" enlarge-window-horizontally "widen")) |
497 | | - |
498 | 379 | ;; Provides a *visual* way to choose a window to switch to. |
499 | 380 | ;; (use-package switch-window ) |
500 | 381 | ;; :bind (("C-x o" . switch-window) |
@@ -1035,34 +916,6 @@ if REMOTE is https://github.com/X/Y then LOCAL becomes ∼/Y." |
1035 | 916 | ;; |
1036 | 917 | ;; We use projectile's record of known projects, and keep only projects with |
1037 | 918 | ;; .git directory. |
1038 | | -(with-eval-after-load 'projectile |
1039 | | - (setq magit-repository-directories |
1040 | | - (thread-last (projectile-relevant-known-projects) |
1041 | | - (--filter (unless (file-remote-p it) |
1042 | | - (file-directory-p (concat it "/.git/")))) |
1043 | | - (--map (list (substring it 0 -1) 0))))) |
1044 | | - |
1045 | | -;; Follow-up utility |
1046 | | -(defun my/update-repos () |
1047 | | - "Update (git checkout main & pull) recently visited repositories." |
1048 | | - (interactive) |
1049 | | - (cl-loop for (repo _depth) in magit-repository-directories |
1050 | | - ;; Is it “main” or “master” |
1051 | | - for trunk = (s-trim (shell-command-to-string (format "cd %s; git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'" repo))) |
1052 | | - do (message (format "🤖 %s ∷ Checking out & pulling main" repo)) |
1053 | | - (shell-command (format "cd %s; git checkout %s; git pull" repo trunk))) |
1054 | | - (message "🥳 Happy coding!")) |
1055 | | -;; Jump to a (ma)git repository with ~C-u C-x g~:1 ends here |
1056 | | - |
1057 | | -;; [[file:init.org::*Pretty Magit Commit Leaders][Pretty Magit Commit Leaders:1]] |
1058 | | -(cl-defmacro pretty-magit (WORD ICON PROPS &optional (description "") NO-PROMPT?) |
1059 | | - "Replace sanitized WORD with ICON, PROPS and by default add to prompts." |
1060 | | - `(prog1 |
1061 | | - (add-to-list 'pretty-magit-alist |
1062 | | - (list (rx bow (group ,WORD (eval (if ,NO-PROMPT? "" ":")))) |
1063 | | - ,ICON ',PROPS)) |
1064 | | - (unless ,NO-PROMPT? |
1065 | | - (add-to-list 'pretty-magit-prompt (cons (concat ,WORD ": ") ,description))))) |
1066 | 919 |
|
1067 | 920 | (setq pretty-magit-alist nil) |
1068 | 921 | (setq pretty-magit-prompt nil) |
@@ -2127,11 +1980,6 @@ Functin Source: https://xenodium.com/emacs-dwim-do-what-i-mean/" |
2127 | 1980 | (let ((title (match-string 1 str)) |
2128 | 1981 | (url (match-string 2 str))) |
2129 | 1982 | (list title url)))) |
2130 | | -;; example usage |
2131 | | -(when nil |
2132 | | - (let ((input "12345: [nqe, fix] NQE Regex Syntax: Fix parsing of quantifiers | https://gerrit.local.company.com/c/fwd/+/12345")) |
2133 | | - (-let [ (title url) (ai/extract-title-and-url input) ] |
2134 | | - (message "Title: %s\nURL: %s" title url)))) |
2135 | 1983 |
|
2136 | 1984 | ;; C-c C-l Org-mode ⇐ HTML:3 ends here |
2137 | 1985 |
|
@@ -2407,33 +2255,6 @@ Where directory hierarchy com/x/y/z denotes a Java package under the above //!us |
2407 | 2255 | (hs-hide-all))))) |
2408 | 2256 | ;; Actual Setup:1 ends here |
2409 | 2257 |
|
2410 | | -;; [[file:init.org::*Actual Setup][Actual Setup:2]] |
2411 | | -(my/defhydra "C-c f" "Folding text" archive |
2412 | | - :Current |
2413 | | - ("h" hs-hide-block "Hide") |
2414 | | - ("s" hs-show-block "Show") |
2415 | | - ("t" hs-toggle-hiding "Toggle") |
2416 | | - ;; "l" hs-hide-level "Hide blocks n levels below this block"; TODO: Enable folding feature |
2417 | | - :Buffer |
2418 | | - ("H" hs-hide-all "Hide") |
2419 | | - ("S" hs-show-all "Show") |
2420 | | - ("T" my/hs-toggle-buffer "Toggle") |
2421 | | - :Style |
2422 | | - ("i" my/clever-selective-display "Fold along current indentation" :toggle selective-display) |
2423 | | - ("e" auto-set-selective-display-mode "Explore; walk and see" :toggle t) |
2424 | | - :Region |
2425 | | - ("f" (lambda () (interactive) (vimish-fold-toggle) (vimish-fold (region-beginning) (region-end))) "Fold/Toggle") |
2426 | | - ("d" vimish-fold-delete "Delete fold") |
2427 | | - ("U" vimish-fold-unfold-all "Unfold all") |
2428 | | - ("D" vimish-fold-delete-all "Delete all") |
2429 | | - ("n" vimish-fold-next-fold "Next fold") |
2430 | | - ("p" vimish-fold-previous-fold "Previous fold") |
2431 | | - :... |
2432 | | - ("w" hl-todo-occur "Show WIPs/TODOs" :exit t) |
2433 | | - ("m" lsp-ui-imenu "Menu of TLIs" :exit t) ;; TLI ≈ Top Level Items |
2434 | | - ;; ("i" imenu-list "iMenu (General)") ;; It seems the above is enough for both prog and otherwise. |
2435 | | - ("r" (progn (hs-minor-mode -1) (hs-minor-mode +1)) "Reset Hideshow") ;; Remove all folds from the buffer and reset all hideshow-mode. Useful if it messes up! |
2436 | | - ("q" nil "Quit" :color blue)) |
2437 | 2258 |
|
2438 | 2259 | ;; Features from origami/yafolding that maybe I'd like to implement include: |
2439 | 2260 | ;; narrowing to block or folding everything except block, navigating back and forth between folded blocks. |
@@ -2549,26 +2370,7 @@ see https://github.com/lewang/rebox2/blob/master/rebox2.el" |
2549 | 2370 | (use-package banner-comment :defer nil) |
2550 | 2371 | ;; Comment-boxes up to the fill-column ---or banner instead?:2 ends here |
2551 | 2372 |
|
2552 | | -;; [[file:init.org::*Searching Hydra][Searching Hydra:1]] |
2553 | | -(my/defhydra "s-f" "\t\tLocate Everything" search |
2554 | | - :Buffer |
2555 | | - ;; find all the occurrences of a string, pull out the lines containing the string to another buffer where [F2] I can edit and save, |
2556 | | - ("e" helm-swoop "Editable") |
2557 | | - ;; Implicit Regex, colourful |
2558 | | - ("c" swiper "Classic") |
2559 | | - |
2560 | | - :Project |
2561 | | - ;; “:toggle ℰ”: ℰ is a Boolean expression that is evaluated to tell us whether the state is on-or-off |
2562 | | - ("t" (lambda () (interactive)) "Ignore specs/jsons" |
2563 | | - :toggle (let* ((with-hole "ag %s --line-numbers -S --color --nogroup %%s %%s %%s") ;; ≈ original value of ‘helm-grep-ag-command’ |
2564 | | - (ignores "--ignore=\"*spec.js\" --ignore=\"*.json\" --ignore=\"*.json5\"") |
2565 | | - (on (equal helm-grep-ag-command (format with-hole ignores)))) |
2566 | | - (if on (progn (setq helm-grep-ag-command (format with-hole "")) nil) ;; ≈ turn off the toggle |
2567 | | - (setq helm-grep-ag-command (format with-hole ignores))))) |
2568 | | - ("f" (lambda () (interactive) (helm-do-grep-ag t)) "File type") |
2569 | | - ("d" (lambda () (interactive) (-let [default-directory (read-directory-name "Where do you want to search? ")] (helm-do-grep-ag nil))) "Directory") |
2570 | | - ("D" (lambda () (interactive) (-let [default-directory (read-directory-name "Where do you want to search? ")] (helm-do-grep-ag t))) "Directory & type")) |
2571 | | -;; Searching Hydra:1 ends here |
| 2373 | +;; (find-file "/Users/musa/Documents/private-goal-getting/notes.org") |
2572 | 2374 |
|
2573 | 2375 | ;; [[file:init.org::*⌘-e: Edit Everything in a separate buffer][⌘-e: Edit Everything in a separate buffer:1]] |
2574 | 2376 | (use-package separedit :defer nil) |
|
0 commit comments