All Projects → nivekuil → Corral

nivekuil / Corral

Quickly surround text with delimiters in emacs

Projects that are alternatives of or similar to Corral

Nyxt
Nyxt - the hacker's power-browser.
Stars: ✭ 7,038 (+8697.5%)
Mutual labels:  productivity, emacs
Pomidor
Pomidor is a simple and cool pomodoro technique timer.
Stars: ✭ 183 (+128.75%)
Mutual labels:  productivity, emacs
Organice
An implementation of Org mode without the dependency of Emacs - built for mobile and desktop browsers
Stars: ✭ 1,327 (+1558.75%)
Mutual labels:  productivity, emacs
Organic
Outliner, organizer and notes management app.
Stars: ✭ 34 (-57.5%)
Mutual labels:  productivity, emacs
Embrace.el
Add/Change/Delete pairs based on `expand-region', similar to `evil-surround'.
Stars: ✭ 76 (-5%)
Mutual labels:  emacs
Flutter.el
Flutter tools for Emacs
Stars: ✭ 72 (-10%)
Mutual labels:  emacs
Dotfiles
💻 Dotfiles for zsh, vim, emacs, tmux, and bash. Tested on mac os.
Stars: ✭ 70 (-12.5%)
Mutual labels:  emacs
Elisp
The hive for Göktuğ's Emacs Stuff.
Stars: ✭ 70 (-12.5%)
Mutual labels:  emacs
Alfred Cheat
Manage your self-defined cheat sheets & knowledge base in Alfred
Stars: ✭ 79 (-1.25%)
Mutual labels:  productivity
Hexo.el
Use Hexo in Emacs elegantly
Stars: ✭ 78 (-2.5%)
Mutual labels:  emacs
Solo Jazz Emacs Theme
An original Emacs theme inspired by the 1992 Solo Jazz cup design.
Stars: ✭ 76 (-5%)
Mutual labels:  emacs
Spacemacs Content
Content for the book - Clojure Development with Spacemacs
Stars: ✭ 72 (-10%)
Mutual labels:  emacs
Org Zettelkasten
An opinionated setup for managing large collections of interlinked org files.
Stars: ✭ 77 (-3.75%)
Mutual labels:  emacs
Gitexplorer Android
Find the right git commands 🔥 without digging through the web.😊😊😉
Stars: ✭ 72 (-10%)
Mutual labels:  productivity
Emacs Sql Indent
Syntax based indentation for SQL files inside GNU Emacs
Stars: ✭ 78 (-2.5%)
Mutual labels:  emacs
Jq Mode
Emacs major mode for editing jq queries.
Stars: ✭ 70 (-12.5%)
Mutual labels:  emacs
Eziam Theme Emacs
A mostly grayscale theme for Emacs, inspired by Tao and Leuven.
Stars: ✭ 74 (-7.5%)
Mutual labels:  emacs
Guess Language.el
Emacs minor mode that detects the language you're typing in. Automatically switches spell checker. Supports multiple languages per document.
Stars: ✭ 78 (-2.5%)
Mutual labels:  emacs
Org Kanban
Simple approach to kanban with emacs' org-mode
Stars: ✭ 74 (-7.5%)
Mutual labels:  emacs
Dmacs
Emacs Literate Configuration with borg
Stars: ✭ 74 (-7.5%)
Mutual labels:  emacs

[[http://melpa.org/#/corral][file:http://melpa.org/packages/corral-badge.svg]] [[http://stable.melpa.org/#/corral][file:http://stable.melpa.org/packages/corral-badge.svg]]

  • Corral Corral is a lightweight package that lets you quickly wrap parentheses and other delimiters around text, intuitively surrounding what you want it to using just two commands.

** Examples [[./corral-example-c.gif]] [[./corral-example-js.gif]] [[./corral-example-el.gif]]

These examples are shown with the built-in =electric-pair-mode= enabled.

** Installation Corral can be found on melpa, and should be installed from there. To install it manually instead, save corral.el to your computer and add this to your init file: #+BEGIN_SRC emacs-lisp (add-to-list 'load-path "/path/to/corral/directory/") (require 'corral) #+END_SRC

** Usage Call a command once to wrap delimiters around the sexp at point. Repeated calls of the same command, backward or forward, will shift the delimiters in the respective direction, corralling more text.

To use these commands, just bind them to keys of your choosing. Here are some example keybindings: #+BEGIN_SRC emacs-lisp (global-set-key (kbd "M-9") 'corral-parentheses-backward) (global-set-key (kbd "M-0") 'corral-parentheses-forward) (global-set-key (kbd "M-[") 'corral-brackets-backward) (global-set-key (kbd "M-]") 'corral-brackets-forward) (global-set-key (kbd "M-{") 'corral-braces-backward) (global-set-key (kbd "M-}") 'corral-braces-forward) (global-set-key (kbd "M-"") 'corral-double-quotes-backward) #+END_SRC

The wrapping algorithm tries to follow these rules:

  • If the point is over a word, it will always wrap around that word.
  • Otherwise, =backward= and =forward= commands should have different effects.

You can tweak how the wrapping works by modifying the syntax table through =corral-syntax-entries= (see [[https://github.com/nivekuil/corral#configure-how-corral-handles-punctuationsymbols][Settings]]).

** Settings *** Keep point position instead of following delimiters This is controlled by the variable =corral-preserve-point=, which can be set manually or through customize. #+BEGIN_SRC emacs-lisp (setq corral-preserve-point t) #+END_SRC *** Configure how corral handles punctuation/symbols Corral can be configured to use special syntax rules, which are set through the variable =corral-syntax-entries=. This variable is a list of syntax entries and follows the same syntax as =modify-syntax-entry=.

For example, if you want to have =#= and == be treated as symbols so that they are wrapped as part of the word: #+BEGIN_SRC emacs-lisp (setq corral-syntax-entries '((?# "_") (? "_"))) #+END_SRC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].