Giter Site home page Giter Site logo

casease's Introduction

CASEASE

ease for cases

https://user-images.githubusercontent.com/11796018/105870968-c9319300-6033-11eb-80a3-efb10f80560b.gif

Description

Casease can help you convert cases when you typing a name, like snake_case, camelCase, PascalCase, SCREAMING_CASE.

It can be easily setup with different rules for different programming major modes.

Usage

(require 'casease)

(casease-setup
 :hook python-mode-hook
 :separator ?-
 :entries
 ((pascal "\\(-\\)[a-z]" "[A-Z]")
  (snake "[a-z]")))
;;; hook will be setup, re-run after changing rules or separator

Above is an example setup for python-mode, here we use hyphen as separator.

The entries tells casease when to start conversion, rules will be tested with order. Each rule is a list, the first element is the target case, the rest elements are regexps. If the regexp is matched when looking back from the position of your cursor, conversion will start.

The regexp can have at most one capture group, the captured text will be deleted when conversion start.

The regexp should match at most two characters.

In this example, we can input “the_snake_case” with “the-snake-case”, and input “ThePascalCase” with “-the-pascal-case”.

The conversion will stop once your cursor leaving the highlight or you give a non alphanum input.

See document of casease-setup for more advanced used.

Supported cases

  • snake for snake_case
  • camel for camelCase
  • pascal for PascalCase
  • screaming for SCREAMING_CASE
  • kebab for kebab-case

Licence

Under GPLv3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.