我之前使用Emacs自带的find-file,定义了以下函数绑定到快捷键上。
(defun my/find-file-horizontally (filename &optional wildcards)
(interactive
(find-file-read-args "Find file in horizontal window: "
(confirm-nonexistent-file-or-buffer)))
(let ((value (find-file-noselect filename nil nil wildcards))
(target (split-window-horizontally)))
(select-window target)
(if (listp value)
(mapcar 'pop-to-buffer-same-window (nreverse value))
(pop-to-buffer-same-window value))))
现在使用counsel-find-file,有没有好的思路可以实现上述功能。