   :init
   (which-function-mode 1))
 
-;; load ESS for R & julia
+;; load ESS for R
 (use-package ess-site
-  :mode (("\\.jl$" . ess-julia-mode)
-         ("\\.R$"  . R-mode))
-  :config
-  (add-hook 'ess-mode-hook 'company-mode)
-  (add-hook 'ess-julia-mode-hook
-            (lambda()
-              (define-key
-                ess-julia-mode-map (kbd "TAB") 'julia-latexsub-or-indent)))
-  )
+  :mode (("\\.R$"  . R-mode))
+  :config
+  (add-hook 'ess-mode-hook 'company-mode))
+
+(use-package julia-mode
+  :ensure t
+  :mode ("\\.jl$" . julia-mode)
+  :config
+  (add-hook 'julia-mode-hook 'flycheck-mode))
+
+(use-package lsp-julia
+  :after (lsp-mode julia-mode)
+  :config
+  (add-hook 'julia-mode-hook #'lsp-julia-enable))
+
+(use-package julia-repl
+  :ensure t
+  :commands julia-repl-mode
+  :hook (julia-mode . julia-repl-mode))
+
+(use-package company-lsp
+  :after (company lsp-mode)
+  :ensure t
+  :config
+  (setq company-lsp-enable-snippet t
+        company-lsp-cache-candidates nil
+        company-transformers nil
+        company-lsp-async t)
+  (push '(company-lsp :with company-yasnippet) company-backends))
+
 
 ;; auctex
 (use-package auctex

                 "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
                ("h" "Habit" entry (file "~/Dropbox/notes/scratch.org")
                 "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
  (use-package ox-reveal
               :defer t)
  (use-package org-pdfview
    :ensure t
    :defer t)

  ;; open by extension
  (setq dired-open-extensions '(
                                ("djvu" . "zathura")
                                ("mkv"  . "mpv")
                                ("mp4"  . "mpv")
                                ("mp3"  . "mpv")
                                ))
  ;; sort number naturally
  (setq dired-listing-switches "--group-directories-first -v -al")
