
Let's also tweak swiper's behavior a little further and prepopulate its search term with the active region. It must switch between swiper, isearch, and phi-search depending on what I want (search buffer, define macro, or search multiple cursors). Rather than binding C-s to swiper, let's write a DWIM function that's aware of macros and multiple cursors.

Both wonderful, but neither can rely on swiper to do their thing. Take keyboard macros and multiple cursors.


Swiper services most needs until I start combining with other tools. Swiper is my default goto mechanism and have it bound to C-s (replacing the built-in isearch-forward). I'm a fan of Oleh Krehel's swiper, but before that, I often relied on the built-in isearch. There are no shortages of buffer searching packages for Emacs. I've talked about DWIM in the past, that wonderful Emacs ability to do what ✨I✨ mean.Įmacs being hyper-configurable, we can always teach it more things, so it can do exactly what we mean. Their cookbook has lots of examples that can be easily used via dwim-shell-command-on-marked-files. Take this recent Hacker News post on ocrmypdf as an example. I'll be more inclined to add more of these tiny integrations to lots of great command line utilities. User-password owner-password input output)))))) (output (concat (file-name-sans-extension input) (owner-password (read-passwd "owner-password: ")) ( let* ((user-password (read-passwd "user-password: ")) (downcase (file-name-extension (dired-get-filename nil t)))))) (downcase (file-name-extension (buffer-file-name))))
#GET IPLAYER AUTOMATOR DELETE HISTORY PDF#
"Password protect current pdf in buffer or ` dired ' file." ( defun dwim-shell-command-convert-image-to-icns () (buffer-substring-no-properties at (+ at 1)))))Īs a bonus, it ocurred to me that I could use the same press-and-hold to handle question marks in Spanish (from my UK keyboard). Key Repeat: Fast | Delay Until Repeat: Short. 0.27 seems to work for my macOS keyboard settings. ( let ((last-edit-time accent-menu-monitor-last-edit-time) "Monitors text change BEGINNING, END, and LENGTH." ( defun accent-menu-monitor-text-change (beginning end length) (remove-hook 'after-change-functions #'accent-menu-monitor-text-change t))) (add-hook 'after-change-functions #'accent-menu-monitor-text-change 0 t)) (remove-hook 'after-change-functions #'accent-menu-monitor-text-change t) ( define-minor-mode accent-menu-mode "Toggle ` accent-menu ' if repeated keys are detected." :lighter " accent-menu mode" ( defvar accent-menu-monitor-last-edit-time nil) For now, it gives me something akin to press-and-hold. I'm sure there's a better way (anyone with ideas?). I'm now trying a little experiment using an after-change-functions hook to monitor text input and present the accent menu. Perhaps key chords are still an option for someone who doesn't need the "nn" chord, but being a Spanish speaker, I need that "ñ" from long "n" presses!

While it kinda works, "nn" quickly got in the way of my n/p magit navigation. What other use-cases would you consider? dwim-shell-command is available on melpa. dwim-shell-commands-video-to-optimized-gif.dwim-shell-commands-mpv-stream-clipboard-url.dwim-shell-commands-macos-toggle-display-rotation.dwim-shell-commands-macos-hardware-overview.dwim-shell-commands-install-iphone-device-ipa.dwim-shell-commands-git-clone-clipboard-url-to-downloads.dwim-shell-commands-git-clone-clipboard-url.dwim-shell-commands-files-combined-size.dwim-shell-commands-download-clipboard-url.Since then, I've brought in a bunch of use-cases that are now quickly accessible (all in dwim-shell-commands.el): It's been roughly a month since I started playing around with this idea of wrapping command-line utilities more seamlessly.
