 		  "! ")
 	    (setq flymake-diagnostic-at-point-display-diagnostic-function
 		  'flymake-diagnostic-at-point-display-minibuffer)
-	    (add-hook 'flymake-mode-hook #'flymake-diagnostic-at-point-mode)))
-(add-hook 'find-file-hook 'flymake-find-file-hook)
-(evil-leader/set-key "j" 'flymake-goto-next-error)
-(evil-leader/set-key "k" 'flymake-goto-prev-error)
+	    (add-hook 'flymake-mode-hook #'flymake-diagnostic-at-point-mode)
+	    (evil-leader/set-key "j" 'flymake-goto-next-error)
+	    (evil-leader/set-key "k" 'flymake-goto-prev-error)))
 
 ;; Company for autocompletions
 (use-package company

;; rg.el
(use-package rg
  :ensure t
  :config (progn
	    (defun meain/rg-search (&optional alternate)
	      "Choose between counsel-rg or rg based on ALTERNATE."
	      (interactive "P")
	      (if alternate
		  (call-interactively 'rg)
		(counsel-rg)))
	    (evil-leader/set-key "f" 'meain/rg-search)))

;; dumb-jump
(use-package dumb-jump
  :ensure t
  :config (progn
	    (evil-leader/set-key "J" 'dumb-jump-go)))


;; Code formatting
(use-package srefactor
  :ensure t
  :init (require 'srefactor-lisp))
(use-package format-all
  :ensure t
  :after srefactor
  :config (progn
	    (defun meain/auto-format ()
	      "Custom auto-format based on filetype."
	      (interactive)
	      (if (eq major-mode 'emacs-lisp-mode)
		  (srefactor-lisp-format-buffer)
		(format-all-buffer)))
	    (define-key evil-normal-state-map (kbd ",,") 'meain/auto-format)))

;; Projectile
(use-package projectile
  :ensure t
  :diminish :init
  (projectile-mode 1)
  (evil-leader/set-key "p" 'projectile-switch-project)
  (setq projectile-completion-system 'ivy)
  (setq projectile-sort-order 'recently-active)
  (define-key evil-normal-state-map (kbd "<RET>") 'projectile-find-file))

;; LSP
(use-package eglot
  :ensure t
  :hook ((python-mode . eglot-ensure)
	 (rust-mode . eglot-ensure)):init

	    (setq tab-bar-tab-hints nil)
	    (setq tab-bar-tab-name-function 'tab-bar-tab-name-all)
	    (tab-bar-mode -1)
	    (tab-bar-history-mode -1)))

;; which-key mode (until I fully figure out emacs)
(use-package which-key
