Giter Club home page Giter Club logo

sqlup-mode.el's Introduction

sqlup-mode

sqlup-mode is a minor mode for emacs. Its sole purpose is to make your life easier when writing SQL.

Purpose

SQL, by convention, uses upper-case keywords, although lower-case works just as well. As humans, the separation between upper-case and lower-case helps scan and parse the code much more quickly.

This mode has been extended to upcase keywords when using redis-mode as well.

Pronunciation

I gave a talk (slides) at the emacs NYC meetup, and it was decided that sqlup is pronounced skloop.

Installation

Manually

Content TK. Pull request welcome. Same as all other emacs packages, really.

MELPA

MELPA MELPA Stable

Marmalade

sqlup-mode is NOT YET on Marmalade.

Usage

Setup

Here follows an example setup to activate sqlup-mode automatically when entering sql-mode or sql-interactive-mode:

;; Capitalize keywords in SQL mode
(add-hook 'sql-mode-hook 'sqlup-mode)
;; Capitalize keywords in an interactive session (e.g. psql)
(add-hook 'sql-interactive-mode-hook 'sqlup-mode)
;; Set a global keyword to use sqlup on a region
(global-set-key (kbd "C-c u") 'sqlup-capitalize-keywords-in-region)

Normal typing (e.g. SQL REPL)

Activate the minor mode with M-x sqlup-mode and you can just start typing. The minor mode will be triggered by the following keys:

  • SPC
  • (
  • ,
  • ;
  • RET
  • '

Work with a region

Select a region and just call M-x sqlup-capitalize-keywords-in-region. Magic.

Implementation choices

I made the choice of only triggering the word-scanning when a particular keypress happens specifically because I don't want to see the word "ORde" typed when I'm typing "ORDER", and I didn't know a simple way to do it. I believe that in practice, this is good enough.

sqlup-mode.el's People

Contributors

trevoke avatar jahkeup avatar syohex avatar ian-kelling avatar atofigh avatar iqbalansari avatar stardiviner avatar

Watchers

Daniel Kraus avatar James Cloos avatar  avatar

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.