Migrate mouse config to general.el, Org config to use-package
This commit is contained in:
parent
af39864690
commit
05fe16785f
|
@ -2,29 +2,6 @@
|
||||||
;; mouse-4 and 5 - wheel up and wheel down
|
;; mouse-4 and 5 - wheel up and wheel down
|
||||||
;; mouse-9 and 8 - 'forward' and 'backward' thumb buttons
|
;; mouse-9 and 8 - 'forward' and 'backward' thumb buttons
|
||||||
|
|
||||||
(cp-set-keys
|
|
||||||
:bindings
|
|
||||||
'( ;; ([down-mouse-1] mouse-set-point)
|
|
||||||
;; ([up-mouse-1] er/expand-region)
|
|
||||||
([s-mouse-3] bury-buffer)
|
|
||||||
([mouse-8] delete-window)
|
|
||||||
;; (,(kbd "<mouse-9>") keyboard-quit)
|
|
||||||
;; ([mouse-9] buffer-menu)
|
|
||||||
([mouse-9] ibuffer)
|
|
||||||
([C-mouse-9] recentf-open-files)
|
|
||||||
([M-mouse-4] next-buffer)
|
|
||||||
([M-mouse-5] previous-buffer)
|
|
||||||
([M-mouse-8] split-window-right)
|
|
||||||
([M-mouse-9] split-window-below)
|
|
||||||
;; quitting from helm-mini - whether with keyboard-quit or
|
|
||||||
;; keyboard-escape-quit - "banishes" the mouse pointer to the
|
|
||||||
;; top-right corner!? wtf, helm.
|
|
||||||
;; (,(kbd "s-<mouse-9>") helm-mini)
|
|
||||||
))
|
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
|
||||||
(define-key org-mode-map [mouse-1] 'org-cycle))
|
|
||||||
|
|
||||||
;; (require 'ediff)
|
;; (require 'ediff)
|
||||||
|
|
||||||
;; (cp-set-keys
|
;; (cp-set-keys
|
||||||
|
|
|
@ -1,26 +1,24 @@
|
||||||
(require 'cp-daylog)
|
(use-package org-mode
|
||||||
|
:bind
|
||||||
(global-set-key (kbd "<f5> o") 'org-mode)
|
(("<f5> o" . 'org-mode)
|
||||||
(with-eval-after-load 'org
|
:map org-mode-map
|
||||||
|
("C-," . nil)
|
||||||
|
("M-n" . org-metadown)
|
||||||
|
("M-p" . org-metaup)
|
||||||
|
("C-c C--" . org-ctrl-c-minus)
|
||||||
|
("C-c C-," . org-metaleft)
|
||||||
|
("C-c C-." . org-metaright)
|
||||||
|
;; ("C-j" . org-return)
|
||||||
|
;; ("C-m" . org-return-indent)
|
||||||
|
("C-c C-9" . org-mark-ring-goto)
|
||||||
|
("C-c C-/" . org-sparse-tree)
|
||||||
|
("M-w" . cp-copy-line-or-link)
|
||||||
|
("C-c C-]" . org-set-tags)
|
||||||
|
("C-M-x" . cp/eval-sexp)
|
||||||
|
("C-c C-o" . cp/org-open))
|
||||||
|
:config
|
||||||
;; (setq org-M-RET-may-split-line 'nil)
|
;; (setq org-M-RET-may-split-line 'nil)
|
||||||
;; (add-hook 'org-mode-hook 'org-display-inline-images)
|
;; (add-hook 'org-mode-hook 'org-display-inline-images)
|
||||||
(cp-set-keys
|
|
||||||
:keymap org-mode-map
|
|
||||||
:bindings
|
|
||||||
`((,(kbd "C-,") nil)
|
|
||||||
(,(kbd "M-n") org-metadown)
|
|
||||||
(,(kbd "M-p") org-metaup)
|
|
||||||
(,(kbd "C-c C--") org-ctrl-c-minus)
|
|
||||||
(,(kbd "C-c C-,") org-metaleft)
|
|
||||||
(,(kbd "C-c C-.") org-metaright)
|
|
||||||
;; (,(kbd "C-j") org-return)
|
|
||||||
;; (,(kbd "C-m") org-return-indent)
|
|
||||||
(,(kbd "C-c C-9") org-mark-ring-goto)
|
|
||||||
(,(kbd "C-c C-/") org-sparse-tree)
|
|
||||||
(,(kbd "M-w") cp-copy-line-or-link)
|
|
||||||
(,(kbd "C-c C-]") org-set-tags)
|
|
||||||
(,(kbd "C-M-x") cp/eval-sexp)
|
|
||||||
(,(kbd "C-c C-o") cp/org-open)))
|
|
||||||
|
|
||||||
;; (defun cp-org-expand-all ()
|
;; (defun cp-org-expand-all ()
|
||||||
;; (interactive)
|
;; (interactive)
|
||||||
|
@ -29,20 +27,20 @@
|
||||||
;; ;; todo - check if we are on a heading
|
;; ;; todo - check if we are on a heading
|
||||||
;; (org-forward-heading-same-level)
|
;; (org-forward-heading-same-level)
|
||||||
;; ())
|
;; ())
|
||||||
|
(setq org-file-apps
|
||||||
|
'(("txt" . emacs)
|
||||||
|
("org" . emacs)
|
||||||
|
;; ("pdf" . zathura)
|
||||||
|
("\\(?:gif\\|jpe?g\\|png\\)" . "sxiv -f %s")
|
||||||
|
;; (t . "xdg-open %s")
|
||||||
|
|
||||||
(setq org-file-apps '(("txt" . emacs)
|
("pdf" . system)
|
||||||
("org" . emacs)
|
;; ("pdf" . "zathura %s")
|
||||||
;; ("pdf" . zathura)
|
;; (auto-mode . emacs)
|
||||||
("\\(?:gif\\|jpe?g\\|png\\)" . "sxiv -f %s")
|
;; (system . "xdg-open %s")
|
||||||
;; (t . "xdg-open %s")
|
(system . "zathura %s")
|
||||||
|
;; (t . system)
|
||||||
("pdf" . system)
|
)
|
||||||
;; ("pdf" . "zathura %s")
|
|
||||||
;; (auto-mode . emacs)
|
|
||||||
;; (system . "xdg-open %s")
|
|
||||||
(system . "zathura %s")
|
|
||||||
;; (t . system)
|
|
||||||
)
|
|
||||||
org-todo-keywords '((sequence "TODO" "RESEARCH" "STARTED" "DONE"))
|
org-todo-keywords '((sequence "TODO" "RESEARCH" "STARTED" "DONE"))
|
||||||
org-image-actual-width 400
|
org-image-actual-width 400
|
||||||
org-cycle-include-plain-lists 'integrate
|
org-cycle-include-plain-lists 'integrate
|
||||||
|
@ -110,42 +108,42 @@
|
||||||
,(format "\\.%s\\'"
|
,(format "\\.%s\\'"
|
||||||
(regexp-opt
|
(regexp-opt
|
||||||
'("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm"
|
'("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm"
|
||||||
"xpm" "pbm" "pgm" "ppm" "webp") t)))))
|
"xpm" "pbm" "pgm" "ppm" "webp") t))))) )
|
||||||
|
|
||||||
(defvar cp/org-heading-or-list-rx
|
(defvar cp/org-heading-or-list-rx
|
||||||
'(and
|
'(and
|
||||||
;; headings
|
;; headings
|
||||||
(zero-or-more "*")
|
(zero-or-more "*")
|
||||||
(zero-or-more blank)
|
(zero-or-more blank)
|
||||||
;; list items
|
;; list items
|
||||||
(zero-or-one
|
(zero-or-one
|
||||||
(or "- " "+ " "* "
|
(or "- " "+ " "* "
|
||||||
(and (one-or-more (char "0-9"))
|
(and (one-or-more (char "0-9"))
|
||||||
(or ". " ") "))))
|
(or ". " ") "))))
|
||||||
(zero-or-one (and "[" nonl "] "))))
|
(zero-or-one (and "[" nonl "] "))))
|
||||||
|
|
||||||
(defun org-link-ahead-p (&optional link-type)
|
(defun org-link-ahead-p (&optional link-type)
|
||||||
"Returns t if point is before an org-mode link, ignoring
|
"Returns t if point is before an org-mode link, ignoring
|
||||||
whitespace and org-mode header and list syntax, else nil.
|
whitespace and org-mode header and list syntax, else nil.
|
||||||
|
|
||||||
If LINK-TYPE is 'implicit, checks for an implicit link (one not
|
If LINK-TYPE is 'implicit, checks for an implicit link (one not
|
||||||
inside single or double brackets); otherwise, checks for links in
|
inside single or double brackets); otherwise, checks for links in
|
||||||
the form [[address][description]] and [[address]]."
|
the form [[address][description]] and [[address]]."
|
||||||
(looking-at
|
(looking-at
|
||||||
|
(rx-to-string
|
||||||
|
(append cp/org-heading-or-list-rx
|
||||||
|
(if (eq link-type 'implicit)
|
||||||
|
'("http")
|
||||||
|
'("["))))))
|
||||||
|
|
||||||
|
(defun cp/org-open (&optional arg reference-buffer)
|
||||||
|
(interactive "P")
|
||||||
|
(save-excursion
|
||||||
|
(re-search-line
|
||||||
(rx-to-string
|
(rx-to-string
|
||||||
(append cp/org-heading-or-list-rx
|
(append cp/org-heading-or-list-rx
|
||||||
(if (eq link-type 'implicit)
|
'((or "[" "[[" "http")))))
|
||||||
'("http")
|
(org-open-at-point arg reference-buffer)))
|
||||||
'("["))))))
|
|
||||||
|
|
||||||
(defun cp/org-open (&optional arg reference-buffer)
|
|
||||||
(interactive "P")
|
|
||||||
(save-excursion
|
|
||||||
(re-search-line
|
|
||||||
(rx-to-string
|
|
||||||
(append cp/org-heading-or-list-rx
|
|
||||||
'((or "[" "[[" "http")))))
|
|
||||||
(org-open-at-point arg reference-buffer))))
|
|
||||||
|
|
||||||
(defun cp-copy-line-or-link (prefix-arg)
|
(defun cp-copy-line-or-link (prefix-arg)
|
||||||
"Copy address of org-mode link after point, ignoring whitespace,
|
"Copy address of org-mode link after point, ignoring whitespace,
|
||||||
|
|
19
init.el
19
init.el
|
@ -651,7 +651,24 @@ and eval it."
|
||||||
"T" 'cp-insert-timestamp
|
"T" 'cp-insert-timestamp
|
||||||
"c" 'calendar)
|
"c" 'calendar)
|
||||||
|
|
||||||
(load "cp-mouse")
|
(general-define-key
|
||||||
|
;; [down-mouse-1] 'mouse-set-point
|
||||||
|
;; [up-mouse-1] 'er/expand-region
|
||||||
|
[s-mouse-3] 'bury-buffer
|
||||||
|
[mouse-8] 'delete-window
|
||||||
|
;; (kbd "<mouse-9>") 'keyboard-quit
|
||||||
|
;; [mouse-9] 'buffer-menu
|
||||||
|
[mouse-9] 'ibuffer
|
||||||
|
[C-mouse-9] 'recentf-open-files
|
||||||
|
[M-mouse-4] 'next-buffer
|
||||||
|
[M-mouse-5] 'previous-buffer
|
||||||
|
[M-mouse-8] 'split-window-right
|
||||||
|
[M-mouse-9] 'split-window-below
|
||||||
|
;; quitting from helm-mini - whether with keyboard-quit or
|
||||||
|
;; keyboard-escape-quit - "banishes" the mouse pointer to the
|
||||||
|
;; top-right corner!? wtf, helm.
|
||||||
|
;; (kbd "s-<mouse-9>") 'helm-mini
|
||||||
|
))
|
||||||
|
|
||||||
(with-eval-after-load 'help-mode
|
(with-eval-after-load 'help-mode
|
||||||
(cp-set-keys
|
(cp-set-keys
|
||||||
|
|
Loading…
Reference in New Issue