Commits

Anonymous committed de8ed11

Remove files

Comments (0)

Files changed (17)

files/allout-config.el

-(use-package allout
-  :commands allout-mode
-  :config
-  (progn
-    (defun my-allout-init ()
-      (unbind-key "M-k" allout-mode-map))
-
-    (add-hook 'allout-mode-hook 'my-allout-init)
-    ;; redefine this to make it work with smartparens
-    (defun allout-pre-command-business ()
-      "Outline `pre-command-hook' function for outline buffers.
-
-Among other things, implements special behavior when the cursor is on the
-topic bullet character.
-
-When the cursor is on the bullet character, self-insert
-characters are reinterpreted as the corresponding
-control-character in the `allout-mode-map-value'.  The
-`allout-mode' `post-command-hook' insures that the cursor which
-has moved as a result of such reinterpretation is positioned on
-the bullet character of the destination topic.
-
-The upshot is that you can get easy, single (ie, unmodified) key
-outline maneuvering operations by positioning the cursor on the bullet
-char.  When in this mode you can use regular cursor-positioning
-command/keystrokes to relocate the cursor off of a bullet character to
-return to regular interpretation of self-insert characters."
-
-      (if (not (allout-mode-p))
-          nil
-        (setq allout-command-counter (1+ allout-command-counter))
-        (setq allout-this-command-hid-text nil)
-        ;; Do hot-spot navigation.
-        (if (and (memq this-command '(sp--self-insert-command self-insert-command))
-                 (eq (point)(allout-current-bullet-pos)))
-            (allout-hotspot-key-handler))))))

files/auto-complete.el

-(use-package auto-complete-config
-  :commands auto-complete-mode
-  :config
-  (progn
-    (ac-config-default)
-    (setq-default ac-sources
-                  (append '(
-                            ac-source-filename
-                            ac-source-yasnippet
-                            )
-                          ac-sources))
-
-    (setq ac-use-menu-map t)
-    (bind-key "RET" 'popup-isearch-done popup-isearch-keymap)))

files/diminish.el

-(require 'diminish)
-(eval-after-load "undo-tree"
-  '(diminish 'undo-tree-mode))
-(diminish 'visual-line-mode)
-(diminish 'smartparens-mode)
-(eval-after-load "achievements-functions"
-  '(diminish 'achievements-mode))
-(eval-after-load "eldoc"
-  '(diminish 'eldoc-mode " δ"))
-(eval-after-load 'projectile
-  '(diminish 'projectile-mode))
-(eval-after-load "face-remap"
-  '(diminish 'buffer-face-mode))
-(eval-after-load "reftex"
-  '(diminish 'reftex-mode))
-(eval-after-load "emmet-mode"
-  '(diminish 'emmet-mode))
-(eval-after-load "skeleton-complete"
-  '(diminish 'skeleton-complete-mode))
-(eval-after-load "golden-ratio"
-  '(diminish 'golden-ratio-mode))
-(eval-after-load "guide-key"
-  '(diminish 'guide-key-mode))

files/dired-setup.el

