   (use-package csharp-mode :mode "\\.cs$")
   )
 
-(use-package dart-mode :mode "\\.dart$" :interpreter "dart")
-(use-package dos :mode ("\\.bat$" . dos-mode) :config (use-package dos-indent))
-(use-package folio-mode :mode "\\.folio$"
-  :config (use-package folio-electric))
-
-(use-package markdown-mode
-  :mode ("\\.md$" "\\.markdown$"
-         "LICENSE$" "README$" "INSTALL$" "CONTRIBUTORS$" "COPYING$"
-         ))
 (use-package pos-tip :defer t)
-(use-package qt-pro :mode "\\.pro$")
-(use-package json-mode
-  :mode "\\.json$"
-  :if (version< emacs-version "23")
-  )
-
-(use-package nhexl-mode :defer t)
-(use-package sed-mode :mode "\\.sed$" :interpreter "sed")
-;; git
-(use-package gitignore-mode
-  :mode ("/\\.gitignore\\'"
-         "/info/exclude\\'"
-         "/git/ignore\\'"))
-(use-package gitconfig-mode
-  :mode ("/\\.gitconfig\\'"      "/\\.git/config\\'"
-         "/modules/.*/config\\'" "/git/config\\'"
-         "/\\.gitmodules\\'"     "/etc/gitconfig\\'"))
-(use-package gitattributes-mode
-  :mode ("/\\.gitattributes\\'"
-         "/info/attributes\\'"
-         "/git/attributes\\'"))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rainbow ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (use-package rainbow-mode

  :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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

              (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$")
  :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
