 	company-preview-frontend
 	company-echo-metadata-frontend))
 
-(setq company-auto-complete 'never)
+;;(setq company-auto-complete 'never)
 ;;(company-tng-configure-default)
 
 (use-package go-mode
   :ensure go-mode
   :mode "\\.go\\'"
   :config
-  (add-hook 'go-mode 'before-save-hook 'gofmt-before-save 'flycheck-mode)
-  (remove-hook 'go-mode 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
+  (add-hook 'go-mode 'gofmt-before-save)
+  ;;(remove-hook 'go-mode 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
   (setq gofmt-command "goimports")
   (bind-key "C-M-x" 'aim/run-go-buffer go-mode-map)
   (bind-key "C-M-i" 'helm-company go-mode-map)


(use-package flx)

(use-package counsel
  :config
  (global-set-key (kbd "M-x") 'counsel-M-x)
  (global-set-key (kbd "C-x C-f") 'counsel-find-file)
  (global-set-key (kbd "C-c g") 'counsel-git)
  (global-set-key (kbd "C-c j") 'counsel-git-grep)
  (global-set-key (kbd "C-c a") 'counsel-ag)
  (global-set-key (kbd "C-c r") 'counsel-rg)
  (global-set-key (kbd "C-x l") 'counsel-locate)
  (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history))

(use-package ivy
  :config
  (setq ivy-use-selectable-prompt t
	ivy-use-virtual-buffers t       ; Enable bookmarks and recentf
	ivy-height 10
	ivy-count-format "(%d/%d) "
	ivy-on-del-error-function nil
	ivy-initial-inputs-alist nil
	ivy-count-format " "
	ivy-re-builders-alist '((t . ivy--regex-fuzzy))))

(use-package ivy
  :ensure t
  :diminish (ivy-mode . "")
  :bind
  (:map ivy-mode-map
	("C-'" . ivy-avy))
  :config
  (ivy-mode 1)
  ;; add ‘recentf-mode’ and bookmarks to ‘ivy-switch-buffer’.
  (setq ivy-use-virtual-buffers t)
  ;; number of result lines to display
  (setq ivy-height 10)
  ;; does not count candidates
  (setq ivy-count-format "")
  ;; no regexp by default
  (setq ivy-initial-inputs-alist nil)
  ;; configure regexp engine.
  (setq ivy-re-builders-alist
	;; allow input not in order
        '((t . ivy--regex-ignore-order))))

(use-package ivy-posframe
  :config
  (setq ivy-posframe-height-alist '((swiper . 10)
                                    (t      . 5)))
  (setq ivy-posframe-display-functions-alist
	'((swiper          . nil)
          (complete-symbol . ivy-posframe-display-at-point)
          (counsel-M-x     . ivy-posframe-display-at-window-bottom-left)
          (t               . ivy-posframe-display)))
  (ivy-posframe-mode 1))

(use-package swiper
  :config
  (global-set-key (kbd "C-s") 'swiper))

(use-package yasnippet
  :init


(use-package nix-mode
  :mode "\\.nix\\'"
  :config
  (setq nix-indent-function #'nix-indent-line))

(use-package deadgrep)
(global-set-key (kbd "<f5>") #'deadgrep)
