mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 04:20:57 +01:00
+more
This commit is contained in:
109
.emacs
109
.emacs
@@ -645,6 +645,10 @@
|
||||
|
||||
;; ** TODO
|
||||
|
||||
;; - check dired hydra
|
||||
;; - complete org table hydra
|
||||
|
||||
;; Old
|
||||
;; - check helpful https://github.com/wilfred/helpful
|
||||
;; - check no-littering https://github.com/tarsius/no-littering
|
||||
;; - submit novel + mark-copy-yank-things-mode to MELPA
|
||||
@@ -3447,8 +3451,7 @@ down and unfold it, otherwise jump paragraph as usual."
|
||||
;; I'm so used to lovely org mode tables, I need them everywhere!
|
||||
(require 'org-table)
|
||||
|
||||
;; allow me to insert org tables everywhere on request
|
||||
(defalias 'table 'orgtbl-mode)
|
||||
|
||||
|
||||
;; convert CSV region to table
|
||||
(defun tablify (regex)
|
||||
@@ -3627,6 +3630,15 @@ intended to be #'> to support reverse sorting."
|
||||
(interactive "P")
|
||||
(mcyt--blink-and-copy-thing 'tvd-beginning-of-cell 'tvd-end-of-cell arg))
|
||||
|
||||
(defun tvd-del-org-table-cell (&optional arg)
|
||||
"Delete a cell"
|
||||
(interactive "P")
|
||||
(let
|
||||
((beg (progn (tvd-beginning-of-cell) (point)))
|
||||
(end (progn (tvd-end-of-cell) (point))))
|
||||
(delete-region beg end)
|
||||
(org-table-align)))
|
||||
|
||||
;; Sometimes I need to copy whole columns too:
|
||||
;; via [[https://emacs.stackexchange.com/questions/28270/how-to-select-and-copy-a-column-of-an-org-table-without-rectangle-selection][stackoverflow]]
|
||||
|
||||
@@ -3679,12 +3691,12 @@ intended to be #'> to support reverse sorting."
|
||||
(add-hook 'org-mode-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "C-c o") 'org-table-copy-col)
|
||||
(local-set-key (kbd "C-c t") 'tvd-copy-org-table-cell))))
|
||||
(local-set-key (kbd "C-c c") 'tvd-copy-org-table-cell))))
|
||||
|
||||
;; eval-after-load 'orgtbl doesn't work
|
||||
(add-hook 'orgtbl-mode-hook '(lambda ()
|
||||
(define-key orgtbl-mode-map (kbd "C-c o") 'org-table-copy-col)
|
||||
(define-key orgtbl-mode-map (kbd "C-c t") 'tvd-copy-org-table-cell)))
|
||||
(define-key orgtbl-mode-map (kbd "C-c c") 'tvd-copy-org-table-cell)))
|
||||
|
||||
;; integers, reals, positives, set via custom
|
||||
(setq org-table-number-regexp "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
|
||||
@@ -3692,16 +3704,16 @@ intended to be #'> to support reverse sorting."
|
||||
;; table hydras, maybe better than aliases?!
|
||||
(defhydra hydra-org-tables (:color blue)
|
||||
"
|
||||
^Sort by^ ^Transform to^ ^Copy what^ ^Modify^
|
||||
^^^^^^-----------------------------------------------------------------------
|
||||
_sa_: alphanumeric _tc_: CSV _cl_: Column _cd_: Delete Column
|
||||
_sA_: -alphanumeric _te_: Excel _cc_: Cell _ci_: Insert Column
|
||||
_si_: ip _tl_: Latex _rd_: Delete Row
|
||||
_sI_: -ip _th_: HTML _ri_: Insert Row
|
||||
_sn_: numeric _tt_: Tab _li_: Insert Line
|
||||
_sN_: -numeric _ta_: Aligned _tr_: Transpose Table
|
||||
_st_: time _to_: Org Mode
|
||||
_sT_: -time ^^ _q_: Cancel
|
||||
^Sort by^ ^Transform to^ ^Copy/Del what^ ^Modify^ ^Outside Org^
|
||||
^^^^^^^^----------------------------------------------------------------------------------------------------------
|
||||
_sa_: alphanumeric _tc_: CSV _cl_: Copy Column _cd_: Delete Column _ot_: Table to Org Mode
|
||||
_sA_: -alphanumeric _te_: Excel _cc_: Copy Cell _ci_: Insert Column _oe_: Enable Org-Tbl Mode
|
||||
_si_: ip _tl_: Latex _dd_: Delete Cell _rd_: Delete Row
|
||||
_sI_: -ip _th_: HTML _dc_: Delete Column _ri_: Insert Row
|
||||
_sn_: numeric _tt_: Tab _dr_: Delete Row _li_: Insert Line
|
||||
_sN_: -numeric _ta_: Aligned ^^ _tr_: Transpose Table
|
||||
_st_: time
|
||||
_sT_: -time ^^ ^^ ^^ _q_: Cancel
|
||||
|
||||
|
||||
"
|
||||
@@ -3720,20 +3732,29 @@ _sT_: -time ^^ _q_: Cancel
|
||||
("th" table-to-html )
|
||||
("tt" table-to-csv-tab )
|
||||
("ta" table-to-aligned )
|
||||
("to" tablify )
|
||||
|
||||
("cl" org-table-copy-col )
|
||||
("cc" tvd-copy-org-table-cell )
|
||||
("cc" tvd-copy-org-table-cell)
|
||||
("dd" org-table-blank-field)
|
||||
("dr" nil)
|
||||
("dc" nil)
|
||||
|
||||
("cd" org-table-delete-column)
|
||||
("ci" org-table-insert-column)
|
||||
("rd" org-table-kill-row)
|
||||
("ri" org-table-insert-row)
|
||||
("li" org-table-insert-hline-and-move)
|
||||
("li" org-table-hline-and-move)
|
||||
("tr" org-table-transpose-table-at-point)
|
||||
|
||||
("ot" tablify )
|
||||
("oe" orgtbl-mode)
|
||||
|
||||
("q" nil :color red))
|
||||
|
||||
;; allow me to insert org tables everywhere on request
|
||||
(defalias 'table 'hydra-org-tables/body)
|
||||
(global-set-key (kbd "C-c t") 'hydra-org-tables/body)
|
||||
|
||||
;; *** org mode slideshows
|
||||
|
||||
;; Making presentations within emacs with org mode is cool as well.
|
||||
@@ -4862,7 +4883,61 @@ files marked, always operate on current line in dired-mode"
|
||||
|
||||
;; overwrite some defaults I do not use anyway
|
||||
(define-key dired-mode-map (kbd "n") 'dired-create-directory)))
|
||||
;; **** Dired Hydra
|
||||
|
||||
;; FIXME: not yet customized to fit my own config
|
||||
(defhydra hydra-dired (:hint nil :color pink)
|
||||
"
|
||||
_+_ mkdir _v_iew _m_ark _(_ details _i_nsert-subdir wdired
|
||||
_C_opy _O_ view other _U_nmark all _)_ omit-mode _$_ hide-subdir C-x C-q : edit
|
||||
_D_elete _o_pen other _u_nmark _l_ redisplay _w_ kill-subdir C-c C-c : commit
|
||||
_R_ename _M_ chmod _t_oggle _g_ revert buf _e_ ediff C-c ESC : abort
|
||||
_Y_ rel symlink _G_ chgrp _E_xtension mark _s_ort _=_ pdiff
|
||||
_S_ymlink ^ ^ _F_ind marked _._ toggle hydra \\ flyspell
|
||||
_r_sync ^ ^ ^ ^ ^ ^ _?_ summary
|
||||
_z_ compress-file _A_ find regexp
|
||||
_Z_ compress _Q_ repl regexp
|
||||
|
||||
T - tag prefix
|
||||
"
|
||||
("\\" dired-do-ispell)
|
||||
("(" dired-hide-details-mode)
|
||||
(")" dired-omit-mode)
|
||||
("+" dired-create-directory)
|
||||
("=" diredp-ediff) ;; smart diff
|
||||
("?" dired-summary)
|
||||
("$" diredp-hide-subdir-nomove)
|
||||
("A" dired-do-find-regexp)
|
||||
("C" dired-do-copy) ;; Copy all marked files
|
||||
("D" dired-do-delete)
|
||||
("E" dired-mark-extension)
|
||||
("e" dired-ediff-files)
|
||||
("F" dired-do-find-marked-files)
|
||||
("G" dired-do-chgrp)
|
||||
("g" revert-buffer) ;; read all directories again (refresh)
|
||||
("i" dired-maybe-insert-subdir)
|
||||
("l" dired-do-redisplay) ;; relist the marked or singel directory
|
||||
("M" dired-do-chmod)
|
||||
("m" dired-mark)
|
||||
("O" dired-display-file)
|
||||
("o" dired-find-file-other-window)
|
||||
("Q" dired-do-find-regexp-and-replace)
|
||||
("R" dired-do-rename)
|
||||
("r" dired-do-rsynch)
|
||||
("S" dired-do-symlink)
|
||||
("s" dired-sort-toggle-or-edit)
|
||||
("t" dired-toggle-marks)
|
||||
("U" dired-unmark-all-marks)
|
||||
("u" dired-unmark)
|
||||
("v" dired-view-file) ;; q to exit, s to search, = gets line #
|
||||
("w" dired-kill-subdir)
|
||||
("Y" dired-do-relsymlink)
|
||||
("z" diredp-compress-this-file)
|
||||
("Z" dired-do-compress)
|
||||
("q" nil)
|
||||
("." nil :color blue))
|
||||
|
||||
(define-key dired-mode-map "." 'hydra-dired/body)
|
||||
|
||||
;; *** Ediff Config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user