   :ensure t
   :init
   (projectile-rails-global-mode)
-)
+  )
 
 (use-package go-mode
   :ensure t
-)
+  )
 
 (use-package git-gutter
   :ensure t
   :init (global-git-gutter-mode)
-)
+  )
+
+(use-package all-the-icons
+  :ensure t
+  )
+
+(use-package smartparens
+  :ensure t
+  :init (smartparens-global-mode)
+  )
+
+(use-package lsp-mode
+  :ensure t
+  :hook (prog-mode . lsp))
+
+;; Set up before-save hooks to format buffer and add/delete imports.
+;; Make sure you don't have other gofmt/goimports hooks enabled.
+(defun lsp-go-install-save-hooks ()
+  (add-hook 'before-save-hook #'lsp-format-buffer t t)
+  (add-hook 'before-save-hook #'lsp-organize-imports t t))
+(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)
+
+(use-package company-lsp
+  :ensure t
+  :init (push 'company-lsp company-backends))
+
+(use-package lsp-ui
+  :ensure
+  )
 
 (use-package general :ensure t
   :config

   "TAB" '(other-window :which-key "other window")
   "b"  '(:ignore t :which-key "buffers")
   "bb" '(helm-buffers-list t :which-key "helm-buffers-list")
   "d"  '(:ignore t :which-key "describe")
   "df" '(describe-function :which "function")
   "dv" '(describe-variable :which "variable")
   "dk" '(describe-key :which "key")
   "e"  '(:ignore t :which-key "emacs")
   "ee" '((lambda () (interactive)(find-file "~/.emacs")) :which-key "open .emacs")
   "er" '((lambda () (interactive)(load-file "~/.emacs")) :which-key "reload .emacs")
   "f"  '(:ignore t :which-key "files")
   "ff" '(helm-find-files :which-key "find files")
   "fg" '(helm-rg :which-key "grep files")
   "fr" '(helm-recentf :which-key "recent files")
   "g"  '(:ignore t :which-key "git")
   "gs" '(magit-status :which-key "git status")
   "p"  '(:ignore t :which-key "projectile")
   "pf" '(helm-projectile-find-file :which-key "projects find file")
   "pp" '(helm-projectile-switch-project :which-key "projects")
   "pr" '(helm-projectile-rg :which-key "projects grep")
   "r"  '(:ignore t :which-key "ruby")
   "rc" '(inf-ruby-console-auto :which-key "ruby console")
   "rd" '(robe-doc :which-key "robe doc")
   "rj" '(robe-jump :which-key "robe jump")
   "s"  '(split-window-vertically :which-key "split vertically")
   "v"  '(split-window-horizontally :which-key "split horizontally")
   "w"  '(:ignore t :which-key "window")
   "wh" '(windmove-left :which-key "move left")
   "wj" '(windmove-down :which-key "move down")


;; Disable scroll bar
(scroll-bar-mode -1)
;; Show matching parentheses
(show-paren-mode 1)

;; Follow symlinks
(setq vc-follow-symlinks nil)

;; Do not use built-in version control package, we have magit
(setq vc-handled-backends nil)

;; Append new line at end of file
(setq require-final-newline t)

;; Delete trailing whitespace
(add-hook 'before-save-hook 'delete-trailing-whitespace)

;; Use tmp dir for auto saves and backup files
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

;; Start emacs maximized
(add-to-list 'default-frame-alist '(fullscreen . maximized))