-;; see commentary in dired-defs.el
-(use-package dired
-  :mode ("\\.wdired\\'" . my-virtual-dired-mode)
-  :bind (("C-x d"  . my-dired-files)
-         ("M-<f2>" . my-find-dired)
-         ("C-x C-j" . dired-jump))
-  :init
-  (progn
-    (defun my-virtual-dired-mode ()
-      (save-excursion
-        (goto-char (point-min))
-        (back-to-indentation)
-        (let ((ddir (thing-at-point 'filename)))
-          (virtual-dired (substring ddir 0 (1- (length ddir)))))
-        (dired-virtual-revert)))
-
-    (defun my-dired-files (&optional arg)
-      "Like `ido-dired'.  With prefix argument call
-`diredp-dired-files' with negative argument."
-      (interactive "P")
-      (if arg
-          (progn
-            (when (not (featurep 'icicles))
-              (require 'icicles))
-            (setq current-prefix-arg -1)
-            (call-interactively 'diredp-dired-files))
-        (ido-dired))))
-  :config
-  (progn
-    (load "files/dired-defs")))

files/eshell-mode.el

-(use-package eshell
-  :commands eshell
-  :config
-  (progn
-    ;;;; git config
-    (defun my--get-git-branches (&optional all)
-      (let ((branches (-map 'car (magit-list-interesting-refs))))
-        (if all
-            branches
-          (--filter (not (string-match-p "/" it)) branches))))
-
-    (defun pcomplete/eshell-mode/gc ()
-      (pcomplete-here (my--get-git-branches)))
-
-    (defun pcomplete/eshell-mode/git ()
-      (pcomplete-here '("add"
-                        "bisect"
-                        "branch"
-                        "checkout"
-                        "clone"
-                        "commit"
-                        "diff"
-                        "fetch"
-                        "grep"
-                        "init"
-                        "log"
-                        "merge"
-                        "mv"
-                        "pull"
-                        "push"
-                        "rebase"
-                        "remote"
-                        "reset"
-                        "rm"
-                        "show"
-                        "status"
-                        "tag"))
-      (pcomplete-here
-       (let ((last-cmd (nth (1- pcomplete-last) pcomplete-args)))
-         (cond
-          ((equal "checkout" last-cmd)
-           (my--get-git-branches))
-          ((equal "add" last-cmd)
-           (pcomplete-entries))
-          ((equal "merge" last-cmd)
-           (my--get-git-branches t))))))
-
-    ;;;; hg config
-
-    (defun pcomplete/eshell-mode/hg ()
-      (pcomplete-here '("add"
-                        "annotate"
-                        "clone"
-                        "commit"
-                        "diff"
-                        "export"
-                        "forget"
-                        "init"
-                        "log"
-                        "merge"
-                        "pull"
-                        "push"
-                        "remove"
-                        "serve"
-                        "status"
-                        "summary"
-                        "update")))))

files/haskell.el

-(use-package haskell-mode
-  :mode ("\\.hs\\'" . haskell-mode)
-  :config
-  (progn
-    (require 'haskell-indentation)
-    (bind-key "C-c h" 'haskell-hoogle haskell-mode-map)
-    (bind-key "C-c C-r" 'my-haskell-reload haskell-mode-map)
-    (bind-key "<backspace>" 'sp-backward-delete-char haskell-indentation-mode-map)
-
-    (defun my-haskell-reload (&optional reload)
-      (interactive)
-      (inferior-haskell-load-file reload)
-      (other-window 1))
-
-;; (defun my-hs-end-of-defun (&optional arg)
-;;       (interactive "p")
-;;       (when (looking-at-p "$")
-;;         (re-search-forward "^[[:alpha:]]")
-;;         (backward-char))
-;;       (let ((name (word-at-point)))
-;;         (forward-char)
-;;         (re-search-forward "^[[:alpha:]]")
-;;         (beginning-of-line)
-;;         (while (and (looking-at-p name)
-;;                     (not (eobp)))
-;;           (forward-line))
-;;         (re-search-forward "^[[:alpha:]]")
-;;         (backward-char 2)))
-
-;; (defun my-hs-beg-of-defun (&optional arg)
-;;   (interactive "p")
-;;   (beginning-of-line)
-;;   (let ((old-pos (point)))
-;;     (when (looking-at-p "\\(\\s-\\|$\\)")
-;;       (re-search-backward "^[[:alpha:]]"))
-;;     (let ((name (word-at-point))
-;;           (pos (point)))
-;;       (while (and (looking-at-p name)
-;;                   (not (bobp)))
-;;         (forward-line -1))
-;;       (forward-line)
-;;       ;; (when (and (= pos (point))
-;;       ;;            (= pos old-pos))
-;;       ;;   (backward-char)
-;;       ;;   (my-hs-beg-of-defun))
-;;       )))
-
-(defun my-hs-end-of-defun ()
-  (forward-char)
-  (re-search-forward "^[[:alpha:]]")
-  (backward-char))
-
-(defun my-hs-beg-of-defun ()
-  (re-search-backward "^[[:alpha:]]"))
-
-    (defun my-haskell-init ()
-      (set (make-local-variable 'end-of-defun-function) 'my-hs-end-of-defun)
-      (set (make-local-variable 'beginning-of-defun-function) 'my-hs-beg-of-defun))
-
-    (add-hook 'haskell-mode-hook 'my-haskell-init)))

files/ibuffer-config.el

-(use-package ibuffer
-  :bind ("<f1> <f1>" . ibuffer)
-  :init
-  (progn
-    ;; startup function
-    (defun customize-ibuffer-mode ()
-      "Startup function."
-      (ibuffer-switch-to-saved-filter-groups "default")
-      (add-to-list 'ibuffer-hidden-filter-groups "Tramp")
-      (add-to-list 'ibuffer-hidden-filter-groups "emacs-elpa")
-      (visual-line-mode -1)
-      (toggle-truncate-lines 1))
-    (add-hook 'ibuffer-mode-hook 'customize-ibuffer-mode))
-  :config
-  (progn
-    (bind-key "M-o" 'elwm-activate-window ibuffer-mode-map)
-
-    ;; filter groups
-    (setq ibuffer-saved-filter-groups
-          (quote (("default"
-                   ("Org" ;; all org-related buffers
-                    (mode . org-mode))
-                   ("emacs-elpa"
-                    (or (predicate
-                         .
-                         (let ((bfn (buffer-file-name (current-buffer))))
-                           (when bfn
-                             (and (string-match-p "\\.emacs\\.d/elpa" bfn)
-                                  (eq major-mode 'emacs-lisp-mode)))))))
-                   ("emacs-config"
-                    (or (predicate
-                         .
-                         (let ((bfn (buffer-file-name (current-buffer))))
-                           (when bfn
-                             (and (string-match-p "\\.emacs\\.d" bfn)
-                                  (eq major-mode 'emacs-lisp-mode)))))))
-                   ("emacs"
-                    (or (mode . emacs-lisp-mode)
-                        (mode . lisp-interaction-mode)
-                        (mode . inferior-emacs-lisp-mode)))
-                   ("TeX"
-                    (or (mode . tex-mode)
-                        (mode . plain-tex-mode)
-                        (mode . latex-mode)))
-                   ("Markdown" (or (mode . markdown-mode)
-                                   (mode . gfm-mode)))
-                   ("Web"
-                    (or (mode . html-mode)
-                        (mode . css-mode)
-                        (mode . php-mode)
-                        (mode . js-mode)))
-                   ("Dired"
-                    (mode . dired-mode))
-                   ("Langs"
-                    (or (predicate
-                         .
-                         (let ((bfn (buffer-file-name (current-buffer))))
-                           (when bfn
-                             (string-match-p "d:/languages" bfn))))))
-                   ("Images"
-                    (or (mode . image-dired-display-image-mode)
-                        (mode . image-dired-thumbnail-mode)
-                        (mode . image-mode)))
-                   ("Tramp"
-                    (or (name . "tramp")))
-                   ("Programming" ;; prog stuff not already in MyProjectX
-                    (or
-                     (mode . c-mode)
-                     (mode . perl-mode)
-                     (mode . python-mode)
-                     (mode . cc-mode)
-                     ;; etc
-                     ))
-                   ("IRC"
-                    (or (mode . erc-mode)))
-                   ))))
-
-    ;; (define-ibuffer-filter in-directory
-    ;;   "Toggle current view to buffers whose default-directory is in QUALIFIER."
-    ;;   (:description "in-directory"
-    ;;    :reader (read-directory-name "Directory: "))
-    ;;   (with-current-buffer buf (file-in-directory-p default-directory qualifier)))
-
-    (define-ibuffer-column size-h
-      (:name "Size"
-             :inline t
-             :summarizer
-             (lambda (column-strings)
-               (let ((total 0))
-                 (dolist (string column-strings)
-                   (setq total
-                         ;; like, ewww ...
-                         (+
-                          (let ((number (float (string-to-number string))))
-                            (cond
-                             ((string-match-p "K" string)
-                              (* number 1000))
-                             ((string-match-p "M" string)
-                              (* number 1000000))
-                             (t number)))
-                          total)))
-                 (file-size-human-readable total 'si))))
-      (file-size-human-readable (buffer-size) 'si))
-
-    ;; Modify the default ibuffer-formats
-    (setq ibuffer-formats
-          '((mark modified vc-status-mini read-only
-                  " " (name 25 25 :left :elide)
-                  " " (size-h 9 -1 :right)
-                  " " (mode 16 16 :left :elide)
-
-                  " " filename-and-process)
-            (mark " " (name 16 -1)
-                  " " filename)))
-
-    ;; Switching to ibuffer puts the cursor on the most recent buffer
-    (defadvice ibuffer (around ibuffer-point-to-most-recent activate) ()
-      "Open ibuffer with cursor pointed to most recent buffer name"
-      (let ((recent-buffer-name (buffer-name)))
-        ad-do-it
-        (ibuffer-jump-to-buffer recent-buffer-name)))))

files/ido-config.el

-(use-package ido
-  :defer t
-  :bind (("M-." . ido-goto-symbol) ;; was Find tag
-         )
-  :config
-  (progn
-    (use-package flx-ido
-      :defer t)
-
-    ;; Display ido results vertically, rather than horizontally
-    (setq ido-decorations (quote ("\n-> " "" "\n   " "\n   ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
-    (defun ido-disable-line-trucation () (set (make-local-variable 'truncate-lines) nil))
-    (add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-trucation)
-
-    ;; see: http://emacswiki.org/emacs/InteractivelyDoThings#toc25
-    (defun ido-smart-select-text ()
-      "Select the current completed item.  Do NOT descend into directories."
-      (interactive)
-      (when (and (or (not ido-require-match)
-                     (if (memq ido-require-match
-                               '(confirm confirm-after-completion))
-                         (if (or (eq ido-cur-item 'dir)
-                                 (eq last-command this-command))
-                             t
-                           (setq ido-show-confirm-message t)
-                           nil))
-                     (ido-existing-item-p))
-                 (not ido-incomplete-regexp))
-        (when ido-current-directory
-          (setq ido-exit 'takeprompt)
-          (unless (and ido-text (= 0 (length ido-text)))
-            (let ((match (ido-name (car ido-matches))))
-              (throw 'ido
-                     (setq ido-selected
-                           (if match
-                               (replace-regexp-in-string "/\\'" "" match)
-                             ido-text)
-                           ido-text ido-selected
-                           ido-final-text ido-text)))))
-        (exit-minibuffer)))
-
-    (defun my-ido-keys ()
-      (bind-key "C-<tab>" 'ido-smart-select-text ido-file-dir-completion-map))
-
-    (add-hook 'ido-setup-hook 'my-ido-keys)
-
-    ;; ido and imenu integration
-    (defun ido-goto-symbol (&optional symbol-list)
-      "Refresh imenu and jump to a place in the buffer using Ido."
-      (interactive)
-      (unless (featurep 'imenu)
-        (require 'imenu nil t))
-      (cond
-       ((not symbol-list)
-        (let ((ido-mode ido-mode)
-              (ido-enable-flex-matching
-               (if (boundp 'ido-enable-flex-matching)
-                   ido-enable-flex-matching t))
-              name-and-pos symbol-names position)
-          (unless ido-mode
-            (ido-mode 1)
-            (setq ido-enable-flex-matching t))
-          (while (progn
-                   (imenu--cleanup)
-                   (setq imenu--index-alist nil)
-                   (ido-goto-symbol (imenu--make-index-alist))
-                   (setq selected-symbol
-                         (ido-completing-read "Symbol? " symbol-names))
-                   (string= (car imenu--rescan-item) selected-symbol)))
-          (unless (and (boundp 'mark-active) mark-active)
-            (push-mark nil t nil))
-          (setq position (cdr (assoc selected-symbol name-and-pos)))
-          (cond
-           ((overlayp position)
-            (goto-char (overlay-start position)))
-           (t
-            (goto-char position)))))
-       ((listp symbol-list)
-        (dolist (symbol symbol-list)
-          (let (name position)
-            (cond
-             ((and (listp symbol) (imenu--subalist-p symbol))
-              (ido-goto-symbol symbol))
-             ((listp symbol)
-              (setq name (car symbol))
-              (setq position (cdr symbol)))
-             ((stringp symbol)
-              (setq name symbol)
-              (setq position
-                    (get-text-property 1 'org-imenu-marker symbol))))
-            (unless (or (null position) (null name)
-                        (string= (car imenu--rescan-item) name))
-              (setq word-under-cursor (thing-at-point 'symbol))
-              (setq fix-the-order (not (null (member word-under-cursor symbol-names))))
-              (add-to-list 'symbol-names name)
-              (when fix-the-order
-                (delete word-under-cursor symbol-names)
-                (add-to-list 'symbol-names word-under-cursor))
-              (add-to-list 'name-and-pos (cons name position))))))))
-
-    ;; sort ido filelist by mtime instead of alphabetically
-    (defun ido-sort-mtime ()
-      (setq ido-temp-list
-            (sort ido-temp-list
-                  (lambda (a b)
-                    (time-less-p
-                     (sixth (file-attributes (concat ido-current-directory b)))
-                     (sixth (file-attributes (concat ido-current-directory a)))))))
-      (ido-to-end  ;; move . files to end (again)
-       (--select (char-equal (string-to-char it) ?.) ido-temp-list))
-      (when ido-show-dot-for-dired
-        (setq ido-temp-list
-              (cons "." (--remove (equal it ".") ido-temp-list)))))
-
-    (add-hook 'ido-make-file-list-hook 'ido-sort-mtime)
-    (add-hook 'ido-make-dir-list-hook 'ido-sort-mtime)))

files/isearch-config.el

-(use-package "isearch"
-  :bind (("C-s" . isearch-forward-regexp)
-         ("C-r" . isearch-backward-regexp))
-  :config
-  (progn
-    (use-package flex-isearch
-      :defer t
-      :load-path "~/.emacs.d/vendor/flex-isearch/"
-      :config
-      (progn
-        (defadvice isearch-forward-regexp (around flex-isearch activate)
-          (when (and flex-isearch-mode
-                     (equal (ad-get-arg 0) '(16)))
-            (flex-isearch-activate)
-            (ad-set-arg 0 '(4)))
-          ad-do-it)
-
-        (defadvice isearch-backward-regexp (around flex-isearch activate)
-          (when (and flex-isearch-mode
-                     (equal (ad-get-arg 0) '(16)))
-            (flex-isearch-activate)
-            (ad-set-arg 0 '(4)))
-          ad-do-it)))
-
-    (defun my-isearch-forward ()
-      "Repeat the forward search.
-
-If called from backward search, immediately jump to the following
-occurance instead of jumping to the end of current one."
-      (interactive)
-      (when (not isearch-forward)
-        (isearch-repeat 'forward))
-      (isearch-repeat 'forward))
-
-    (defun my-isearch-backward ()
-      "Repeat the backward search.
-
-If called from forward search, immediately jump to the previous
-occurance instead of jumping to the beginning of current one."
-      (interactive)
-      (when (and isearch-forward
-                 (/= (point) isearch-other-end))
-        (isearch-repeat 'backward))
-      (isearch-repeat 'backward))
-
-    (defun my-isearch-forward-to-beginning ()
-      "Repeat the forward search and place the point before the
-matched text."
-      (interactive)
-      (when (not isearch-forward)
-        (isearch-repeat 'forward))
-      (isearch-repeat 'forward)
-      (goto-char isearch-other-end))
-
-    (defun my-isearch-kill-match ()
-      "Kill the text last matched by isearch."
-      (interactive)
-      (isearch-exit)
-      (kill-region (point) isearch-other-end))
-
-    (defun my-isearch-zap-to-match ()
-      "Kill the region between the point of origin of isearch and the
-closest portion of the isearch match string.  The behaviour is
-meant to be analogous to zap-to-char.  The deleted region does
-not include the isearch word.  This is meant to be bound only in
-isearch mode."
-      (interactive)
-      (let* ((isearch-bounds (list isearch-other-end (point)))
-             (ismin (apply 'min isearch-bounds))
-             (ismax (apply 'max isearch-bounds))
-             (beg isearch-opoint))
-        (cond
-         ((< beg ismin)
-          (goto-char ismin)
-          (kill-region beg ismin))
-         ((> beg ismax)
-          (goto-char beg)
-          (kill-region ismax beg))
-         (t
-          (error "Internal error in isearch kill function.")))
-        (isearch-exit)))
-
-    (defun my-isearch-exit-other-end ()
-      "Exit isearch, but at the other end of the search string.
-This is useful when followed by an immediate kill."
-      (interactive)
-      (isearch-exit)
-      (goto-char isearch-other-end))
-
-    (defun my-isearch-yank-symbol ()
-      "Pull next symbol from buffer into search string."
-      (interactive)
-      (isearch-yank-internal (lambda () (sp-forward-symbol) (point))))
-
-    (defun my-isearch-exit ()
-      "Exit search normally.
-
-If in dired buffer, find file under cursor.  If it is a
-directory, go right back into search."
-      (interactive)
-      (isearch-exit)
-      (if (eq major-mode 'dired-mode)
-          ;; we're assuming no files are marked
-          (let ((d (car (dired-get-marked-files))))
-            (dired-find-file)
-            (when (file-directory-p d)
-              (dired-isearch-filenames)))))
-
-    ;; keybindings
-    (bind-key "<f6>" 'replace-regexp)
-
-    (bind-key "C-v" 'my-isearch-forward-to-beginning isearch-mode-map)
-    (bind-key "C-r" 'my-isearch-backward             isearch-mode-map)
-    (bind-key "C-s" 'my-isearch-forward              isearch-mode-map)
-    (bind-key "C-2" 'my-isearch-kill-match           isearch-mode-map)
-    (bind-key "C-3" 'my-isearch-exit-other-end       isearch-mode-map)
-    (bind-key "C-w" 'my-isearch-yank-symbol          isearch-mode-map)
-    (bind-key "C-M-w" 'isearch-yank-word-or-char     isearch-mode-map)
-    (bind-key "M-z" 'my-isearch-zap-to-match         isearch-mode-map)
-    (bind-key "<f2>" 'isearch-occur                  isearch-mode-map)
-    (bind-key "\r" 'my-isearch-exit                  isearch-mode-map)
-
-    (bind-key "C-S-s" 'flex-isearch-forward)
-    (bind-key "C-S-r" 'flex-isearch-backward)))

files/ispell-config.el

-(use-package ispell
-  :bind (("<f10>" . ispell-word)
-         ("C-<f10>" . flyspell-mode)))

files/latex-mode-config.el

-(use-package tex-site
-  :load-path "site-lisp/auctex/"
-  :mode ("\\.tex\\'" . TeX-latex-mode)
-  :commands (TeX-latex-mode
-             TeX-mode
-             tex-mode
-             LaTeX-mode
-             latex-mode)
-  :config
-  (progn
-    (use-package latex
-      :defer t
-      :config
-      (progn
-        ;; fix the "bug" in SP regexp wrap that treats ' as "word"
-        (modify-syntax-entry ?' ".")
-
-        (require 'smartparens-latex)
-        (sp-local-pair 'latex-mode "\\begin" "\\end")
-        (sp-local-tag 'latex-mode "\\ba" "\\begin{align*}" "\\end{align*}")
-
-        (use-package preview)
-        (use-package font-latex)
-        (fset 'tex-font-lock-suscript 'ignore)
-
-        (sp-with-modes '(tex-mode plain-tex-mode latex-mode)
-          (sp-local-pair "\\[" nil :post-handlers '(my-latex-math-block-indent)))
-
-        (defun my-latex-math-block-indent (a action c)
-          (when (eq action 'insert)
-            (newline-and-indent)
-            (save-excursion (newline))))
-
-        (defun my-latex-compile ()
-          (interactive)
-          (save-buffer)
-          (TeX-command "LaTeX" 'TeX-master-file nil))
-        (bind-key "C-M-x" 'my-latex-compile LaTeX-mode-map)
-
-        (defvar my-latex-wrap-choices '("emph"
-                                        "textsc"))
-        (defvar my-latex-wrap-history nil)
-
-        (defun my-latex-wrap (macro-name)
-          (interactive (list (ido-completing-read
-                              "Macro> "
-                              my-latex-wrap-choices
-                              nil 'confirm nil my-latex-wrap-history)))
-          (when (use-region-p)
-            (let ((b (region-beginning))
-                  (e (region-end)))
-              (goto-char e)
-              (insert "}")
-              (goto-char b)
-              (insert "\\" macro-name "{"))))
-        (bind-key "C-c w" 'my-latex-wrap LaTeX-mode-map)
-
-        (defun my-end-of-environment ()
-          (interactive)
-          (LaTeX-mark-environment)
-          (end-of-region))
-
-        (defun my-beginning-of-environment ()
-          (interactive)
-          (LaTeX-mark-environment)
-          (beginning-of-region)
-          (deactivate-mark))
-
-        (bind-key "M-n" 'my-end-of-environment LaTeX-mode-map)
-        (bind-key "M-p" 'my-beginning-of-environment LaTeX-mode-map)
-
-        ;; fix italian quote highlight
-        (push '("\"<" "\">") font-latex-quote-list)
-
-        (defun my-latex-remove-command ()
-          "Unwrap the expression that point is in or before, also
-removing the command name.  By command we understand a symbol
-starting with \\ and followed by a block of text enclosed in {}."
-          (interactive)
-          (let ((ok (sp-get-enclosing-sexp)))
-            (cond
-             ;; we're inside the { } block
-             (ok
-              (progn
-                (save-excursion
-                  (goto-char (sp-get ok :beg))
-                  (zap-to-char -1 ?\\ ))
-                (sp-splice-sexp)))
-             ;; test if we are in looking at the command fromt he front
-             ((looking-at "\\\\")
-              (zap-up-to-char 1 ?{)
-              (sp-unwrap-sexp))
-             ;; otherwise we're inside the command name
-             (t
-              (zap-to-char -1 ?\\ )
-              (zap-up-to-char 1 ?{)
-              (sp-unwrap-sexp)))))
-        (bind-key "C-c d" 'my-latex-remove-command LaTeX-mode-map)
-        (bind-key "M-RET" 'LaTeX-insert-item LaTeX-mode-map)
-
-        (defun my-LaTeX-preview-math ()
-          (interactive)
-          (let ((b (save-excursion (while (texmathp) (backward-char 1)) (1- (point))))
-                (e (save-excursion (while (texmathp) (forward-char 1)) (point))))
-            (preview-region b e)))
-        (bind-key "C-<m-key>" 'my-LaTeX-preview-math preview-map)
-
-        (defun my-LaTeX-mode-init ()
-          (setq TeX-auto-save t)
-          (setq TeX-parse-self t)
-          (TeX-PDF-mode t)
-          (setq reftex-plug-into-AUCTeX t)
-          (reftex-mode t)
-          (TeX-fold-mode t)
-
-          (keyadvice-mode t)
-
-          (LaTeX-add-environments
-           '("derivation" LaTeX-env-label))
-          (TeX-add-symbols '("emph" 1))
-
-          (setq fill-column 100000)
-
-          (message "LaTeX mode init complete."))
-        ;; ACUTeX replaces latex-mode-hook with LaTeX-mode-hook
-        (add-hook 'LaTeX-mode-hook 'my-LaTeX-mode-init)
-
-        (keyadvice-add-advice (kbd "`")
-          (if (and (eq major-mode 'latex-mode) (texmathp))
-              (let* ((events (let ((overriding-local-map LaTeX-math-keymap))
-                               (read-key-sequence "math: ")))
-                     (binding (lookup-key LaTeX-math-keymap events)))
-                (call-interactively binding))
-            keyadvice-do-it))))))

files/markdown-config.el

-(use-package markdown-mode
-  :mode ("\\.md$" . gfm-mode)
-  :config
-  (progn
-    (defun my-markdown-init ()
-      (modify-syntax-entry ?\" "$\""))
-    (add-hook 'gfm-mode-hook 'my-markdown-init)
-
-    (defun -repeat (n x)
-      "Return a list with X repeated N times.
-Returns nil if N is less than 1."
-      (let (ret)
-        (--dotimes n (!cons x ret))
-        ret))
-
-    (defun my-markdown-toc ()
-      "Generate table of content from # to ####### headers."
-      (interactive)
-      (let ((n 'nil)
-            (last-m nil)
-            (toc ""))
-        (save-excursion
-          (while (re-search-forward "^\\(#+\\) \\(.*\\)" nil t)
-            (if (equal last-m (match-string 1))
-                (progn
-                  (setcar n (1+ (car n))))
-              (if (< (length last-m) (length (match-string 1)))
-                  (!cons 1 n)
-                (!cdr n)
-                (setcar n (1+ (car n))))
-              (setq last-m (match-string 1)))
-            (setq toc (concat
-                       toc
-                       (apply #'concat (-repeat (* 4 (1- (length (match-string 1)))) " "))
-                       (int-to-string (car n))
-                       ". ["
-                       (match-string 2)
-                       "]"
-                       "(#"
-                       (replace-regexp-in-string " " "-" (downcase (match-string 2)))
-                       ")
-"
-                       ))))
-        (insert toc)))
-
-    (defun my-markdown-generate-anchors ()
-      "Add anchors above each header.  If an anchor is present,
-delete it and re-insert new one."
-      (interactive)
-      (let (m)
-        (while (re-search-forward "^\\(#+\\) \\(.*\\)" nil t)
-          (setq m (match-string 2))
-          (beginning-of-line)
-          (previous-line)
-          (if (looking-at "<a")
-              (delete-region (point) (line-end-position))
-            (newline))
-          (insert (concat
-                   "<a name=\""
-                   (replace-regexp-in-string " " "-" (downcase m))
-                   "\" />"))
-          (next-line 2))))))

files/multi-web-mode-config.el

-(use-package multi-web-mode
-  :defer t
-  :config
-  (progn
-    (setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
-                      (javascript-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
-                      (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
-    (setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))))
-
-(use-package sgml-mode
-  :defer t
-  :config
-  (progn
-    (defun my-html-mode-setup ()
-      (multi-web-mode 1)
-      (emmet-mode 1)
-      (with-map-bind-keys html-mode-map
-        ("C-c C-f" 'sp-html-next-tag)
-        ("C-c C-b" 'sp-html-previous-tag)))
-    (add-hook 'html-mode-hook 'my-html-mode-setup)))
-
-(use-package css-mode
-  :defer t
-  :config
-  (progn
-    (defun my-css-mode-setup ()
-      (multi-web-mode 1)
-      (emmet-mode 1))
-    (add-hook 'css-mode-hook 'my-css-mode-setup)))

files/org-mode-config.el

-(use-package org
-  :mode ("\\.org\\'" . org-mode)
-  ;; The following lines are always needed.  Choose your own keys.
-  :bind  (("C-c l" . org-store-link)
-          ("<f12>" . org-agenda)
-          ("C-c C-x C-o" . org-clock-out)
-          ("C-c C-x <C-i-key>" . org-clock-in))
-  :config
-  (progn
-    (use-package org-drill
-      :commands org-drill
-      :defer t
-      :config
-      (progn
-        (defun org-drill-present-two-sided-card-no-cloze ()
-          (with-hidden-comments
-           (let ((drill-sections (org-drill-hide-all-subheadings-except nil)))
-             (when drill-sections
-               (save-excursion
-                 (goto-char (nth (random* (min 2 (length drill-sections)))
-                                 drill-sections))
-                 (org-show-subtree)))
-             (ignore-errors
-               (org-display-inline-images t))
-             (org-cycle-hide-drawers 'all)
-             (prog1 (org-drill-presentation-prompt)
-               (org-drill-hide-subheadings-if 'org-drill-entry-p)))))))
-    (defface my-org-bold
-      '((t (:weight bold :inherit font-lock-variable-name-face)))
-      "The face used to highlight pair overlays.")
-
-    (defface my-org-italic
-      '((t (:slant italic :inherit font-lock-variable-name-face)))
-      "The face used to highlight pair overlays.")
-
-    (defface my-org-code
-      '((t (:family "Consolas" :inherit font-lock-constant-face)))
-      "The face used to highlight pair overlays.")
-
-    (bind-key "TAB" 'smart-tab org-mode-map)
-    (bind-key "C-e" 'my-end-of-code-or-line org-mode-map)
-    (bind-key "C-a" 'my-back-to-indentation-or-beginning org-mode-map)
-    (bind-key "C-c C-x r" 'org-clock-remove-overlays org-mode-map)
-    ;; TODO lepsia mapa pre "toggle prikazy?"
-    (bind-key "C-c C-x L" 'org-toggle-link-display org-mode-map)
-
-    (defun my-org-open-at-point (&optional arg)
-      "Just like `org-open-at-point', but open link in this window."
-      (interactive "P")
-      (if (equal arg '(16))
-          (org-open-at-point arg)
-        (let ((current-prefix-argument nil))
-          (if arg
-              (org-open-at-point '(4))
-            (let ((org-link-frame-setup (acons 'file 'find-file org-link-frame-setup)))
-              (org-open-at-point '(4)))))))
-    (bind-key "C-c C-o" 'my-org-open-at-point org-mode-map)
-    (bind-key "C-c C-=" 'org-open-at-point org-mode-map)
-
-    (defun my-goto-current-clocked-task ()
-      (interactive)
-      (org-goto-marker-or-bmk org-clock-marker))
-    (bind-key "<f1> <f10>" 'my-goto-current-clocked-task)
-
-    (defun my-org-narrow-to-top-heading ()
-      (interactive)
-      (save-excursion
-        (ignore-errors (while (outline-up-heading 1)))
-        (org-narrow-to-subtree)))
-    (bind-key "C-x n t" 'my-org-narrow-to-top-heading org-mode-map)
-
-    (defun my-org-metacontrolreturn ()
-      "Execute `org-meta-return' followed by `org-meta-right'.
-This usually makes new item indented one level deeper."
-      (interactive)
-      (org-meta-return)
-      (org-metaright))
-    (bind-key "<C-M-return>" 'my-org-metacontrolreturn)
-
-    (require 'org-table)
-    ;; org/orgtbl bindings
-    (defvar my-org-table-map)
-    (define-prefix-command 'my-org-table-map)
-    (bind-key "C-c t" 'my-org-table-map org-mode-map)
-    (bind-key "C-c t" 'my-org-table-map orgtbl-mode-map)
-    (defvar my-org-table-insert-map)
-    (define-prefix-command 'my-org-table-insert-map)
-    (bind-key "C-c t i" 'my-org-table-insert-map org-mode-map)
-    (bind-key "C-c t i" 'my-org-table-insert-map orgtbl-mode-map)
-    (bind-key "C-c t i i" 'orgtbl-insert-radio-table orgtbl-mode-map)
-    (defvar my-org-table-delete-map)
-    (define-prefix-command 'my-org-table-delete-map)
-    (bind-key "C-c t d" 'my-org-table-delete-map org-mode-map)
-    (bind-key "C-c t d" 'my-org-table-delete-map orgtbl-mode-map)
-
-    (let ((bindings '(("C-c t i c" org-table-insert-column)
-                      ("C-c t i r" org-table-insert-row)
-                      ("C-c t d c" org-table-delete-column)
-                      ("C-c t d r" org-table-kill-row)))
-          (n 1000))
-      (dolist (b bindings)
-        (define-key org-mode-map (kbd (car b)) (cadr b))
-        (org-defkey orgtbl-mode-map (kbd (car b)) (orgtbl-make-binding (cadr b) n (kbd (car b))))
-        (setq n (1+ n))))
-
-    (defun my-org-select-cell ()
-      "Select the cell in org table the point is in."
-      (interactive)
-      (let ((b (save-excursion
-                 (re-search-forward "|")
-                 (backward-char 1)
-                 (skip-chars-backward " ")
-                 (point)))
-            (e (save-excursion
-                 (re-search-backward "|")
-                 (forward-char 1)
-                 (skip-chars-forward " ")
-                 (point))))
-        (push-mark b t t)
-        (goto-char e)))
-    (bind-key "C-c t" 'my-org-select-cell org-mode-map)
-
-    (defun my-markdown-to-org-link (b e)
-      (interactive "r")
-      (goto-char b)
-      (sp-down-sexp)
-      (let ((desc (sp-get (sp--next-thing-selection 0)
-                    (buffer-substring-no-properties :beg :end)))
-            (link (progn
-                    (sp-beginning-of-sexp 2)
-                    (sp-get (sp--next-thing-selection 0)
-                      (buffer-substring-no-properties :beg :end)))))
-        (delete-region b e)
-        (insert (format "[[%s][%s]]" link desc))))
-
-    (defun my-org-make-numbered-list (beg end)
-      (interactive "r")
-      (string-rectangle beg end "- ")
-      (beginning-of-line)
-      (org-call-with-arg 'org-cycle-list-bullet 'previous)
-      (org-call-with-arg 'org-cycle-list-bullet 'previous))
-    (bind-key "C-c 1" 'my-org-make-numbered-list org-mode-map)
-
-    (load "files/org-clock")
-    (load "files/org-project")
-
-    (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
-
-    ;; Enable modules
-    (setq org-modules (quote (org-bbdb
-                              org-bibtex
-                              org-crypt
-                              org-gnus
-                              org-id
-                              org-info
-                              org-jsinfo
-                              org-habit
-                              org-inlinetask
-                              org-irc
-                              org-mew
-                              org-mhe
-                              org-protocol
-                              org-rmail
-                              org-vm
-                              org-wl
-                              org-w3m
-                              org-drill)))
-
-    ;; position the habit graph on the agenda to the right of the default
-    (setq org-habit-graph-column 81)
-
-;;;;;;;;;;;;;;;;;;;;; CAPTURE
-    (setq org-directory "~/org")
-    (setq org-default-notes-file "~/org/refile.org")
-
-    ;; I use C-M-r to start capture mode
-    (bind-key "C-M-r" 'org-capture)
-
-    ;; Capture templates for: TODO tasks, Notes, appointments, phone calls, and org-protocol
-    (setq org-capture-templates
-          (quote (("t" "todo" entry (file "~/org/refile.org")
-                   "* TODO %?\n%U\n%a\n" :clock-keep t)
-                  ("s" "someday" entry (file "~/org/refile.org")
-                   "* SOMEDAY %?\n%U\n%a\n" :clock-keep t)
-                  ("n" "note" entry (file "~/org/refile.org")
-                   "* %? :NOTE:\n%U\n%a\n" :clock-keep t)
-                  ("j" "Journal" entry (file+datetree "~/org/diary.org")
-                   "* %?\n%U\n" :clock-keep t))))
-
-    ;; Remove empty LOGBOOK drawers on clock out
-    (defun bh/remove-empty-drawer-on-clock-out ()
-      (interactive)
-      (save-excursion
-        (beginning-of-line 0)
-        (org-remove-empty-drawer-at "LOGBOOK" (point))))
-
-    (add-hook 'org-clock-out-hook 'bh/remove-empty-drawer-on-clock-out 'append)
-
-;;;;;;;;;;;;;;;;; REFILING
-    ;; Targets include this file and any file contributing to the agenda - up to 9 levels deep
-    (setq org-refile-targets (quote ((nil :maxlevel . 9)
-                                     (org-agenda-files :maxlevel . 9))))
-
-    ;; Use full outline paths for refile targets - we file directly with IDO
-    (setq org-refile-use-outline-path t)
-
-    ;; Targets complete directly with IDO
-    (setq org-outline-path-complete-in-steps nil)
-
-    ;; Allow refile to create parent tasks with confirmation
-    (setq org-refile-allow-creating-parent-nodes (quote confirm))
-
-    ;; Use IDO for both buffer and file completion and ido-everywhere to t
-    (setq org-completion-use-ido t)
-
-;;;; Refile settings
-    ;; Exclude DONE state tasks from refile targets
-    (defun bh/verify-refile-target ()
-      "Exclude todo keywords with a done state from refile targets"
-      (not (member (nth 2 (org-heading-components)) org-done-keywords)))
-
-    (setq org-refile-target-verify-function 'bh/verify-refile-target)
-
-    (setq org-log-done 'time)
-    (setq org-log-done 'note)
-
-    ;; english locale
-    (setq system-time-locale "C")
-    (setq org-completion-use-ido t)
-
-    ;; support selecting with shift+arrows
-    (setq org-support-shift-select t)
-
-    ;; fast state selection
-    (setq org-use-fast-todo-selection t)
-
-    (setq org-agenda-files (quote ("~/org/")))
-
-    ;; TODO KEYWORDS SETTINGS
-    (setq org-todo-keywords
-          '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
-            (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)")
-            (sequence "SOMEDAY(S)" "|")))
-
-    (setq org-todo-keyword-faces
-          (quote (("TODO" :foreground "IndianRed1" :weight bold)
-                  ("NEXT" :foreground "RoyalBlue" :weight bold)
-                  ("DONE" :foreground "LimeGreen" :weight bold)
-                  ("WAITING" :foreground "orange" :weight bold)
-                  ("HOLD" :foreground "orange" :weight bold)
-                  ("CANCELLED" :foreground "LimeGreen" :weight bold)
-                  ("SOMEDAY" :foreground "pink" :weight bold))))
-
-    (setq org-todo-state-tags-triggers
-          (quote (("CANCELLED" ("CANCELLED" . t))
-                  ("WAITING" ("WAITING" . t))
-                  ("HOLD" ("WAITING" . t) ("HOLD" . t))
-                  (done ("WAITING") ("HOLD"))
-                  ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
-                  ("SOMEDAY" ("WAITING") ("CANCELLED") ("HOLD"))
-                  ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
-                  ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
-
-    ;; Tags shortcuts
-    (setq org-tag-alist (quote ((:startgroup)
-                                ("@errand" . ?e)
-                                ("@school" . ?o)
-                                ("@home" . ?H)
-                                (:endgroup)
-                                ("READING" . ?r)
-                                ("LATIN" . ?l))))
-
-    ;; Allow setting single tags without the menu
-    (setq org-fast-tag-selection-single-key (quote expert))
-
-    ;; Archiving settings
-    (setq org-archive-mark-done nil)
-    (setq org-archive-location "%s_archive::* Archived Tasks")
-
-    (defun bh/skip-non-archivable-tasks ()
-      "Skip trees that are not available for archiving"
-      (save-restriction
-        (widen)
-        (let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))))
-          ;; Consider only tasks with done todo headings as archivable candidates
-          (if (member (org-get-todo-state) org-done-keywords)
-              (let* ((subtree-end (save-excursion (org-end-of-subtree t)))
-                     (daynr (string-to-int (format-time-string "%d" (current-time))))
-                     (a-month-ago (* 60 60 24 (+ daynr 1)))
-                     (last-month (format-time-string "%Y-%m-" (time-subtract (current-time) (seconds-to-time a-month-ago))))
-                     (this-month (format-time-string "%Y-%m-" (current-time)))
-                     (subtree-is-current (save-excursion
-                                           (forward-line 1)
-                                           (and (< (point) subtree-end)
-                                                (re-search-forward (concat last-month "\\|" this-month) subtree-end t)))))
-                (if subtree-is-current
-                    next-headline ; Has a date in this month or last month, skip it
-                  nil))  ; available to archive
-            (or next-headline (point-max))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;; AGENDA VIEW
-    ;; Compact the block agenda view
-    ;; (setq org-agenda-compact-blocks t)
-
-    ;; Custom agenda command definitions
-    (setq org-agenda-custom-commands
-          (quote (("N" "Notes" tags "NOTE"
-                   ((org-agenda-overriding-header "Notes")
-                    (org-tags-match-list-sublevels t)))
-                  ("h" "Habits" tags-todo "STYLE=\"habit\""
-                   ((org-agenda-overriding-header "Habits")
-                    (org-agenda-sorting-strategy
-                     '(todo-state-down effort-up category-keep))))
-                  (" " "Agenda"
-                   ((agenda "" nil)
-                    (tags "REFILE"
-                          ((org-agenda-overriding-header "Tasks to Refile")
-                           (org-tags-match-list-sublevels nil)))
-                    (tags-todo "-CANCELLED/!"
-                               ((org-agenda-overriding-header "Stuck Projects")
-                                (org-agenda-skip-function 'bh/skip-non-stuck-projects)))
-                    (tags-todo "-WAITING-CANCELLED/!NEXT"
-                               ((org-agenda-overriding-header "Next Tasks")
-                                (org-agenda-skip-function 'bh/skip-projects-and-habits-and-single-tasks)
-                                (org-agenda-todo-ignore-scheduled t)
-                                (org-agenda-todo-ignore-deadlines t)
-                                (org-agenda-todo-ignore-with-date t)
-                                (org-tags-match-list-sublevels t)
-                                (org-agenda-sorting-strategy
-                                 '(todo-state-down effort-up category-keep))))
-                    (tags-todo "-REFILE-CANCELLED/!-HOLD-WAITING-SOMEDAY"
-                               ((org-agenda-overriding-header "Tasks")
-                                (org-agenda-skip-function 'bh/skip-project-tasks-maybe)
-                                (org-agenda-todo-ignore-scheduled t)
-                                (org-agenda-todo-ignore-deadlines t)
-                                (org-agenda-todo-ignore-with-date t)
-                                (org-agenda-sorting-strategy
-                                 '(category-keep))))
-                    (tags-todo "-HOLD-CANCELLED/!"
-                               ((org-agenda-overriding-header "Projects")
-                                (org-agenda-skip-function 'bh/skip-non-projects)
-                                (org-agenda-sorting-strategy
-                                 '(category-keep))))
-                    (tags-todo "-CANCELLED+WAITING/!"
-                               ((org-agenda-overriding-header "Waiting and Postponed Tasks")
-                                (org-agenda-skip-function 'bh/skip-stuck-projects)
-                                (org-tags-match-list-sublevels nil)
-                                (org-agenda-todo-ignore-scheduled 'future)
-                                (org-agenda-todo-ignore-deadlines 'future))))
-                   nil)
-                  ("r" "Tasks to Refile" tags "REFILE"
-                   ((org-agenda-overriding-header "Tasks to Refile")
-                    (org-tags-match-list-sublevels nil)))
-                  ("#" "Stuck Projects" tags-todo "-CANCELLED/!"
-                   ((org-agenda-overriding-header "Stuck Projects")
-                    (org-agenda-skip-function 'bh/skip-non-stuck-projects)))
-                  ("n" "Next Tasks" tags-todo "-WAITING-CANCELLED/!NEXT"
-                   ((org-agenda-overriding-header "Next Tasks")
-                    (org-agenda-skip-function 'bh/skip-projects-and-habits-and-single-tasks)
-                    (org-agenda-todo-ignore-scheduled t)
-                    (org-agenda-todo-ignore-deadlines t)
-                    (org-agenda-todo-ignore-with-date t)
-                    (org-tags-match-list-sublevels t)
-                    (org-agenda-sorting-strategy
-                     '(todo-state-down effort-up category-keep))))
-                  ("R" "Tasks" tags-todo "-REFILE-CANCELLED/!-HOLD-WAITING"
-                   ((org-agenda-overriding-header "Tasks")
-                    (org-agenda-skip-function 'bh/skip-project-tasks-maybe)
-                    (org-agenda-sorting-strategy
-                     '(category-keep))))
-                  ("S" "Someday" todo "SOMEDAY"
-                   ((org-agenda-overriding-header "Someday")
-                    (org-tags-match-list-sublevels nil)))
-                  ("p" "Projects" tags-todo "-HOLD-CANCELLED/!"
-                   ((org-agenda-overriding-header "Projects")
-                    (org-agenda-skip-function 'bh/skip-non-projects)
-                    (org-agenda-sorting-strategy
-                     '(category-keep))))
-                  ("w" "Waiting Tasks" tags-todo "-CANCELLED+WAITING/!"
-                   ((org-agenda-overriding-header "Waiting and Postponed tasks"))
-                   (org-tags-match-list-sublevels nil))
-                  ("A" "Tasks to Archive" tags "-REFILE/"
-                   ((org-agenda-overriding-header "Tasks to Archive")
-                    (org-agenda-skip-function 'bh/skip-non-archivable-tasks)
-                    (org-tags-match-list-sublevels nil))))))))
-
-
-(defun my-org-add-drill-entry ()
-  (interactive)
-  (insert
-   (format
-    "* Word :drill:
-    :PROPERTIES:
-    :DRILL_CARD_TYPE: twosidednocloze
-    :END:
-** %s
-
-** English
-
-** Examples
-
-** Notes
-
-"
-    my-org-drill-language))
-  (re-search-backward ":PROPERTIES:" nil t)
-  (org-cycle)
-  (re-search-forward ":END:" nil t)
-  (forward-line 2))
-
-(defun my-format-russian-verb ()
-  (interactive)
-  (beginning-of-line)
-  (forward-word)
-  (kill-sexp)
-  (delete-char 1)
-  (save-excursion (insert " "))
-  (transpose-words 1)
-  (backward-word 2)
-  (insert "- ")
-  (forward-word)
-  (insert ":")
-  (forward-word)
-  (newline)
-  (delete-char 2)
-  (insert "- ")
-  (forward-char 4)
-  (kill-word 1)
-  (insert ":")
-  (end-of-line)
-  (delete-char -1))
-
-(defun my-format-russian-meaning ()
-  (interactive)
-  (delete-char -1)
-  (outline-previous-visible-heading 1)
-  (forward-line)
-  (delete-char 1)
-  (let ((beg (point))
-        (end (progn
-               (outline-next-visible-heading 1)
-               (forward-line -1)
-               (point))))
-    (my-org-make-numbered-list beg end)))
-
-(defun my-org-drill-fulltext (word)
-  (interactive "sWord: ")
-  (widen)
-  (occur word)
-  (other-window 1)
-  (when (re-search-forward (concat "[0-9]:" word) nil t)
-    (end-of-line)))
-
-(bind-key "a" 'my-occur-mode-goto-card-occurrence occur-mode-map)
-(defun my-occur-mode-goto-card-occurrence ()
-  (interactive)
-  (occur-mode-goto-occurrence)
-  (outline-up-heading 1)
-  (org-narrow-to-subtree)
-  (org-show-subtree)
-  (org-cycle-hide-drawers t))
-
-(defun my-org-status ()
-  (cond
-   ((not (marker-buffer org-clock-marker))
-    "<fc=#d3d7cf>No active task</fc>")
-   (t
-    (let* ((status (substring-no-properties org-mode-line-string 1
-                                            (1- (length org-mode-line-string))))
-           (split-status (split-string status " (")))
-      (concat "<fc=#8ae234>" (car split-status) "</fc> (" (cadr split-status))))))

files/recentf-config.el

-(use-package recentf
-  :bind (("C-c r f" . recentf-open-files)
-         ("C-x C-r" . recentf-open-files)
-         ("C-c r c" . recentf-cleanup))
-  :config
-  (progn
-    (defun my-recentf-setup ()
-      (bind-key "n" 'my-recentf-next-file recentf-dialog-mode-map)
-      (bind-key "p" 'my-recentf-previous-file recentf-dialog-mode-map)
-      (bind-key "C-s" 'my-recentf-isearch-forward recentf-dialog-mode-map))
-
-    (add-hook 'recentf-dialog-mode-hook 'my-recentf-setup)
-
-    (defun my-recentf-next-file (&optional arg)
-      (interactive "p")
-      (forward-line arg)
-      (re-search-forward ".*/\\(.*?\\)$" nil t)
-      (goto-char (match-beginning 1)))
-
-    (defun my-recentf-previous-file (&optional arg)
-      (interactive "p")
-      (forward-line (- arg))
-      (re-search-forward ".*/\\(.*?\\)$" nil t)
-      (goto-char (match-beginning 1)))
-
-    (defvar recentf-isearch-filter-predicate-orig nil)
-    (defvar recentf-isearch-filenames nil)
-
-    (defun recentf-isearch-filenames-setup ()
-      "Set up isearch to search in recentf file names.
-Intended to be added to `isearch-mode-hook'."
-      (when recentf-isearch-filenames
-        (setq isearch-message-prefix-add "filename ")
-        (setq recentf-isearch-filter-predicate-orig
-              (default-value 'isearch-filter-predicate))
-        (setq-default isearch-filter-predicate 'recentf-isearch-filter-filenames)
-        (add-hook 'isearch-mode-end-hook 'recentf-isearch-filenames-end nil t)))
-
-    (add-hook 'isearch-mode-hook 'recentf-isearch-filenames-setup)
-
-    (defun recentf-isearch-filenames-end ()
-      "Clean up the Recentf file name search after terminating isearch."
-      (setq isearch-message-prefix-add nil)
-      (setq-default isearch-filter-predicate recentf-isearch-filter-predicate-orig)
-      (setq recentf-isearch-filenames nil)
-      (remove-hook 'isearch-mode-end-hook 'recentf-isearch-filenames-end t))
-
-    (defun recentf-isearch-filter-filenames (beg end)
-      "Test whether the current search hit is a visible file name.
-Return non-nil if the text from BEG to END is part of a file
-name (has the text property `recentf-filename') and is visible."
-      (and (isearch-filter-visible beg end)
-           (if recentf-isearch-filenames
-               (text-property-not-all (min beg end) (max beg end)
-                                      'recentf-filename nil)
-             t)))
-
-    (defun my-recentf-isearch-forward ()
-      (interactive)
-      (setq recentf-isearch-filenames t)
-      (isearch-forward nil t))
-
-    ;; redefine from recentf.el to add the property to filename, so we can
-    ;; search filter
-    (defun recentf-open-files-item (menu-element)
-      "Return a widget to display MENU-ELEMENT in a dialog buffer."
-      (if (consp (cdr menu-element))
-          ;; Represent a sub-menu with a tree widget
-          `(tree-widget
-            :open t
-            :match ignore
-            :node (item :tag ,(car menu-element)
-                        :sample-face bold
-                        :format "%{%t%}:\n")
-            ,@(mapcar 'recentf-open-files-item
-                      (cdr menu-element)))
-        ;; Represent a single file with a link widget
-        (let ((str (car menu-element)))
-          ;; add the text property to help the search fitler
-          (string-match ".*/\\(.*?\\)$" str)
-          (put-text-property (match-beginning 1) (match-end 1)
-                             'recentf-filename t str)
-          (message "%s" str)
-          `(link :tag ,str
-                 :button-prefix ""
-                 :button-suffix ""
-                 :button-face default
-                 :format "%[%t\n%]"
-                 :help-echo ,(concat "Open " (cdr menu-element))
-                 :action recentf-open-files-action
-                 ,(cdr menu-element)))))))

files/tramp.el

-(setq tramp-default-method "plinkx")
-(setq tramp-terminal-type "dumb")
-
-;; in file `tramp-sh.el' it is necessary to add
-;; (tramp-password-end-of-line "xy") ;see docstring for "xy"
-;; to "plinkx" method.

vendor/world-time-mode/world-time-mode.el

-;;; world-time-mode.el --- show whole days of world-time diffs
-
-;; Copyright (C) 2013  Nic Ferrier
-
-;; Author: Nic Ferrier <nferrier@ferrier.me.uk>
-;; Keywords: tools, calendar
-;; Version: 0.0.2
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Very useful productivity tool if you work in different time zones.
-
-;;; Code:
-
-(require 'cl)
-
-(defun world-time/table-entrys ()
-  "For listing the entries of the world-time day."
-  (let ((zones-alist display-time-world-list)
-        (old-tz (getenv "TZ"))
-        (max-width 0)
-        result)
-    (unwind-protect
-         (setq result
-               (loop for i from 0 to 23
-                  collect
-                    (let ((my-time (time-add
-                                    (current-time)
-                                    (seconds-to-time (* i 3600)))))
-                      (list nil
-                            (loop for zone in zones-alist
-                               vconcat
-                                 (progn
-                                   (setenv "TZ" (car zone))
-                                   (list (format-time-string
-                                    "%R %Z" ; display-time-world-time-format
-                                    my-time))))))))
-      (setenv "TZ" old-tz))
-    result))
-
-(define-derived-mode
-    world-time-table-mode tabulated-list-mode "World Time"
-    "Major mode for seeing your world time list as a day."
-    (setq tabulated-list-entries 'world-time/table-entrys)
-    (setq tabulated-list-format
-          [("America/Los_Angeles" 20 nil)
-           ("America/New_York" 20 nil)
-           ("Europe/London"    20 nil)
-           ("Europe/Berlin"    20 nil)
-           ("Asia/Calcutta"    20 nil)])
-    (tabulated-list-init-header))
-
-;;;###autoload
-(defun world-time-list ()
-  "Show `display-time-world-list' full day comparison."
-  (interactive)
-  (with-current-buffer (get-buffer-create "*world-time*")
-    (world-time-table-mode)
-    (tabulated-list-print)
-    (switch-to-buffer (current-buffer))))
-
-(provide 'world-time-mode)
-
-;;; world-time-mode.el ends here