X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=b5a999ff40b2b7165ae2aa92670d5acfe3c6fad4;hb=6af03f4c2ac4daa2b0d80bb94b6b84ee1763376d;hp=f0a8f95d7480dbd532fe5b27e7c5d441dd469120;hpb=4b5702e69a2a4b3812abcb8302df2d52275f6e07;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index f0a8f95..b5a999f 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -904,13 +904,11 @@ Setting agenda files and the agenda view #+END_SRC ** Export PDF -Install MacTex-basic and some tex packages -#+BEGIN_SRC bash - +Install MacTex-basic [[http://www.tug.org/mactex/morepackages.html][MacTex-basic]] and some tex packages +#+BEGIN_SRC sh sudo tlmgr update --self sudo tlmgr install titlesec framed threeparttable wrapfig multirow enumitem bbding titling tabu mdframed tcolorbox textpos import varwidth needspace tocloft ntheorem environ trimspaces collection-fontsrecommended capt-of - #+END_SRC #+BEGIN_SRC emacs-lisp :tangle yes :results silent @@ -1012,6 +1010,8 @@ and Defined keys, using vi keybindings, Refer abo-abo's setting [[https://github :init ;; don't ask me to confirm the unsaved change (setq magit-save-repository-buffers nil) + ;; default is 50 + (setq git-commit-summary-max-length 72) :commands magit-status magit-blame :config (dolist (map (list magit-status-mode-map @@ -1340,6 +1340,10 @@ When see function by =C-h f=, and visit the source code, I would like the buffer #+BEGIN_SRC emacs-lisp :tangle yes :results silent (el-get-bundle info+ :url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/info+.el" + ;; (require 'info+) + ) + + (with-eval-after-load 'info (require 'info+)) #+END_SRC @@ -1399,7 +1403,7 @@ Color for Man-mode #+END_SRC ** pdf-tools -#+BEGIN_SRC bash +#+BEGIN_SRC sh brew install poppler #+END_SRC @@ -1426,6 +1430,11 @@ Color for Man-mode ** Dired config =C-o= is defined as a global key for window operation, here unset it in dired mode #+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun sd/dired-new-file () + "Create a new file in dired mode" + (interactive) + (call-interactively 'find-file)) + (defun sd/dired-key-map () "My keybindings for dired" (interactive) @@ -1435,7 +1444,8 @@ Color for Man-mode (define-key dired-mode-map (kbd "M-s") nil) (define-key dired-mode-map (kbd "l") 'dired-isearch-filenames) (define-key dired-mode-map (kbd "H") 'dired-omit-mode) - (define-key dired-mode-map (kbd "DEL") (lambda () (interactive) (find-alternate-file "..")))) + (define-key dired-mode-map (kbd "DEL") (lambda () (interactive) (find-alternate-file ".."))) + (define-key dired-mode-map (kbd "c") 'sd/dired-new-file)) (use-package dired :config @@ -1445,6 +1455,53 @@ Color for Man-mode (add-hook 'dired-mode-hook (lambda () (sd/dired-key-map) (dired-omit-mode)))) + + (setq dired-guess-shell-alist-user + '(("\\.pdf\\'" "evince" "okular") + ("\\.\\(?:djvu\\|eps\\)\\'" "evince") + ("\\.\\(?:jpg\\|jpeg\\|png\\|gif\\|xpm\\)\\'" "eog") + ("\\.\\(?:xcf\\)\\'" "gimp") + ("\\.csv\\'" "libreoffice") + ("\\.tex\\'" "pdflatex" "latex") + ("\\.\\(?:mp4\\|mkv\\|avi\\|flv\\|ogv\\)\\(?:\\.part\\)?\\'" + "vlc") + ("\\.\\(?:mp3\\|flac\\)\\'" "rhythmbox") + ("\\.html?\\'" "firefox") + ("\\.cue?\\'" "audacious"))) + +#+END_SRC + +I would like change the default dired summary +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defadvice dired-summary (around sd/dired-summary activate) + "Revisied dired summary." + (interactive) + (dired-why) + (message + "Δ: d-delete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, +new dir, ?-summary")) +#+END_SRC + +When create a new directory, I want to disalbe =ido= completion. see [[http://stackoverflow.com/questions/7479565/emacs-ido-mode-and-creating-new-files-in-directories-it-keeps-changing-the-dire][here]]. Thhis code snippets copied +from [[https://emacs.stackexchange.com/questions/13713/how-to-disable-ido-in-dired-create-directory/13795#13795?newreg%3Ddb17c20f7af3490fb11cf15f1d888e9e][How to disable IDO in ‘dired-create-directory’]] +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun mk-anti-ido-advice (func &rest args) + "Temporarily disable IDO and call function FUNC with arguments ARGS." + (interactive) + (let ((read-file-name-function #'read-file-name-default)) + (if (called-interactively-p 'any) + (call-interactively func) + (apply func args)))) + + (defun mk-disable-ido (command) + "Disable IDO when command COMMAND is called." + (advice-add command :around #'mk-anti-ido-advice)) +#+END_SRC + +Disalble =ido= when new a directory or file in =dired= mode +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + ;; call the function which you want to disable ido + (mk-disable-ido 'dired-create-directory) + (mk-disable-ido 'sd/dired-new-file) #+END_SRC ** Dired+