   "Switch to another buffer without preview."
   (interactive)
   (ivy-switch-buffer))
+
+;;;###autoload
+(defun danylo/ivy-display-function-window (text)
+  "Show ivy candidate completion list in a temporary buffer, like Helm."
+  (when (> (length text) 0)
+    (let ((buffer (get-buffer-create danylo/ivy-window-name)))
+      (with-current-buffer buffer
+	(setq cursor-type nil) ;; Hide cursor
+	(let ((inhibit-read-only t))
+	  (erase-buffer)
+	  (setq danylo/completion-candidate-list
+		;; Remove the first character, which is '\n' (blank line)
+		(substring text 1 nil))
+	  (insert danylo/completion-candidate-list)
+	  )
+	)
+      (with-ivy-window
+	(let ((window (selected-window)))
+	  (if (window-parameter window 'window-side)
+	      ;; In side window
+	      ;; Cannot use display-buffer-below-selected because a
+	      ;; side window cannot be split (most likely)
+	      (display-buffer
+	       buffer
+	       `((display-buffer-reuse-window display-buffer-pop-up-window)
+		 (window-height . ,(ivy--height (ivy-state-caller ivy-last)))))
+	    ;; In regular window
+	    (display-buffer
+	     buffer
+	     `((display-buffer-reuse-window display-buffer-below-selected)
+	       (window-height . ,(ivy--height (ivy-state-caller ivy-last))))))))
+      )
+    )
+  )
+
+(defun danylo/side-window-tmp ()
+  (interactive)
+  (display-buffer-in-side-window (get-buffer "*Messages*") '((side . right))))
 
 (use-package ivy-prescient
   ;; https://github.com/raxod502/prescient.el

	 ("C-l" . ivy-backward-delete-char)
	 ("TAB" . ivy-alt-done))
  :init
  (setq ivy-use-virtual-buffers nil
	enable-recursive-minibuffers t
	;; Remove the default "^" in search string
	;; Source: https://emacs.stackexchange.com/a/38842/13661

  (add-to-list 'ivy-ignore-buffers '"\\\\*ivy-")
  :config
  (ivy-mode 1))

(use-package helm
  ;; https://emacs-helm.github.io/helm/
