1

Is there a way to tell emacs ignore kill that are less than 4 characters long? It is quite annoying to have a lot of single character kills in evil mode. Thank you!

1 Answers1

1

The filter mechanism is already in 24.4. Thanks to glucas. https://emacs.stackexchange.com/questions/8097/how-do-i-filter-kill-ring-contents

(defvar kill-ring-entry-length 3)
(defun my/replace-blank-kill (args)
  (let ((string (car args))
        (replace (cdr args))
        (last (car-safe kill-ring)))
    (when (or (and last (string-blank-p last))
           (< (length last) kill-ring-entry-length))
      (setq replace t))
    (list string replace)))

(advice-add 'kill-new :filter-args #'my/replace-blank-kill)