<commit_before>(load "~/.emacs.d/customize")

(require 'powerline)
(defun my-powerline-default-theme ()
  (interactive)
  (setq-default mode-line-format
                '("%e"
                  (:eval
                   (let* ((active (powerline-selected-window-active))
                          (mode-line (if active 'mode-line 'mode-line-inactive))
                          (face1 (if active 'powerline-active1 'powerline-inactive1))
                          (face2 (if active 'powerline-active2 'powerline-inactive2))
                          (separator-left (intern (format "powerline-%s-%s"
                                                          (powerline-current-separator)
                                                          (car powerline-default-separator-dir))))
                          (separator-right (intern (format "powerline-%s-%s"
                                                           (powerline-current-separator)
                                                           (cdr powerline-default-separator-dir))))
                          (lhs (list (powerline-raw "%*" nil 'l)
                                     (when powerline-display-buffer-size
                                       (powerline-buffer-size nil 'l))
                                     (when powerline-display-mule-info
                                       (powerline-raw mode-line-mule-info nil 'l))
                                     (powerline-buffer-id nil 'l)
                                     (when (and (boundp 'which-func-mode) which-func-mode)
                                       (powerline-raw which-func-format nil 'l))
                                     (powerline-raw " ")
                                     (funcall separator-left mode-line face1)
                                     (when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
                                       (powerline-raw erc-modified-channels-object face1 'l))
                                     (powerline-major-mode face1 'l)
                                     (powerline-process face1)
                                     (powerline-narrow face1 'l)
                                     (powerline-raw " " face1)
                                     (funcall separator-left face1 face2)
                                     (powerline-vc face2 'r)
                                     (when (bound-and-true-p nyan-mode)
                                       (powerline-raw (list (nyan-create)) face2 'l))))
                          (rhs (list (powerline-raw global-mode-string face2 'r)
                                     (funcall separator-right face2 face1)
                                     (powerline-raw "%4l" face1 'l)
                                     (powerline-raw ":" face1 'l)
                                     (powerline-raw "%3c" face1 'r)
                                     (funcall separator-right face1 mode-line)
                                     (powerline-raw " ")
                                     (powerline-raw "%6p" nil 'r)
                                     (when powerline-display-hud
                                       (powerline-hud face2 face1)))))
                     (concat (powerline-render lhs)
                             (powerline-fill face2 (powerline-width rhs))
                             (powerline-render rhs)))))))
(my-powerline-default-theme)

(require 'git-commit)

(move-text-default-bindings)

(require 'hl-line+)
(hl-line-toggle-when-idle 1)
(hl-line-when-idle-interval 3)
(global-hl-line-mode 0)

(require 'company)
(define-key company-mode-map (kbd "M-TAB") 'company-complete)
(define-key company-active-map (kbd "C-n") 'company-select-next)
(define-key company-active-map (kbd "C-p") 'company-select-previous)

;; popup window manager
(require 'popwin)
(global-set-key (kbd "C-; C-p") popwin:keymap)

;; cycle through amounts of spacing (http://pragmaticemacs.com/emacs/cycle-spacing/)
(global-set-key (kbd "M-SPC") 'cycle-spacing)

;; http://emacswiki.org/emacs/InteractivelyDoThings#toc23
(defun ido-define-keys () ;; C-n/p is more intuitive in vertical layout
  (define-key ido-completion-map (kbd "C-n") 'ido-next-match)
  (define-key ido-completion-map (kbd "C-p") 'ido-prev-match))
(add-hook 'ido-setup-hook 'ido-define-keys)

(require 'tramp)
(require 'yasnippet)
(require 'popwin)
(popwin-mode t)

(require 'flyspell)
(define-key flyspell-mode-map (kbd "C-;") 'nil)

(require 'swiper)
(global-set-key (kbd "C-s") 'swiper)
(global-set-key (kbd "C-r") 'swiper)
(global-set-key (kbd "C-c C-r") 'ivy-resume)

(defun mc-my/start-edit ()
  (interactive)
  (if (>= (mc/num-cursors) 1)
      (multiple-cursors-mode 1)
    (multiple-cursors-mode 0)))

;;;; https://github.com/knu/mc-extras.el/blob/master/mc-rect.el
(defun mc/rect-rectangle-to-multiple-cursors (start end)
  "Turn rectangle-mark-mode into multiple-cursors mode, keeping selections."
  (interactive "*r")
  (let* ((current-line (line-beginning-position))
         (reversed (= (current-column)
                      (min
                       (save-excursion
                         (goto-char end)
                         (current-column))
                       (save-excursion
                         (goto-char start)
                         (current-column)))))
         (mark-row `(lambda (startcol endcol)
                     (let ((markcol  ,(if reversed 'endcol 'startcol))
                           (pointcol ,(if reversed 'startcol 'endcol)))
                       (move-to-column markcol)
                       (push-mark (point))
                       (move-to-column pointcol)
                       (setq transient-mark-mode (cons 'only transient-mark-mode))
                       (activate-mark)
                       (setq deactivate-mark nil)))))
    (apply-on-rectangle
     '(lambda (startcol endcol)
        (if (= (point) current-line)
            (funcall mark-row startcol endcol)
          (mc/save-excursion
           (funcall mark-row startcol endcol)
           (mc/create-fake-cursor-at-point))))
     start end))
  (deactivate-mark)
  (mc-my/start-edit))

(add-to-list 'mc--default-cmds-to-run-once 'mc/rect-rectangle-to-multiple-cursors)

(require 'multiple-cursors)
(global-set-key (kbd "C-<return>") 'rectangle-mark-mode)
(global-set-key (kbd "C-; C-m") 'mc/rect-rectangle-to-multiple-cursors)
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)

(global-set-key (kbd "C-; o t") 'org-todo-list)
(global-set-key (kbd "C-; o a") 'org-agenda-list)

(require 'org)
(define-key org-mode-map (kbd "C-c a l") 'org-timeline)
(define-key org-mode-map (kbd "C-c a t") 'org-show-todo-tree)
(define-key org-mode-map (kbd "C-c a d") 'org-check-deadlines)

(defun mc-my/create-cursor ()
  (interactive)
  (mc/create-fake-cursor-at-point))<commit_msg>Require multiple-cursors before use it<commit_after>(load "~/.emacs.d/customize")

(require 'powerline)
(defun my-powerline-default-theme ()
  (interactive)
  (setq-default mode-line-format
                '("%e"
                  (:eval
                   (let* ((active (powerline-selected-window-active))
                          (mode-line (if active 'mode-line 'mode-line-inactive))
                          (face1 (if active 'powerline-active1 'powerline-inactive1))
                          (face2 (if active 'powerline-active2 'powerline-inactive2))
                          (separator-left (intern (format "powerline-%s-%s"
                                                          (powerline-current-separator)
                                                          (car powerline-default-separator-dir))))
                          (separator-right (intern (format "powerline-%s-%s"
                                                           (powerline-current-separator)
                                                           (cdr powerline-default-separator-dir))))
                          (lhs (list (powerline-raw "%*" nil 'l)
                                     (when powerline-display-buffer-size
                                       (powerline-buffer-size nil 'l))
                                     (when powerline-display-mule-info
                                       (powerline-raw mode-line-mule-info nil 'l))
                                     (powerline-buffer-id nil 'l)
                                     (when (and (boundp 'which-func-mode) which-func-mode)
                                       (powerline-raw which-func-format nil 'l))
                                     (powerline-raw " ")
                                     (funcall separator-left mode-line face1)
                                     (when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
                                       (powerline-raw erc-modified-channels-object face1 'l))
                                     (powerline-major-mode face1 'l)
                                     (powerline-process face1)
                                     (powerline-narrow face1 'l)
                                     (powerline-raw " " face1)
                                     (funcall separator-left face1 face2)
                                     (powerline-vc face2 'r)
                                     (when (bound-and-true-p nyan-mode)
                                       (powerline-raw (list (nyan-create)) face2 'l))))
                          (rhs (list (powerline-raw global-mode-string face2 'r)
                                     (funcall separator-right face2 face1)
                                     (powerline-raw "%4l" face1 'l)
                                     (powerline-raw ":" face1 'l)
                                     (powerline-raw "%3c" face1 'r)
                                     (funcall separator-right face1 mode-line)
                                     (powerline-raw " ")
                                     (powerline-raw "%6p" nil 'r)
                                     (when powerline-display-hud
                                       (powerline-hud face2 face1)))))
                     (concat (powerline-render lhs)
                             (powerline-fill face2 (powerline-width rhs))
                             (powerline-render rhs)))))))
(my-powerline-default-theme)

(require 'git-commit)

(move-text-default-bindings)

(require 'hl-line+)
(hl-line-toggle-when-idle 1)
(hl-line-when-idle-interval 3)
(global-hl-line-mode 0)

(require 'company)
(define-key company-mode-map (kbd "M-TAB") 'company-complete)
(define-key company-active-map (kbd "C-n") 'company-select-next)
(define-key company-active-map (kbd "C-p") 'company-select-previous)

;; popup window manager
(require 'popwin)
(global-set-key (kbd "C-; C-p") popwin:keymap)

;; cycle through amounts of spacing (http://pragmaticemacs.com/emacs/cycle-spacing/)
(global-set-key (kbd "M-SPC") 'cycle-spacing)

;; http://emacswiki.org/emacs/InteractivelyDoThings#toc23
(defun ido-define-keys () ;; C-n/p is more intuitive in vertical layout
  (define-key ido-completion-map (kbd "C-n") 'ido-next-match)
  (define-key ido-completion-map (kbd "C-p") 'ido-prev-match))
(add-hook 'ido-setup-hook 'ido-define-keys)

(require 'tramp)
(require 'yasnippet)
(require 'popwin)
(popwin-mode t)

(require 'flyspell)
(define-key flyspell-mode-map (kbd "C-;") 'nil)

(require 'swiper)
(global-set-key (kbd "C-s") 'swiper)
(global-set-key (kbd "C-r") 'swiper)
(global-set-key (kbd "C-c C-r") 'ivy-resume)

(require 'multiple-cursors)

(defun mc-my/start-edit ()
  (interactive)
  (if (>= (mc/num-cursors) 1)
      (multiple-cursors-mode 1)
    (multiple-cursors-mode 0)))

;;;; https://github.com/knu/mc-extras.el/blob/master/mc-rect.el
(defun mc/rect-rectangle-to-multiple-cursors (start end)
  "Turn rectangle-mark-mode into multiple-cursors mode, keeping selections."
  (interactive "*r")
  (let* ((current-line (line-beginning-position))
         (reversed (= (current-column)
                      (min
                       (save-excursion
                         (goto-char end)
                         (current-column))
                       (save-excursion
                         (goto-char start)
                         (current-column)))))
         (mark-row `(lambda (startcol endcol)
                     (let ((markcol  ,(if reversed 'endcol 'startcol))
                           (pointcol ,(if reversed 'startcol 'endcol)))
                       (move-to-column markcol)
                       (push-mark (point))
                       (move-to-column pointcol)
                       (setq transient-mark-mode (cons 'only transient-mark-mode))
                       (activate-mark)
                       (setq deactivate-mark nil)))))
    (apply-on-rectangle
     '(lambda (startcol endcol)
        (if (= (point) current-line)
            (funcall mark-row startcol endcol)
          (mc/save-excursion
           (funcall mark-row startcol endcol)
           (mc/create-fake-cursor-at-point))))
     start end))
  (deactivate-mark)
  (mc-my/start-edit))

(add-to-list 'mc--default-cmds-to-run-once 'mc/rect-rectangle-to-multiple-cursors)

(global-set-key (kbd "C-<return>") 'rectangle-mark-mode)
(global-set-key (kbd "C-; C-m") 'mc/rect-rectangle-to-multiple-cursors)
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)

(global-set-key (kbd "C-; o t") 'org-todo-list)
(global-set-key (kbd "C-; o a") 'org-agenda-list)

(require 'org)
(define-key org-mode-map (kbd "C-c a l") 'org-timeline)
(define-key org-mode-map (kbd "C-c a t") 'org-show-todo-tree)
(define-key org-mode-map (kbd "C-c a d") 'org-check-deadlines)

(defun mc-my/create-cursor ()
  (interactive)
  (mc/create-fake-cursor-at-point))
{'fraction_non_alphanumeric': 0.13155600755484528, 'fraction_numerical': 0.005520848467238123, 'mean_word_length': 1.414839501841782, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 72, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1303171', 'n_tokens_mistral': 4185, 'n_tokens_neox': 3999, 'n_words': 807}