style: Rename custom functions from slash to dash convention
This commit is contained in:
@@ -20,9 +20,10 @@
|
||||
(defun disable-truncate-lines ()
|
||||
(toggle-truncate-lines 1))
|
||||
|
||||
(defun my/jinx-smart-toggle ()
|
||||
(defun my-jinx-smart-toggle ()
|
||||
"Toggle jinx-mode smartly.
|
||||
Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise toggle global-jinx-mode."
|
||||
Disable jinx-mode if it's enable and global-jinx-mode is disable ,
|
||||
otherwise toggle global-jinx-mode."
|
||||
(interactive)
|
||||
(unless (featurep 'jinx)
|
||||
(require 'jinx))
|
||||
@@ -52,9 +53,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(interactive "fOpen externally: ")
|
||||
(if (and (eq system-type 'windows-nt)
|
||||
(fboundp 'w32-shell-execute))
|
||||
(shell-command-to-string (encode-coding-string (replace-regexp-in-string "/" "\\\\"
|
||||
(format "explorer.exe %s" (file-name-directory (expand-file-name file))))
|
||||
'gbk))
|
||||
(shell-command-to-string
|
||||
(encode-coding-string
|
||||
(replace-regexp-in-string "/" "\\\\"
|
||||
(format "explorer.exe %s"
|
||||
(file-name-directory
|
||||
(expand-file-name file))))
|
||||
'gbk))
|
||||
(call-process (pcase system-type
|
||||
('darwin "open")
|
||||
('cygwin "cygstart")
|
||||
@@ -68,11 +73,11 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(consult-directory-externally default-directory))
|
||||
|
||||
(defun consult-fd-home ()
|
||||
"Search for all files in home folder use fd."
|
||||
(interactive)
|
||||
(let ((consult-fd-args "fd -H -I -i -c never --full-path")
|
||||
(default-directory "~/"))
|
||||
(consult-fd)))
|
||||
"Search for all files in home folder use fd."
|
||||
(interactive)
|
||||
(let ((consult-fd-args "fd -H -I -i -c never --full-path")
|
||||
(default-directory "~/"))
|
||||
(consult-fd)))
|
||||
|
||||
(defun org-cycle-parent-subtree()
|
||||
"Cycle parent org subtree."
|
||||
@@ -87,7 +92,8 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(defun my-denote-journal-path-to-existing-entry (&optional date interval)
|
||||
"Return the path of current denote journal if it exists, otherwise return nil."
|
||||
(require 'denote-journal)
|
||||
(let* ((internal-date (denote-journal--date-in-interval-p (or date (current-time)) interval))
|
||||
(let* ((internal-date
|
||||
(denote-journal--date-in-interval-p (or date (current-time)) interval))
|
||||
(files (denote-journal--get-entry internal-date interval)))
|
||||
(if files
|
||||
(denote-journal-select-file-prompt files))))
|
||||
@@ -100,9 +106,11 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(message "No journal for today yet")))
|
||||
|
||||
(defun my-denote-open-metanote ()
|
||||
"Open denote metanote in `~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org'"
|
||||
"Open denote metanote in
|
||||
`~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org'"
|
||||
(interactive)
|
||||
(find-file "~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org"))
|
||||
(find-file
|
||||
"~/org/my-org-note/20260508T220745==metanote--all-my-metanotes__org.org"))
|
||||
|
||||
(defun org-table-align-all ()
|
||||
"Ajust all table in current buffer."
|
||||
@@ -186,7 +194,8 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(dired-move-to-filename))
|
||||
|
||||
(defun my-dirvish-layout-toggle ()
|
||||
"Toggle layout using first recipe in `dirvish-layout-recipes' instead of fallback."
|
||||
"Toggle layout using first recipe in `dirvish-layout-recipes' instead of
|
||||
fallback."
|
||||
(interactive)
|
||||
(let ((dv (dirvish-curr)))
|
||||
(unless dv (user-error "Not a dirvish buffer"))
|
||||
@@ -230,7 +239,8 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(persp-set-buffer buf))))
|
||||
|
||||
(defun my-gptel-agent-project ()
|
||||
"Run `gptel-agent' in current project's root (by run it with prefix argument)."
|
||||
"Run `gptel-agent' in current project's root (by run it with prefix
|
||||
argument)."
|
||||
(interactive)
|
||||
(let ((current-prefix-arg '-))
|
||||
(call-interactively 'gptel-agent)))
|
||||
@@ -284,13 +294,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(start-process-shell-command "xinput" nil "xinput set-prop 12 'libinput Accel Speed' -0.45"))
|
||||
|
||||
(defun restart-fcitx5 ()
|
||||
"Kill and restart fcitx5, to fix random issues in exwm."
|
||||
(interactive)
|
||||
(if (zerop (shell-command "pgrep fcitx5"))
|
||||
(progn
|
||||
(eshell-command "pkill fcitx5")
|
||||
(eshell-command "fcitx5 -d"))
|
||||
(eshell-command "fcitx5 -d"))))
|
||||
"Kill and restart fcitx5, to fix random issues in exwm."
|
||||
(interactive)
|
||||
(if (zerop (shell-command "pgrep fcitx5"))
|
||||
(progn
|
||||
(eshell-command "pkill fcitx5")
|
||||
(eshell-command "fcitx5 -d"))
|
||||
(eshell-command "fcitx5 -d"))))
|
||||
|
||||
(provide 'init-kbd-func)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user