<commit_before>#+TITLE: Emacs configuration

* use-package
#+BEGIN_SRC emacs-lisp
(setq use-package-always-ensure t)
#+END_SRC

* company
#+BEGIN_SRC emacs-lisp
(use-package company)
#+END_SRC

* evil
#+BEGIN_SRC emacs-lisp
;; fix tab key for org mode
(use-package evil
  :init
  (setq-default evil-want-C-i-jump nil)
  :config
  (use-package evil-magit)
  (use-package org-evil)
  (evil-mode t)
  (setq-default evil-shift-left 1)
  (setq-default evil-shift-right 1)
  (setq-default evil-shift-width 2)
  (use-package evil-vimish-fold)
  (evil-vimish-fold-mode 1)
  (use-package evil-ediff))
#+END_SRC

* git-gutter
#+BEGIN_SRC emacs-lisp
(use-package git-gutter
  :config
  (global-git-gutter-mode +1))
#+END_SRC

* org
#+BEGIN_SRC emacs-lisp
(use-package org
  :init
  (org-babel-do-load-languages
    'org-babel-load-languages
      '((emacs-lisp . t)))
  (setq-default org-confirm-babel-evauluate nil)
  (global-set-key (kbd "C-c c") 'org-capture)
  (setq-default org-capture-templates
    '(("i" "inbox" entry
      (file+headline "~/.notes/main.org" "Inbox")
      "* TODO [%t] %i%?")))
  (global-set-key
    (kbd "C-c o")
    (lambda () (interactive)
      (find-file "~/.notes/main.org")))
  (setq org-default-notes-file "~/.notes/main.org")
  (setq org-refile-targets '(("~/.notes/main.org" :maxlevel . 3))))
#+END_SRC

* js2
#+BEGIN_SRC emacs-lisp
(use-package js2-mode
  :mode ("\\.js\\'" . js2-mode)
  :config
  (setq-default js2-mode-show-parse-errors nil)
  (setq-default js2-mode-show-strict-warnings nil)
  (setq-default js2-highlight-level 3)
  (setq-default js-indent-level 2)
  (set-face-attribute 'js2-jsdoc-tag nil :foreground "#00ff00")
  (set-face-attribute 'js2-jsdoc-value nil :foreground "white")
  (set-face-attribute 'js2-function-param nil :foreground "white")
  (set-face-attribute 'js2-object-property nil :foreground "white")
  (set-face-attribute 'js2-function-call nil :foreground "cyan")
  (set-face-attribute 'js2-external-variable nil :foreground "green"))


#+END_SRC

* helm
#+BEGIN_SRC emacs-lisp
(use-package helm
  :config
  (use-package helm-config)
  (helm-mode 1)
  (global-set-key (kbd "M-x") #'helm-M-x))
#+END_SRC

* flycheck
#+BEGIN_SRC emacs-lisp
(use-package flycheck
  :config
  (add-hook 'js2-mode-hook 'flycheck-mode)
  (add-hook 'after-init-hook #'global-flycheck-mode)
  (setq-default flycheck-disabled-checkers
      (append flycheck-disabled-checkers
          '(javascript-jshint)))

  (defun my/use-eslint-from-node-modules ()
    (let* ((root (locate-dominating-file
                  (or (buffer-file-name) default-directory)
                  "node_modules"))
          (eslint (and root
                        (expand-file-name "node_modules/eslint/bin/eslint.js"
                                          root))))<commit_msg>[PATCH][FIX] do not load fictitious package helm-config<commit_after>#+TITLE: Emacs configuration

* use-package
#+BEGIN_SRC emacs-lisp
(setq use-package-always-ensure t)
#+END_SRC

* company
#+BEGIN_SRC emacs-lisp
(use-package company)
#+END_SRC

* evil
#+BEGIN_SRC emacs-lisp
;; fix tab key for org mode
(use-package evil
  :init
  (setq-default evil-want-C-i-jump nil)
  :config
  (use-package evil-magit)
  (use-package org-evil)
  (evil-mode t)
  (setq-default evil-shift-left 1)
  (setq-default evil-shift-right 1)
  (setq-default evil-shift-width 2)
  (use-package evil-vimish-fold)
  (evil-vimish-fold-mode 1)
  (use-package evil-ediff))
#+END_SRC

* git-gutter
#+BEGIN_SRC emacs-lisp
(use-package git-gutter
  :config
  (global-git-gutter-mode +1))
#+END_SRC

* org
#+BEGIN_SRC emacs-lisp
(use-package org
  :init
  (org-babel-do-load-languages
    'org-babel-load-languages
      '((emacs-lisp . t)))
  (setq-default org-confirm-babel-evauluate nil)
  (global-set-key (kbd "C-c c") 'org-capture)
  (setq-default org-capture-templates
    '(("i" "inbox" entry
      (file+headline "~/.notes/main.org" "Inbox")
      "* TODO [%t] %i%?")))
  (global-set-key
    (kbd "C-c o")
    (lambda () (interactive)
      (find-file "~/.notes/main.org")))
  (setq org-default-notes-file "~/.notes/main.org")
  (setq org-refile-targets '(("~/.notes/main.org" :maxlevel . 3))))
#+END_SRC

* js2
#+BEGIN_SRC emacs-lisp
(use-package js2-mode
  :mode ("\\.js\\'" . js2-mode)
  :config
  (setq-default js2-mode-show-parse-errors nil)
  (setq-default js2-mode-show-strict-warnings nil)
  (setq-default js2-highlight-level 3)
  (setq-default js-indent-level 2)
  (set-face-attribute 'js2-jsdoc-tag nil :foreground "#00ff00")
  (set-face-attribute 'js2-jsdoc-value nil :foreground "white")
  (set-face-attribute 'js2-function-param nil :foreground "white")
  (set-face-attribute 'js2-object-property nil :foreground "white")
  (set-face-attribute 'js2-function-call nil :foreground "cyan")
  (set-face-attribute 'js2-external-variable nil :foreground "green"))


#+END_SRC

* helm
#+BEGIN_SRC emacs-lisp
(use-package helm
  :config
  (helm-mode 1)
  (global-set-key (kbd "M-x") #'helm-M-x))
#+END_SRC

* flycheck
#+BEGIN_SRC emacs-lisp
(use-package flycheck
  :config
  (add-hook 'js2-mode-hook 'flycheck-mode)
  (add-hook 'after-init-hook #'global-flycheck-mode)
  (setq-default flycheck-disabled-checkers
      (append flycheck-disabled-checkers
          '(javascript-jshint)))

  (defun my/use-eslint-from-node-modules ()
    (let* ((root (locate-dominating-file
                  (or (buffer-file-name) default-directory)
                  "node_modules"))
          (eslint (and root
                        (expand-file-name "node_modules/eslint/bin/eslint.js"
                                          root))))
{'fraction_non_alphanumeric': 0.1635096497498213, 'fraction_numerical': 0.009292351679771264, 'mean_word_length': 3.139792899408284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1911670', 'n_tokens_mistral': 2238, 'n_tokens_neox': 2151, 'n_words': 419}