Coder Social home page Coder Social logo

caseformat's Introduction

caseformat

Build Status Coverage Status MELPA MELPA Stable

Caseformat is a format based letter case converter.

screencast

This tool helps you to insert uppercase alphabetical characters without shift keys. This is inspired by sticky, sequential-command and electric-case.

Requirements

  • Emacs 24 or later
  • cl-lib
  • dash
  • s

Installation

You can install caseformat from MELPA or MELPA Stable by following steps:

  1. Setup the Emacs built-in package manager to use MELPA or MELPA Stable.
    MELPA's documentation is here.

  2. Install caseformat.
    M-x package-install caseformat

Basic usage

  1. Enable caseformat-mode with M-x caseformat-mode or M-x global-caseformat-mode

  2. Press M-l after insertion of a string that you want to convert

Mechanism of conversion

Caseformat converts prefixed alphabetical characters with converter functions. For example, "camel-case-string" will be converted to "camelCaseString" by caseformat-convert.

(caseformat-convert "camel-case-string") ; => "camelCaseString"

Internally caseformat-convert splits an input string into prefixed strings. Then caseformat converts them with converter functions corresponding to prefixes and returns a concatenated string.

prefixed string prefix converter result
camel nothing nothing camel
-case "-" capitalize Case
-string "-" capitalize String

Prefixes and corresponding converters are determined by caseformat-converter-table. So only registered strings in the value of it are handled as prefixes. The default value of it is below:

caseformat-converter-table
;; => (("-" capitalize)
;;     (":" upcase)
;;     (t downcase))

Conversion of a no-prefix string

A function which corresponds to t in caseformat-converter-table, it is called to convert a string if the string has no prefix.

By default, "FOOBAR" is converted to "foobar" by downcase but "FOO-BAR" is converted to "FOOBar".

Versioning

The versioning of caseformat follows Semantic Versioning 2.0.0.

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.