Skip to content
Oleh Krehel edited this page Oct 24, 2019 · 1 revision

Bind a commonly used action to a key

For el:counsel-find-file, you can press M-o r to open the file as root. If you use it very often, you can make use of this config:

(defun counsel-ff-as-root ()
  (interactive)
  (ivy-exit-with-action #'counsel-find-file-as-root))
(define-key counsel-find-file-map (kbd "M-r") 'counsel-ff-as-root)