 
 (advice-add 'xclip-selection-value :around #'xclip-tramp-fix)
 (advice-add 'xclip-select-text :around #'xclip-tramp-fix)
-(xclip-mode 1)
-(turn-on-xclip)
+(use-package xclip
+  :ensure t
+  :config
+  (progn (xclip-mode 1) (turn-on-xclip))
+)
 
 ;;;; scrolling
 (setq scroll-step 1)
 (setq scroll-conservatively 10000)
 (setq auto-window-vscroll nil)
 
-(projectile-global-mode)
-
-;;;;;;;;;;;;;
-(setq flycheck-highlighting-mode 'lines)
-(add-hook 'after-init-hook #'global-flycheck-mode)
-(setq flycheck-check-syntax-automatically '(mode-enabled save idle-change))
-(eval-after-load 'flycheck
-  '(custom-set-variables
-   '(flycheck-display-errors-function #'flycheck-pos-tip-error-messages)))
-
-
-;(require 'ido-vertical-mode)
-(require 'flx-ido)
-(ido-mode 1)
-;(ido-vertical-mode 1)
-(ido-everywhere 1)
-(flx-ido-mode 1)
-;; disable ido faces to see flx highlights.
-(setq ido-use-faces nil)
-(setq ido-create-new-buffer 'always)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Common programming and tools
+;;
+(use-package multi-term :ensure t)
+
+(use-package projectile
+  :ensure t
+  :config (projectile-global-mode t)
+  :diminish projectile-mode
+)
+
+(use-package company
+  :ensure t
+  :config (add-hook 'prog-mode-hook 'company-mode))
+
+(use-package magit :ensure t)
+
+(use-package flycheck
+  :ensure t
+  :defer t
+  :init
+  (defun my-flycheck-prog-mode-hook ()
+    (flycheck-mode t))
+  (add-hook 'prog-mode-hook 'my-flycheck-prog-mode-hook))
+
+(use-package flycheck-pos-tip
+  :ensure t
+  :after (flycheck)
+  :config
+  (with-eval-after-load 'flycheck (flycheck-pos-tip-mode)))
 
 ;; Auto refresh buffers
 (global-auto-revert-mode 1)

              vc-ignore-dir-regexp
              tramp-file-name-regexp))

;; work setup
(if (file-exists-p "~/.emacs.suse.d/init.el")
    (load-file "~/.emacs.suse.d/init.el"))

(require 'org)
(setq org-src-fontify-natively t)
(setq org-fontify-whole-heading-line t)
(setq org-pretty-entities t)

;; Org mode
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(define-key org-mode-map (kbd "M-RET") nil)

;; org-trello major mode for all .trello files
(add-to-list 'auto-mode-alist '("\\.trello$" . org-mode))

;; add a hook function to check if this is trello file, then activate the org-trello minor mode.
(add-hook 'org-mode-hook
          (lambda ()
            (let ((filename (buffer-file-name (current-buffer))))
              (when (and filename (string= "trello" (file-name-extension filename)))
              (org-trello-mode)))))

(provide 'init)
;;; init.el ends here

(setq shift-select-mode nil)
(setq x-alt-keysym 'meta)

(use-package nav
  :ensure t
  :config
  (nav-disable-overeager-window-splitting))

; highlight the current line
(global-hl-line-mode t)

; tabs
(setq tabbar-ruler-global-tabbar t) ; If you want tabbar
(use-package tabbar-ruler
  :ensure t
  :config
  (tabbar-ruler-group-by-projectile-project))

(mapc
  (lambda (face)
