 
 ;; X11 keyboard in console
 (xclip-mode 1)
-; enable projectile globally
+
+;;;; scrolling
+(setq scroll-step 1)
+(setq scroll-conservatively 10000)
+(setq auto-window-vscroll nil)
+;; for smooth scrolling and disabling the automatical recentering of emacs when moving the cursor
+(setq scroll-margin 1
+scroll-up-aggressively 0.01
+scroll-down-aggressively 0.01)
+
 (projectile-global-mode)
-;; annoying scrolling
-;(setq scroll-step 1)
-;(setq scroll-conservatively 10000)
-;(setq auto-window-vscroll nil)
-;(setq scroll-margin 1
-;scroll-conservatively 0
-;scroll-up-aggressively 0.01
-;scroll-down-aggressively 0.01)
-
-;; FIX Scrolling
-;; from
-;; http://web.archive.org/web/20061025212623/http://www.cs.utexas.edu/users/hllu/EmacsSmoothScrolling.html
-;; only thing that works
-(setq truncate-lines t)
-
-(defun point-of-beginning-of-bottom-line ()
-  (save-excursion
-    (move-to-window-line -1)
-    (point)))
-
-(defun point-of-beginning-of-line ()
-  (save-excursion
-    (beginning-of-line)
-    (point)))
-
-(defun next-one-line () (interactive)
-  (if (= (point-of-beginning-of-bottom-line) (point-of-beginning-of-line))
-      (progn (scroll-up 1)
-             (next-line 1))
-    (next-line 1)))
-
-(defun point-of-beginning-of-top-line ()
-  (save-excursion
-    (move-to-window-line 0)
-    (point)))
-
-(defun previous-one-line () (interactive)
-  (if (= (point-of-beginning-of-top-line) (point-of-beginning-of-line))
-      (progn (scroll-down 1)
-             (previous-line 1))
-    (previous-line 1)))
-
-(global-set-key (kbd "<down>") 'next-one-line)
-(global-set-key (kbd "<up>") 'previous-one-line)
 
 ;;;;;;;;;;;;;;
 (flycheck-mode)

(set-default-font "DejaVu Sans Mono")
;(set-face-attribute 'default nil :height 100)

(when (fboundp 'tool-bar-mode)
  (tool-bar-mode -1))
(menu-bar-mode -1)
;; the blinking cursor is nothing, but an annoyance
(blink-cursor-mode -1)
;; disable startup screen

;;
(require 'cl)
(require 'package)

;; do this early
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
;;(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))

;;(add-to-list 'package-archives
;;             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
