deft icon indicating copy to clipboard operation
deft copied to clipboard

possible to use call deft-open-file-in-other-window on file selection instead of the default?

Open jmcmichael opened this issue 7 years ago • 1 comments

I'd like for deft to open files in another window by default, instead of replacing the deft buffer. I didn't see immediately how this is possible reading the docs and issues. I'm not very good with elisp beyond editing config files and I'm about to dig into the deft code to see if I can figure this out, thought I'd ask on here as well.

Also, thank you so much for this app, I'm probably going to switch from Notational Velocity to deft in order to avoid switching out of spacemacs.

jmcmichael avatar Nov 29 '17 22:11 jmcmichael

This is an old question and I'm no lisp guru myself, but I thought I'd share what I'm currently using.

First, define a personal function to open the file from deft in the other window. The argument t is there to also move focus to that window after opening the file.

(defun efls/deft-open ()
 (interactive)
 (deft-open-file-other-window t)
)

Next, let's bind this to the major mode leader key in spacemacs:

(with-eval-after-load 'deft
  (define-key spacemacs-deft-mode-map-prefix
    "o" 'efls/deft-open)
 )

Now you should be able to hit , o from the deft buffer, to open the file in the other window. This doesn't make it the default, but its easy enough.

EFLS avatar Jul 08 '18 20:07 EFLS