Improve indentation

master
Jacopo De Simoi 7 years ago
parent da34b59fef
commit 5ab39c6b59
  1. 113
      global.org

@ -528,18 +528,19 @@
*** Require *** Require
Require the ~org~ package; I also occasionally use org-pomodoro Require the ~org~ package; I also occasionally use org-pomodoro
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'org) (require 'org)
(require 'org-pomodoro) (require 'org-pomodoro)
#+END_SRC #+END_SRC
*** Hooks *** Hooks
Enable ~auto-fill-mode~ (see Enable ~auto-fill-mode~ (see
[https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Fill.html]) [https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Fill.html])
honestly I do not see where I would not want to use this. honestly I do not see where I would not want to use this.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'turn-on-auto-fill) (add-hook 'org-mode-hook 'turn-on-auto-fill)
#+END_SRC #+END_SRC
*** Cosmetics *** Cosmetics
Change the default ellipsis ~...~ to the unicode ellipsis ~…~ Change the default ellipsis ~...~ to the unicode ellipsis ~…~
*Does not work properly*
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
; (setq org-ellipsis "…") ; (setq org-ellipsis "…")
#+END_SRC #+END_SRC
@ -562,9 +563,9 @@
Open links with external stuff Open links with external stuff
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-file-apps (setq org-file-apps
'((auto-mode . emacs) '((auto-mode . emacs)
("\\.x?html?\\'" . "xdg-open %s") ("\\.x?html?\\'" . "xdg-open %s")
("\\.pdf\\'" . "xdg-open \"%s\""))) ("\\.pdf\\'" . "xdg-open \"%s\"")))
#+END_SRC #+END_SRC
*** Agenda *** Agenda
Set the canonical binding for the agenda Set the canonical binding for the agenda
@ -667,7 +668,8 @@
"* DONE mailto:%?"))) "* DONE mailto:%?")))
#+END_SRC #+END_SRC
*** Source blocks *** Source blocks
Add template for a source block in emacs-lisp. This is useful for writing the emacs init file in literate form Add template for a source block in emacs-lisp. This is useful for
writing the emacs init file in literate form
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-to-list 'org-structure-template-alist (add-to-list 'org-structure-template-alist
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC")) '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
@ -1147,29 +1149,29 @@
acts as a visual bell which flashes the current line. It is (arbitrarily) acts as a visual bell which flashes the current line. It is (arbitrarily)
bound to F15 which is supposed to be triggered by some “illegal” key hit bound to F15 which is supposed to be triggered by some “illegal” key hit
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun flash-hline () (defun flash-hline ()
"Flash the current line to emph some mistake" "Flash the current line to emph some mistake"
(interactive) (interactive)
(let ((fg (face-foreground 'default)) (let ((fg (face-foreground 'default))
(bg (face-background 'hl-line))) (bg (face-background 'hl-line)))
(set-face-background 'hl-line fg) (set-face-background 'hl-line fg)
(run-with-timer (run-with-timer
0.1 nil (lambda () 0.1 nil (lambda ()
(set-face-background 'hl-line "#303030") )))) (set-face-background 'hl-line "#303030") ))))
(global-set-key (kbd "<f15>") 'flash-hline) (global-set-key (kbd "<f15>") 'flash-hline)
#+END_SRC #+END_SRC
** unfill-paragraph ** unfill-paragraph
This is authored by Stefan Monnier <foo at acm.org>. It is the opposite of This is authored by Stefan Monnier <foo at acm.org>. It is the opposite of
fill-paragraph fill-paragraph
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun unfill-paragraph (&optional region) (defun unfill-paragraph (&optional region)
"Takes a multi-line paragraph and makes it into a single line of text." "Takes a multi-line paragraph and makes it into a single line of text."
(interactive (progn (barf-if-buffer-read-only) '(t))) (interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max)) (let ((fill-column (point-max))
;; This would override `fill-column' if it's an integer. ;; This would override `fill-column' if it's an integer.
(emacs-lisp-docstring-fill-column t)) (emacs-lisp-docstring-fill-column t))
(fill-paragraph nil region))) (fill-paragraph nil region)))
#+END_SRC #+END_SRC
** kill-word ** kill-word
dwim manage space after kill-word. This has been morally pasted from dwim manage space after kill-word. This has been morally pasted from
@ -1196,13 +1198,13 @@
(cond ((looking-back "^ *") ; remove extra space at beginning of line (cond ((looking-back "^ *") ; remove extra space at beginning of line
(just-one-space 0) (just-one-space 0)
(indent-according-to-mode)) (indent-according-to-mode))
((looking-back "\\. *") ((looking-back "\\. *")
(just-one-space 2)) (just-one-space 2))
((or (looking-at " ") ((or (looking-at " ")
(looking-back " ")) ; adjust space only if it exists (looking-back " ")) ; adjust space only if it exists
(just-one-space 1)) (just-one-space 1))
(t ; do nothing otherwise, includes case where the point is at EOL (t ; do nothing otherwise, includes case where the point is at EOL
)))) ))))
;; Delete extra horizontal white space after `kill-word' and `backward-kill-word' ;; Delete extra horizontal white space after `kill-word' and `backward-kill-word'
(advice-add 'kill-word :after #'modi/just-one-space-post-kill-word) (advice-add 'kill-word :after #'modi/just-one-space-post-kill-word)
#+END_SRC #+END_SRC
@ -1213,27 +1215,27 @@
Add word count in modeline; useful to prepare those pesky grant Add word count in modeline; useful to prepare those pesky grant
applications applications
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'word-count) (require 'word-count)
#+END_SRC #+END_SRC
* Main packages * Main packages
** Magit ** Magit
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'magit) (require 'magit)
(global-set-key (kbd "C-x C-g") 'magit-status) (global-set-key (kbd "C-x C-g") 'magit-status)
(magit-add-section-hook 'magit-status-sections-hook (magit-add-section-hook 'magit-status-sections-hook
#'magit-insert-submodules #'magit-insert-submodules
#'magit-insert-unpushed-to-pushremote #'magit-insert-unpushed-to-pushremote
:append) :append)
#+END_SRC #+END_SRC
*** magit-todos *** magit-todos
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'magit-todos) (require 'magit-todos)
#+END_SRC #+END_SRC
** smart-tab ** smart-tab
This package is a gem: it allows to make tab work dwim This package is a gem: it allows to make tab work dwim
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'smart-tab) (require 'smart-tab)
(global-smart-tab-mode 1) (global-smart-tab-mode 1)
#+END_SRC #+END_SRC
** Outshine ** Outshine
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -1241,7 +1243,8 @@
(add-hook 'outline-minor-mode-hook 'outshine-hook-function) (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
(setq outshine-use-speed-commands t) (setq outshine-use-speed-commands t)
(defvar outline-minor-mode-prefix "\M-#") (defvar outline-minor-mode-prefix "\M-#")
(eval-after-load 'outshine '(define-key outline-minor-mode-map (kbd "C-M-i") nil)) (eval-after-load 'outshine
'(define-key outline-minor-mode-map (kbd "C-M-i") nil))
;; (add-hook 'sh-mode-hook 'outline-minor-mode) ;; (add-hook 'sh-mode-hook 'outline-minor-mode)
#+END_SRC #+END_SRC
** helm ** helm
@ -1299,8 +1302,8 @@
This is an excellent package, although I do not use it that much This is an excellent package, although I do not use it that much
I should find a better binding I should find a better binding
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'expand-region) (require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region) (global-set-key (kbd "C-=") 'er/expand-region)
#+END_SRC #+END_SRC
** Atomic chrome ** Atomic chrome
This is commented out as it is incompatible with the This is commented out as it is incompatible with the
@ -1312,7 +1315,7 @@
** ERC ** ERC
Enable ~erc dcc~ files transfer Enable ~erc dcc~ files transfer
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'erc-dcc) (require 'erc-dcc)
#+END_SRC #+END_SRC
** TODO Phase out Package.el ** TODO Phase out Package.el
Load package.el Load package.el
@ -1327,15 +1330,15 @@
Save session files to the ~sessions~ directory so that they do not litter Save session files to the ~sessions~ directory so that they do not litter
the ~.emacs.d~ base directory. the ~.emacs.d~ base directory.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun emacs-session-filename (session-id) (defun emacs-session-filename (session-id)
"Construct a filename to save the session in based on SESSION-ID. "Construct a filename to save the session in based on SESSION-ID.
If the directory ~/.emacs.d exists, we make a filename in there, otherwise If the directory ~/.emacs.d exists, we make a filename in there, otherwise
a file in the home directory." a file in the home directory."
(let ((basename (concat "sessions/session." session-id)) (let ((basename (concat "sessions/session." session-id))
(emacs-dir user-emacs-directory)) (emacs-dir user-emacs-directory))
(expand-file-name (if (file-directory-p emacs-dir) (expand-file-name (if (file-directory-p emacs-dir)
(concat emacs-dir basename) (concat emacs-dir basename)
(concat "~/.emacs-" basename))))) (concat "~/.emacs-" basename)))))
#+END_SRC #+END_SRC
* Finale * Finale

Loading…
Cancel
Save