References
Related Notes
History
DONE 11:18 ๋ฒ๊ทธํฝ์ค ํ์ - vertico childframe
๋ฌธ์ ๊ฐ์
์ฐ๊ณ ์๋ ๋ ธํธ์ ๊ธฐ์กด ๋ ธํธ๋ฅผ ์ฐ๊ฒฐํ๋ ค๊ณ ํ๋ค. ํค๋ณด๋๋ก ๋ญ ํ๋ ๋๋ฅด๋ฉด ๋๋ค. ๋ ธํธ ๋ชฉ๋ก์ด ๋์จ๋ค.
๊ทผ๋ฐ ๋ค์ ๋์ง๋์ง ์ ๋ณด๊ฐ ๋ถ์ด ์๋ค. ์ง์ ๋ถํ๋ค. ๋ถํธํ๋ค. ํ์ผ๋ช ๋ง ๋์ค๋ฉด ๋๋ค. ํ์ผ๋ช ์ ๋ค ๋ค์ด ์์ผ๋๊น.
๋๋ต ์ด ์ ๋๋ฉด ์ถฉ๋ถํ๋ค.
๊ทธ๋ผ์๋ ์ข ๋ฐ๊พธ๊ณ ์ถ๋ค. ํนํ ๋ ธํธ ๋ชฉ๋ก์ ์์๋ฅผ ์ด๋ป๊ฒ? ์ํ๋ฒณ ์์ผ๋ก? ํ๊ธ ์์ผ๋ก? ์ต๊ทผ ์์ ํ ๋ ธํธ ์์๋ก ์ ๋ ฌํ๋ ๊ฒ์? ์๋ฌด๋ ด ๋ค ๋๋ค. ์นดํ ๊ณ ๋ฆฌ๋ฅผ ์ ์ฉํ๋ฉด ๋๋ค.
์คํฌ๋ฆฐ์ท
>
|2025-03-27 Thu 12:35|
@user ์กฐ์ง๋ชจ๋ ํ์ผ์ ๊ฒ์ ํ ๋, marginalia annotator category๋ฅผ ์ต๊ทผ ์์ ํ ํ์ผ ๋ชฉ๋ก ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ ํ๋๋ก ํจ์๋ฅผ ๋ง๋ค์ด์ค.
@assistant ์กฐ์ง๋ชจ๋์์ ํน์ ์นดํ ๊ณ ๋ฆฌ(marginalia annotator category)๋ฅผ ๊ธฐ์ค์ผ๋ก ์ต๊ทผ ์์ ํ ํ์ผ ๋ชฉ๋ก์ ์ ๋ ฌํ๋ ํจ์๋ฅผ ๋ง๋ค๊ธฐ ์ํด์๋ Emacs Lisp์ ์ฌ์ฉํ์ฌ ํจ์๋ฅผ ์ ์ํด์ผ ํฉ๋๋ค. ์๋๋ ๊ทธ ์์์ ๋๋ค.
(defun org-sort-recently-modified-marginalia-annotator-category ()
"Marginalia Annotator Category๋ฅผ ๊ธฐ์ค์ผ๋ก ์ต๊ทผ ์์ ํ ํ์ผ ๋ชฉ๋ก์ ์ ๋ ฌํฉ๋๋ค."
(interactive)
(let ((files (org-agenda-files))
(sorted-files nil))
(dolist (file files)
(with-current-buffer (find-file-noselect file)
(let ((category (org-get-category))
(modified-time (nth 5 (file-attributes file))))
(when (string= category "Marginalia Annotator")
(push (cons file modified-time) sorted-files)))))
(setq sorted-files (sort sorted-files (lambda (a b) (time-less-p (cdr b) (cdr a)))))
(mapc (lambda (file) (message "%s" (car file))) sorted-files)))
์ด ํจ์๋ org-agenda-files
๋ฅผ ํตํด ํ์ฌ ์กฐ์ง๋ชจ๋์์ ๊ด๋ฆฌํ๋ ํ์ผ ๋ชฉ๋ก์ ๊ฐ์ ธ์ต๋๋ค. ๊ฐ ํ์ผ์ ์นดํ
๊ณ ๋ฆฌ๊ฐ โMarginalia Annotatorโ์ธ ๊ฒฝ์ฐ, ํ์ผ์ ์์ ์๊ฐ์ ๊ธฐ์ค์ผ๋ก ๋ชฉ๋ก์ ์ ๋ ฌํฉ๋๋ค. ์ ๋ ฌ๋ ํ์ผ ๋ชฉ๋ก์ ๋ฉ์์ง๋ก ์ถ๋ ฅ๋ฉ๋๋ค.
์ด ํจ์๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด Emacs์์ M-x org-sort-recently-modified-marginalia-annotator-category
๋ฅผ ์คํํ๋ฉด ๋ฉ๋๋ค.
์ฃผ์: ์ด ํจ์๋ ํ์ผ์ ์นดํ
๊ณ ๋ฆฌ๊ฐ ์ ํํ โMarginalia Annotatorโ์ธ ๊ฒฝ์ฐ์๋ง ๋์ํฉ๋๋ค. ๋ค๋ฅธ ์นดํ
๊ณ ๋ฆฌ ์ด๋ฆ์ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด ํจ์ ๋ด์ category
๋ฌธ์์ด์ ํด๋น ์ด๋ฆ์ผ๋ก ๋ณ๊ฒฝํด์ผ ํฉ๋๋ค.
- Citations: [1] https://learn.microsoft.com/ko-kr/visualstudio/ide/find-in-files?view=vs-2022 [2] https://help.worksmobile.com/ko/use-guides/message/group-folder/search-folder/ [3] https://support.microsoft.com/ko-kr/windows/windows%C2%A0%EC%97%90%EC%84%9C-%ED%8C%8C%EC%9D%BC-%EC%B0%BE%EA%B8%B0-5c7c8cfe-c289-fae4-f5f8-6b3fdba418d2 [4] https://support.google.com/drive/answer/2375114?co=GENIE.Platform=Android [5] https://support.google.com/drive/answer/2375114?co=GENIE.Platform=Desktop
@user
TODO 11:18 ๋ฒ๊ทธํฝ์ค ํ์ - vertico childframe
์ฌ๊ธฐ์ ํ์ํ ๊ธฐ๋ฅ์ ์ ์ํด์ ๋ฃ์ด์ผ ํ๋ค. ์ํ์ ๋ค ๊ตฌํ๋ค. ๊ทผ๋ฐ ๋ฃ๊ณ ๋ญ ํ๋๋ฐ 1์๊ฐ ๊ฑธ๋ฆด ๊ฒ ๊ฐ๋ค. ์ ์ ๋๊ธฐ.
/home/junghan/doomemacs-git/modules/completion/vertico/config.el
๋ ์ด๋งฅ์ค ์นดํ ๊ณ ๋ฆฌ
(pushnew! marginalia-command-categories
'(+default/find-file-under-here . file)
'(doom/find-file-in-emacsd . project-file)
'(doom/find-file-in-other-project . project-file)
'(doom/find-file-in-private-config . file)
'(doom/describe-active-minor-mode . minor-mode)
'(flycheck-error-list-set-filter . builtin)
'(persp-switch-to-buffer . buffer)
'(projectile-find-file . project-file)
'(projectile-recentf . project-file)
'(projectile-switch-to-buffer . buffer)
'(projectile-switch-project . project-file))
์์ฒญ๋ ์ฃผ์ ์ด๋ฉฐ ์ค์ํ ์ฃผ์ ๋ค
;;;; marginalia-file and vertico sort modified
(progn
(defun gr/marginalia--annotate-local-file (cand)
"Annotate local file CAND.
Removes modes, which Iโve never needed or wanted."
(marginalia--in-minibuffer
(when-let (attrs (ignore-errors
;; may throw permission denied errors
(file-attributes (substitute-in-file-name
(marginalia--full-candidate cand))
'integer)))
(marginalia--fields
((marginalia--file-size attrs) :face 'marginalia-size :width -7)
((marginalia--time (file-attribute-modification-time attrs))
:face 'marginalia-date :width -12)
;; File owner at the right
((marginalia--file-owner attrs) :face 'marginalia-file-owner)))))
(defun gr/marginalia-annotate-file (cand)
"Annotate file CAND with its size, modification time and other attributes.
These annotations are skipped for remote paths."
(if-let (remote (or (marginalia--remote-file-p cand)
(when-let (win (active-minibuffer-window))
(with-current-buffer (window-buffer win)
(marginalia--remote-file-p (minibuffer-contents-no-properties))))))
(marginalia--fields (remote :format "*%s*" :face 'marginalia-documentation))
(gr/marginalia--annotate-local-file cand)))
;; ์์๋ฅผ ๋ฐ๊พธ๋ฉด ๋๋ค.
(add-to-list 'marginalia-annotator-registry
'(file gr/marginalia-annotate-file marginalia-annotate-file builtin none))
)
vertico multiform
;;;; vertico sort modified
(progn
;; (setq vertico-multiform-categories nil)
;; (setq vertico-multiform-categories
;; '(
;; ;; (file (vertico-sort-function . sort-directories-first))
;; ;; (file (vertico-sort-function . gr/sort-modified))
;; (file (+vertico-transform-functions . +vertico-highlight-directory))
;; ))
;; Sort directories before files
(defun sort-directories-first (files)
(setq files (vertico-sort-history-length-alpha files))
(nconc (seq-filter (lambda (x) (string-suffix-p "/" x)) files)
(seq-remove (lambda (x) (string-suffix-p "/" x)) files)))
(defun gr/sort-modified (list)
"Sort LIST of files for latest modified."
(let ((ht (make-hash-table :test #'equal :size 5000)))
(dolist (x list)
(puthash x (file-attribute-modification-time (file-attributes x)) ht))
(sort list
(lambda (a b)
(let ((one
(gethash a ht))
(two
(gethash b ht)))
(time-less-p two one))))))
(defun vertico-sort-modified ()
(interactive)
(setq-local vertico-sort-override-function
(and (not vertico-sort-override-function)
#'gr/sort-modified)
vertico--input t))
(keymap-set vertico-map "M-," #'vertico-sort-modified)
)