08 Oct 2015

emacs

gnu

TruncateLines

Turn off wrapping for a single buffer using ‘M-x toggle-truncate-lines’.

This is a BufferLocalVariable. You can also use the following in your InitFile, although we don’t recommend it. (set-default 'truncate-lines t)

remove newlines

(defun remove-newlines-in-region ()
  "Removes all newlines in the region."
  (interactive)
  (save-restriction
    (narrow-to-region (point) (mark))
    (goto-char (point-min))
    (while (search-forward "\n" nil t) (replace-match "" nil t))))

(global-set-key [f7] 'remove-newlines-in-region)
(defun unwrap-line ()
      "Remove all newlines until we get to two consecutive ones.
    Or until we reach the end of the buffer.
    Great for unwrapping quotes before sending them on IRC."
      (interactive)
      (let ((start (point))
            (end (copy-marker (or (search-forward "\n\n" nil t)
                                  (point-max))))
            (fill-column (point-max)))
        (fill-region start end)
        (goto-char end)
        (newline)
        (goto-char start)))

(global-set-key (kbd "M-q") 'unwrap-line)

stable build for Mac OS

http://emacsformacosx.com

auto-completion

pabbrev-mode

pabbrev’s main entry point is through the minor mode pabbrev-mode. There is also a global minor mode, called `global-pabbrev-mode’, which does the same in all appropriate buffers.

global-pabbrev-mode

The current user interface looks like so…

p[oint]
pr[ogn]
pre[-command-hook]
pred[ictive]

As the user types the system narrows down the possibilities. The narrowing is based on how many times the words have been used previously. By hitting [tab] at any point the user can complete the word. The [tab] key is normally bound to indent-line. pabbrev-mode preserves access to this command (or whatever else [tab] was bound to), if there is no current expansion.

tab bound to C-i

components components

auto-complete mode

http://stackoverflow.com/questions/8095715/emacs-auto-complete-mode-at-startup

(global-auto-complete-mode t)

bookmark

(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list
   'package-archives
   '("melpa" . "http://melpa.org/packages/")
   t)
  (package-initialize))