               (my/syntax-color-hex-values))
             ))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; json-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package json-mode
+  :mode "\\.json$"
+  :if (version< emacs-version "23")
+  )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; log-viewer-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package log-viewer :mode ("\\.log$" . log-viewer-mode))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; markdown-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package markdown-mode
+  :mode ("\\.md$" "\\.markdown$"
+         "LICENSE$" "README$" "INSTALL$" "CONTRIBUTORS$" "COPYING$"
+         ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; nhexl-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package nhexl-mode :defer t)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; python-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(eval-and-compile
+  (add-to-list 'load-path (concat my/elisp-directory "emacs-jedi/")))
+(use-package python
+  :if (executable-find "python")
+  :defer t
+  :config
+  (use-package virtualenvwrapper)
+                                        ;(setq venv-location "?")
+  ;; add jedi if installed
+  (when (eq 0 (call-process "python" nil nil nil "-c" "import jedi"))
+                                        ;      (setq jedi:setup-keys t)
+    (setq jedi:complete-on-dot t)
+    (setq jedi:tooltip-method '(popup))
+    (use-package jedi)
+    (use-package direx)
+    (use-package jedi-direx)
+    (add-hook 'jedi-mode-hook 'jedi-direx:setup)
+    (add-hook 'python-mode-hook 'jedi:setup)
+    (defun my/expand-jedi() (interactive)
+           (auto-complete '(ac-source-jedi-direct)))
+    )
+  (unless (executable-find "flake8")
+    (add-to-list 'flycheck-disabled-checkers 'python-flake8)
+    (add-to-list 'flycheck-checkers 'python-pyflakes)
+    (use-package flycheck-pyflakes)
+    )
+  (add-hook 'python-mode-hook
+            (lambda()
+              (setq-default indent-tabs-mode nil)
+              (setq python-indent-guess-indent-offset nil)
+              (setq python-indent-offset 4)
+              (setq-local electric-indent-chars
+                          (remq ?: electric-indent-chars))
+              (setq forward-sexp-function nil)
+              (define-key python-mode-map "\C-j" 'newline-and-indent)
+              (define-key python-mode-map "\C-c\C-c" 'comment-region)
+              (define-key python-mode-map "\C-c\C-u" 'uncomment-region)
+              (define-key python-mode-map [?\C-\M-g] 'python-nav-forward-sexp)
+              (define-key python-mode-map (kbd "\C-c RET")
+                (lambda()(interactive)
+                  (compile (concat "python " (buffer-file-name)))))
+              (when (featurep 'jedi)
+                (define-key python-mode-map [(ctrl tab)] 'my/expand-jedi)
+                (define-key python-mode-map "\C-cx" 'jedi-direx:pop-to-buffer))
+              )))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; qt-pro-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package qt-pro :mode "\\.pro$")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sed-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(use-package sed-mode :mode "\\.sed$" :interpreter "sed")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sh-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(add-hook 'sh-mode-hook
+          (lambda()
+            (setq-default indent-tabs-mode nil)
+            ;; (idle-highlight-mode 1)
+            (define-key sh-mode-map "\r" 'reindent-then-newline-and-indent)
+            (setq sh-basic-offset 3)
+            (setq sh-indentation 3)
+            (define-key sh-mode-map "\C-c\C-c" 'comment-region)
+            (define-key sh-mode-map "\C-c\C-u" 'uncomment-region)
+            (add-to-list 'flycheck-disabled-checkers 'sh-posix-dash)
+            ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xml-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(add-hook 'nxml-mode-hook
+          (lambda()
+            (setq-default indent-tabs-mode nil)
+            ;; (idle-highlight-mode 1)
+            (define-key nxml-mode-map "\r" 'reindent-then-newline-and-indent)
+            (define-key nxml-mode-map "\C-c\C-c" 'comment-region)
+            (define-key nxml-mode-map "\C-c\C-u" 'uncomment-region)
+            ))
+(require 'mz-comment-fix)
+;; the following is a hack to fix nested XML commenting in Emacs 24.
+;; Note that 'comment-strip-start-length also exists for other modes if needed.
+(add-to-list 'comment-strip-start-length (cons 'nxml-mode 3))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; yaml-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (use-package yaml-mode
-             :mode ("\\.yaml$" "\\.yml$")
-             )
-;; (add-hook 'yaml-mode-hook
-;;           (lambda()
-;;             ))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; css-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(add-hook 'css-mode-hook
-          (lambda()
-            (if (featurep 'rainbow-mode)
-                (rainbow-turn-on)
-              (my/syntax-color-hex-values))
-            ))
-
-(defun yaml-next-field() "Jump to next yaml field."
-       (interactive)
-       (search-forward-regexp ": *"))
-(defun yaml-prev-field() "Jump to previous yaml field."
-       (interactive)
-       (search-backward-regexp ": *"))
-(add-hook 'yaml-mode-hook
-          (lambda()
-            (define-key yaml-mode-map "\C-m" 'newline-and-indent)
-            (define-key yaml-mode-map "\M-\r" 'insert-ts)
-            (define-key yaml-mode-map (kbd "C-<tab>") 'yaml-next-field)
-            (define-key yaml-mode-map (kbd "C-S-<tab>") 'yaml-prev-field)
-            ))
+  :mode ("\\.yaml$" "\\.yml$")
+  :config
+  (defun yaml-next-field() "Jump to next yaml field."
+         (interactive)
+         (search-forward-regexp ": *"))
+  (defun yaml-prev-field() "Jump to previous yaml field."
+         (interactive)
+         (search-backward-regexp ": *"))
+  (add-hook 'yaml-mode-hook
+            (lambda()
+              (define-key yaml-mode-map "\C-m" 'newline-and-indent)
+              (define-key yaml-mode-map "\M-\r" 'insert-ts)
+              (define-key yaml-mode-map (kbd "C-<tab>") 'yaml-next-field)
+              (define-key yaml-mode-map (kbd "C-S-<tab>") 'yaml-prev-field)
+              )))
 
 ;; code ends here

  :commands uniquify-recentf-ivy-recentf-open uniquify-recentf-ido-recentf-open
  :if (version< "24.3" emacs-version)
  :config
  (setq uniquify-recentf-func 'uniquify-recentf-ido-recentf-open)
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ido ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  (use-package csharp-mode :mode "\\.cs$")
  )

(use-package pos-tip :defer t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rainbow ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package rainbow-mode
