UP | HOME

Editing Configuration

Table of Contents


Multiple Cursors

Multiple Cursors allows for editing Emacs buffers at multiple locations simultaneously at the same time and has transformed how I use Emacs Dired. I can use it to edit many file names at once in a directory by making any dired buffer editable by pressing C-x C-q.

(use-package multiple-cursors
  :straight t
  :defer t
  :bind
  ("C-S-c C-S-c" . 'mc/edit-lines)
  ("C->" . 'mc/mark-next-like-this)
  ("C-<" . 'mc/mark-previous-like-this)
  ("C-c C-<" . 'mc/mark-all-like-this))

YASnippet

YASnippet is a system that povides easy access to many templates that can be inserted into buffers based on their major mode.

Install YASnippet

YASnippet takes a small bit of text or an abbreviation and expands it into a template once the <TAB> key has been pressed. This is very useful for typing sections of text that are repeated often such as creating the #+begin_src emacs-lisp :tangle yes blocks in this Org-mode file such as the one below.

(use-package yasnippet
  :straight t
  :defer 3
  :config
  (yas-global-mode 1))

Install Snippets

The package YASnippet Snippets loads many pre-defined templates for YASnippet. This is very useful as many of the best use cases for YASnippet are already included in this package making reducing the need to create individual custom templates.

(use-package yasnippet-snippets
  :straight t
  :defer t)

End

(provide 'freemacs-editing)

;;; freemacs-editing.el ends here

Date: Time-stamp: <2022-07-21 Thu 18:25>

Author: Thomas Freeman

Created: 2022-07-21 Thu 18:26

Validate