strickinato/evil-briefcase


Change cases quickly with vim motions in emacs

License: GPL-3.0

Language: Emacs Lisp

Keywords: emacs, emacs-lisp, evil, spacemacs, string-manipulation


Evil Briefcase!

This package provides a vim motion to quickly switch between cases. Hate camelCase? SWAP IT!!!

Usage (spacemacs)

In your .spacemacs file (SPC f e d):

dotspacemacs-additional-packages
'(
  (evil-briefcase :location (recipe :fetcher github :repo "strickinato/evil-briefcase"))
)

Then in the user config later in the file:

(defun dotspacemacs/user-config ()
  (evil-briefcase-mode 1)
)

Can be used either as a motion:

zcE -- Make everything until the whitespace camelcased

zki( -- Make everthing inside the parentheses kebab kase

Or it can be used in visual mode:

vi(zk -- Select everything in the parentheses visually, then make it kebab kase

Keybindings

keybinding function case
zC evil-briefcase-camel-upper CamelCase
zc evil-briefcase-camel-lower camelCase
zS evil-briefcase-snake-upper SCREAMING_SNAKE_CASE
zs evil-briefcase-snake-lower snake_case
zK evil-briefcase-kebab-upper FAT-KEBAB-KASE
zk evil-briefcase-kebab-lower kebab-kase

Known Annoyances

This overwrites evil's current zs, which is evil-close-fold. I never use folding, but if you use code folding and don't rely on toggling, then you'll have to remap it back.

These functions are based of the amazing s.el. This made the package easy to write, but it also means that ceratin non text characters get stripped away. eg.

[:openTheBriefcase], with cursor on the B:

  zci[ #=> [open_the_briefcase] (we lose the colon)

Project Statistics

Sourcerank 4
Repository Size 17.6 KB
Stars 10
Forks 2
Watchers 2
Open issues 1
Dependencies 0
Contributors 1
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

Aaron Strick

Something wrong with this page? Make a suggestion

Last synced: 2017-12-23 18:15:33 UTC

Login to resync this repository