I hereby claim:
- I am rytswd on github.
- I am rytswd (https://keybase.io/rytswd) on keybase.
- I have a public key ASD2o0bbkQu0b43lm4xrvJm9alLLyDtmA40n7t3uk0_rlgo
To claim this, I am signing this object:
| (defun rytswd/move-text--internal (arg) | |
| "Moves text down or up based on arg input. | |
| There are 6 patterns in total: | |
| 1. (Region) Direction up, with region beginning is where the cursor is at | |
| 2. (Region) Direction up, with region end is where the cursor is at | |
| 3. (Region) Direction down, with region beginning is where the cursor is at | |
| 4. (Region) Direction down, with region end is where the cursor is at | |
| 5. Direction up without region | |
| 6. Direction down without region |
| (defun rytswd/multi-vterm-focus () | |
| "When vterm is active, focus that window. If no vterm is running, start one." | |
| (interactive) | |
| (unless (get-buffer (multi-vterm-project-get-buffer-name)) | |
| (multi-vterm-project)) | |
| (switch-to-buffer-other-window (multi-vterm-project-get-buffer-name)) | |
| ) |
| (defun rytswd/org-add-log-note-set-evil-insert (&rest args) | |
| (when (bound-and-true-p evil-mode) | |
| (evil-insert-state))) | |
| ;; org-add-log-note called by org-add-note and org-agenda-add-note. | |
| (advice-add 'org-add-log-note :after #'rytswd/org-add-log-note-set-evil-insert) |
| (defun rytswd/vterm-execute-current-line-or-region () | |
| "Insert text of current line or region in vterm and execute." | |
| (interactive) | |
| (let* ((current-line (buffer-substring | |
| (save-excursion | |
| (beginning-of-line) | |
| (point)) | |
| (save-excursion | |
| (end-of-line) | |
| (point)))) |
| (defun rytswd/elfeed-search-toggle-unread-filter () | |
| "Update the current Elfeed search filter to toggle \"+unread\"." | |
| (interactive) | |
| (let* ((unread-tag "+unread") | |
| (filter-items (split-string elfeed-search-filter)) | |
| (has-unread (member unread-tag filter-items)) | |
| (filter-items-no-unread (remove unread-tag filter-items))) | |
| (when (not has-unread) | |
| (nconc filter-items-no-unread (list unread-tag))) | |
| (setq elfeed-search-filter (mapconcat 'identity filter-items-no-unread " ")) |
| (defun rytswd/save-without-save-hook () | |
| "This function saves the current buffer without invoking save hook. | |
| This uses a bit of a hacky trick of using ~write-region~ to achieve this. | |
| It may cause some unintended behaviours depending on the context." | |
| (interactive) | |
| (let ((filename (if buffer-file-name buffer-file-name | |
| (read-string "File name to save as: ")))) | |
| (write-region (point-min) (point-max) filename) | |
| (revert-buffer :ignore-auto :noconfirm))) |
| (defun rytswd/duplicate-line-or-region-up (arg) | |
| "Duplicate the current line or selected region upward." | |
| (interactive "*p") | |
| (dotimes (_ arg) | |
| (rytswd/duplicate-line-or-region -1))) | |
| (defun rytswd/duplicate-line-or-region-down (arg) | |
| "Duplicate the current line or selected region downward." | |
| (interactive "*p") | |
| (dotimes (_ arg) |
I hereby claim:
To claim this, I am signing this object: