https://github.com/ninrod/evil-string-inflection
:camel: evil operator to cycle *-case in text objects
https://github.com/ninrod/evil-string-inflection
camelcase elisp evil evil-mode package snakecase
Last synced: over 1 year ago
JSON representation
:camel: evil operator to cycle *-case in text objects
- Host: GitHub
- URL: https://github.com/ninrod/evil-string-inflection
- Owner: ninrod
- License: other
- Created: 2017-11-26T17:55:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-23T13:59:06.000Z (almost 2 years ago)
- Last Synced: 2025-01-09T05:59:00.305Z (over 1 year ago)
- Topics: camelcase, elisp, evil, evil-mode, package, snakecase
- Language: Emacs Lisp
- Homepage:
- Size: 145 KB
- Stars: 30
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.org
- License: license.md
Awesome Lists containing this project
README
* evil-string-inflection (test3)
[[https://travis-ci.org/ninrod/evil-string-inflection.svg?branch=master][https://travis-ci.org/ninrod/evil-string-inflection.svg?branch=master]]
[[https://melpa.org/#/evil-string-inflection][file:https://melpa.org/packages/evil-string-inflection-badge.svg]]
[[https://stable.melpa.org/#/evil-string-inflection][file:https://stable.melpa.org/packages/evil-string-inflection-badge.svg]]
[[https://www.gnu.org/licenses/gpl-3.0.en.html][https://img.shields.io/badge/license-GPLv3-blue.svg]]
[[assets/cases.jpg][assets/cases.jpg]]
Evil operator to cycle text objects through camelCase, kebab-case, snake_case and UPPER_CASE.
It wraps the [[https://github.com/akicho8/string-inflection][string-inflection]] package. Credits and thanks go to [[https://github.com/akicho8][Akira Ikeda]] for writing this library.
* Installation
- Just use [[https://melpa.org][MELPA]]. Here's an oneliner using [[https://github.com/jwiegley/use-package][use-package]]:
#+BEGIN_SRC emacs-lisp
(use-package evil-string-inflection :ensure t)
#+END_SRC
* Usage
This package provides the =g~= operator to transform CamelCase words into snake_case.
You can customize the binding.
Try using =g~io=.
* Examples
- here's a sample cycle. cursor is on =[]=:
#+BEGIN_SRC text
Camel[C]aseWord
-> g~io
camelCaseWord
-> .
camel-case-word
-> .
camel_case_word
-> .
CAMEL_CASE_WORD
-> .
CamelCaseWord
#+END_SRC
* Customization
- you can customize =evil-string-inflection='s binding as follows:
#+BEGIN_SRC emacs-lisp
;; it is g~ by default
(define-key evil-normal-state-map "gR" 'evil-operator-string-inflection)
#+END_SRC
* LICENSE
- [[https://www.gnu.org/licenses/gpl-3.0.en.html][GNU General Public License v3]]
#+BEGIN_SRC text
GNU General Public License v3
Copyright (c) 2017-2021 Filipe Silva (ninrod)
#+END_SRC