 (smooth-scrolling-mode 1)
 
 
-;; enable mouse scrolling only in terminal-mode
-;; https://www.iterm2.com/faq.html
-(when (eq (display-graphic-p) nil)
-  (require 'mwheel)
-  (require 'mouse)
-  (xterm-mouse-mode t)
-  (mouse-wheel-mode t)
-  (global-set-key [mouse-4] 'previous-line)
-  (global-set-key [mouse-5] 'next-line))
-
-
 ;; scroll conservatively when using mouse wheel or trackpad
 (setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
 (setq mouse-wheel-progressive-speed nil)



;; use Solarized-dark as default theme
(when (display-graphic-p)
  (customize-set-variable 'frame-background-mode 'dark)
  (load-theme 'solarized-dark t))


;; switch between Solarized dark and light theme
(defun set-solarized-light ()
  (interactive)
  (customize-set-variable 'frame-background-mode 'light)
  (load-theme 'solarized-light t))

(defun set-solarized-dark ()
  (interactive)
  (customize-set-variable 'frame-background-mode 'dark)
  (load-theme 'solarized-dark t))

(defun toggle-solarized-theme ()
     "Toggle between Solarized light/dark color scheme."
    (interactive)
    (if (eq frame-background-mode 'dark)
          (set-solarized-light)
      (set-solarized-dark)))

(global-set-key (kbd "<f12>") 'toggle-solarized-theme)


;; set frame title

;; additional hooks
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'before-save-hook 'delete-trailing-whitespace)


;; flyspell configuration - turn on automatic spell check for
;; text/prog modes
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)


;; activate smart-mode-line
