Skip to content

Commit

Permalink
Merge pull request #241 from akirak/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
akirak authored Sep 25, 2024
2 parents f5ca7ce + 1936b32 commit 5540290
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 7 deletions.
29 changes: 23 additions & 6 deletions emacs/emacs-config.org
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,18 @@ The built-in =electric= package provides the following modes:
;; has been restored.
(add-hook 'after-init-hook #'auto-image-file-mode 70))
#+end_src
*** imenu

#+begin_src emacs-lisp
(setup imenu
(defun akirak/set-imenu-max-item-width ()
(setq imenu-max-item-length (min (or (frame-text-width) 80)
120)))

(if (daemonp)
(add-hook 'server-after-make-frame-hook #'akirak/set-imenu-max-item-width)
(akirak/set-imenu-max-item-width)))
#+end_src
*** indent
:PROPERTIES:
:CREATED_TIME: [2022-01-05 Wed 21:08]
Expand Down Expand Up @@ -2279,7 +2291,7 @@ Display available keybindings in popup
#+end_quote

#+begin_src emacs-lisp
(setup which-key
(setup (:package which-key)
(:hook-into after-init-hook)
(:hook which-key-setup-side-window-bottom))
#+end_src
Expand Down Expand Up @@ -2742,7 +2754,7 @@ Outline-based notes management and organizer
#+end_quote

#+begin_src emacs-lisp
(setup org
(setup (:package org)
(:with-mode org-mode
(:set org-log-done 'time
org-log-into-drawer t
Expand Down Expand Up @@ -3275,7 +3287,7 @@ Improved list management in org-mode
(org-insert-item)
(apply orig args))))))
#+end_src
*** org-bb
*** org-bb :@extra:Org:
:PROPERTIES:
:CREATED_TIME: [2022-04-13 Wed 23:59]
:END:
Expand Down Expand Up @@ -3671,7 +3683,7 @@ Automatic tables of contents for Org files
#+begin_src emacs-lisp
(setup (:package org-make-toc))
#+end_src
*** org-memento
*** org-memento :@extra:Org:
:PROPERTIES:
:CREATED_TIME: [2022-10-06 Thu 18:50]
:END:
Expand Down Expand Up @@ -4003,7 +4015,7 @@ Org Query Language, search command, and agenda-like view
'org-ql-view--transient-super-groups
'("g" "Groups" akirak-org-ql-view-set-super-groups))))
#+end_src
*** org-recur
*** org-recur :@extra:Org:
:PROPERTIES:
:CREATED_TIME: [2022-02-28 Mon 14:17]
:END:
Expand Down Expand Up @@ -8311,6 +8323,7 @@ Parentheses Universalistic
svelte-mode
web-mode
sql-mode
d2-mode
nxml-mode)

(:unbind "C-M-a" "C-M-e" "C-w" "M-d" "C-M-f")
Expand Down Expand Up @@ -9815,8 +9828,8 @@ If you have [[https://github.com/alphapapa/org-ql/][org-ql]] installed, you can
| [[org-ql-search:tags:packages][packages]] | 213 |
| [[org-ql-search:tags:visual][visual]] | 14 |
| [[org-ql-search:tags:UI][UI]] | 12 |
| [[org-ql-search:tags:@extra][@extra]] | 12 |
| [[org-ql-search:tags:formatting][formatting]] | 10 |
| [[org-ql-search:tags:@extra][@extra]] | 9 |
| [[org-ql-search:tags:development][development]] | 8 |
| [[org-ql-search:tags:editing][editing]] | 8 |
| [[org-ql-search:tags:library][library]] | 8 |
Expand All @@ -9836,6 +9849,7 @@ If you have [[https://github.com/alphapapa/org-ql/][org-ql]] installed, you can
| [[org-ql-search:tags:keybindings][keybindings]] | 3 |
| [[org-ql-search:tags:minibuffer][minibuffer]] | 3 |
| [[org-ql-search:tags:navigation][navigation]] | 3 |
| [[org-ql-search:tags:Org][Org]] | 3 |
| [[org-ql-search:tags:web][web]] | 3 |
| [[org-ql-search:tags:structured__editing][structured__editing]] | 3 |
| [[org-ql-search:tags:Nix][Nix]] | 3 |
Expand Down Expand Up @@ -9936,6 +9950,9 @@ To use these features, they need to be turned on at build time.
#+BEGIN: org-ql :query "tags:@extra" :columns (heading todo)
| Heading | Todo |
|-----------------+------|
| [[org-bb][org-bb]] | |
| [[org-memento][org-memento]] | |
| [[org-recur][org-recur]] | |
| [[beancount][beancount]] | |
| [[copilot][copilot]] | |
| [[dune][dune]] | |
Expand Down
31 changes: 30 additions & 1 deletion emacs/lisp/akirak-puni.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
((elixir-mode)
akirak-puni-elixir-setup)
((web-mode)
akirak-puni-web-mode-setup))
akirak-puni-web-mode-setup)
((d2-mode)
akirak-puni-d2-mode-setup))
""
:type '(alist :key-type (repeat symbol)
:value-type (cons function (cons nil))))
Expand Down Expand Up @@ -148,5 +150,32 @@
(t
(end-of-line))))

;;;;; d2

(defun akirak-puni-d2-mode-setup ()
"Setup puni bindings for jsx."
(interactive)
(local-set-key [remap puni-kill-line] #'akirak-puni-d2-kill-line))

(defun akirak-puni-d2-kill-line ()
(interactive)
(puni-soft-delete-by-move #'akirak-puni-d2-end-of-soft-kill
nil
'beyond
;; 'within
'kill
'delete-one))

(defun akirak-puni-d2-end-of-soft-kill ()
(let ((eol (line-end-position)))
(when (re-search-forward "{" eol t)
(goto-char (match-beginning 0))
(pcase-exhaustive (funcall show-paren-data-function)
(`(,_ ,_ ,_ ,end . ,_)
(if (> end eol)
(goto-char end)
(goto-char eol)))))
(beginning-of-line 2)))

(provide 'akirak-puni)
;;; akirak-puni.el ends here
35 changes: 35 additions & 0 deletions emacs/lock/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions emacs/lock/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,12 @@
repo = "orderless";
type = "github";
};
org = {
flake = false;
ref = "bugfix";
type = "git";
url = "https://git.savannah.gnu.org/git/emacs/org-mode.git";
};
org-autolist = {
flake = false;
owner = "akirak";
Expand Down Expand Up @@ -1273,6 +1279,12 @@
repo = "web-mode";
type = "github";
};
which-key = {
flake = false;
owner = "justbur";
repo = "emacs-which-key";
type = "github";
};
whole-line-or-region = {
flake = false;
owner = "purcell";
Expand Down

0 comments on commit 5540290

Please sign in to comment.