     "Put thing at point in swiper buffer"
     (interactive)
     (deactivate-mark)
-    (danylo/ivy-with-thing-at-point 'swiper-isearch)
-    )
+    (danylo/ivy-with-thing-at-point 'swiper))
 
 ;;;###autoload
 (defun danylo/counsel-switch-buffer-no-preview ()
   "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 "*ivy-candidate-window*")))
+      (with-current-buffer buffer
+	(setq cursor-type nil) ; Hide cursor
+	(let ((inhibit-read-only t))
+          (erase-buffer)
+	  ;; Remove the first character, which is '\n' (blank line)
+	  (setq danylo/completion-candidate (substring text 1 nil))
+          (insert (substring text 1 nil))))
+      (with-ivy-window
+	(display-buffer
+	 buffer
+	 `((display-buffer-reuse-window display-buffer-below-selected)
+           (window-height . ,(ivy--height (ivy-state-caller ivy-last)))))))))
 
 (use-package counsel)
 (use-package swiper)

	ivy-wrap t
	counsel-switch-buffer-preview-virtual-buffers nil
	ivy-truncate-lines t)
  :config
  (ivy-mode 1))

(use-package ivy-posframe
  ;; https://github.com/tumashu/ivy-posframe
  ;; Let ivy use posframe to show its candidate menu
  :after ivy
  :init
  (setq ivy-posframe-display-functions-alist
	'((t . ivy-posframe-display-at-window-bottom-left)
	  (counsel-find-file . ivy-display-function-fallback))
	ivy-posframe-hide-minibuffer t
	ivy-posframe--ignore-prompt nil
	ivy-posframe-parameters '((left-fringe . 8)
				  (right-fringe . 8)
				  (lines-truncate . t)))
  :config
  (ivy-posframe-mode 1))

;;;###autoload
(defun danylo/ivy-posframe-get-size ()
  "The function which is used to deal with ivy posframe's size."
  (list
   :height ivy-posframe-height
   :width ivy-posframe-height
   :min-height (or ivy-posframe-min-height ivy-height)
   :min-width (or ivy-posframe-min-width (round (* (window-width) 1.0)))))

(with-eval-after-load "ivy-posframe"
  (setq ivy-posframe-size-function #'danylo/ivy-posframe-get-size))

(use-package counsel-projectile
  ;; https://github.com/ericdanan/counsel-projectile

  :custom (fira-code-mode-disabled-ligatures
	   '("[]" "#{" "#(" "#_" "#_(" "x" "&&"))
  :config
  (add-hook 'prog-mode-hook (lambda () (when (window-system) (fira-code-mode))))
  )

;; Speed up font-lock mode speed (can causes laggy scrolling)
