 (show-paren-mode t)                           ;; show matching parens
 (delete-selection-mode t)                     ;; delete the selection with a keypress like every other editor
 (blink-cursor-mode -1)                        ;; the blinking cursor is nothing, but an annoyance
-
-(setq inhibit-startup-message t)              ;; hide the startup message
-(setq make-backup-files nil)                  ;; dont make backup files
-(setq column-number-mode t)                   ;; display the column and line number
-
-;; Make emacs more performant
-(setq gc-cons-threshold 50000000)             ;; run gc every 50mb instead of 0.7mb
-(setq large-file-warning-threshold 100000000) ;; warn when opening files larger than 100MB
-
-;; Disable annoyinb bell and startup screen
-(setq ring-bell-function 'ignore)             ;; disable the annoying bell
-(setq inhibit-startup-screen t)               ;; disable startup screen
-
-;; nice scrolling
-(setq scroll-margin 0
-      scroll-conservatively 100000
-      scroll-preserve-screen-position 1)
-
-;; mode line settings
-(global-linum-mode t) ;; enable line numbers globally
+(global-linum-mode t)                         ;; enable line numbers globally
 (line-number-mode t)
 (column-number-mode t)
 (size-indication-mode t)
+(setq inhibit-startup-message t)              ;; hide the startup message
+(setq ring-bell-function 'ignore)             ;; disable the annoying bell
+(setq require-final-newline t)                ;; Newline at the end of the file, always
 
-;; enable y/n answers
-(fset 'yes-or-no-p 'y-or-n-p)
-
-(set-face-attribute 'default nil :font "Fira Code Retina-12")
-(set-frame-font "Fira Code Retina-12" nil t)
-
-;; more useful frame title
-(setq frame-title-format
-      '((:eval (if (buffer-file-name)
-                   (abbreviate-file-name (buffer-file-name))
-                 "%b"))))
-
-(setq-default indent-tabs-mode nil)   ;; don't use tabs to indent
-(setq-default tab-width 8)            ;; but maintain correct appearance
-(setq require-final-newline t)        ;; Newline at the end of the file, always
-
-;; revert buffers automatically when underlying files are changed externally
-(global-auto-revert-mode t)
-
-;; Ensure we're using UTF-8 always
-(prefer-coding-system 'utf-8)
-(set-default-coding-systems 'utf-8)
-(set-terminal-coding-system 'utf-8)
-(set-keyboard-coding-system 'utf-8)
-
-;; configure package repository
-(require 'package)
-(setq package-enable-at-startup nil)
-(setq package-archives '(("org" . "http://orgmode.org/elpa/")
-                         ("gnu" . "http://elpa.gnu.org/packages/")
-                         ("melpa" . "https://melpa.org/packages/")))
-(package-initialize)
-
-;; install use-package if we dont have it
-(unless (package-installed-p 'use-package)
-  (package-refresh-contents)
-  (package-install 'use-package))
-(require 'use-package)
-
-(use-package paren
-  :config
-  (show-paren-mode +1))
-
-(use-package elec-pair
-  :config
-  (electric-pair-mode +1))
-
-(use-package hl-line
-  :config
-  (global-hl-line-mode +1))
+;; Fancy titlebar for macOS
+;; Removes the dark gray titlebar from macOS window
+(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
+(add-to-list 'default-frame-alist '(ns-appearance . darl))
+(setq ns-use-proxy-icon nil)
+(setq frame-title-format nil)
 
 ;; Better integration with macOS shell
 (use-package exec-path-from-shell

 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   (quote
    (nord-theme github-theme mermaid-mode htmlize salt-mode ansible yaml-mode groovy-mode sql-indent lsp-mode exec-path-from-shell))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.

    (exec-path-from-shell-initialize)
    (exec-path-from-shell-copy-env "GOPATH")))

;; Use spaces instead of tabs
(setq-default indent-tabs-mode nil)

;; Wrap everything at 80 char
(add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))

;; Enable UTF-8 Everywhere
(prefer-coding-system 'utf-8-unix)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(set-file-name-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)

;; Use macOS Built In Menlo Font
(set-face-attribute 'default nil
		    :font "Menlo-12"
                    :height 100
                    :weight 'normal
                    :width 'normal)
(set-frame-font "Menlo-12" nil t)

(use-package magit
  :ensure t
  :bind (("C-x g" . magit-status)
         ("C-x M-g" . magit-dispatch)))

(use-package projectile
  :ensure t
  :config
  (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
  (projectile-mode +1))
  
(use-package treemacs
  :ensure t
  :bind
  (:map global-map
        ("C-<f8>" . treemacs-select-window)
        ([f8]     . treemacs))
  :config
  (setq treemacs-is-never-other-window t))

(use-package treemacs-projectile
  :after treemacs projectile
  :ensure t)

(use-package treemacs-magit
  :after treemacs magit
  :ensure t)

;; Only trim whitespace for lines you have edited
(use-package ws-butler
  :ensure t
  :config
  (ws-butler-global-mode)
  (setq ws-butler-keep-whitespace-before-point nil))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
