Giter Site home page Giter Site logo

sublimacs's Introduction

Sublimacs

A plugin for Sublime Text 2 to make Sublime as good as Emacs for day-to-day text editing operations.

The goal is to reproduce the best features of Emacs and follow Emacs key bindings as much as possible, while providing the best possible integration with other Sublime and platform functions (like the system pasteboard/clipboard).

Status: early development.

Features:

  • kill ring

Planned:

  • mark history
  • make all clipboard commands use the kill ring and mark history
  • better mark support when pasting
  • more Emacs hot keys

Contribute your favourite Emacs features, it's dead-easy! (See below for a contributor's guide.)

Installation

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone http://github.com/andreyvit/Sublimacs

Key bindings

The following keys are modified by this plugin:

C-space           set mark (currently a Sublime command, mark history coming)
M-/               auto complete

C-w               kill
M-w               save to kill ring
C-k               kill to end of line

C-y               yank
M-y               yank previous
M-S-y             yank next (there is no such command in Emacs, but hey)

Contributor's Guide

So how do you start writing Sublime Text 2 plugins? Turns out, it is very easy. A few pointers:

  • use Tools > New Plugin (or see Sublimacs.py); there are two key imports: sublime and sublime_plugin
  • sublime is fully documented in the API reference here
  • sublime_plugin is also documented in the API reference, but you'd better read its source code which is included with Sublime; on my system it is in /Applications/Sublime Text 2.app/Contents/MacOS/sublime_plugin.py
  • read implementations of many existing Sublime commands in ~/Library/Application Support/Sublime Text 2/Packages/Default
  • finally, see the implementations of Sublimacs commands in Sublimacs.py
  • Sublime automatically loads and reloads any files inside its packages directory, all key bindings, settings and listeners are applied live
  • open console window (View > Show Console) to interact with the built-in Python interpreter
  • in the console, use view.run_command('foo_bar') to run FooBarCommand (or generally use view, window, sublime objects to explore the API)
  • add custom key bindings for your commands in Default (OSX).sublime-keymap

That should get you started with anything you might want to implement.

There is an outdated Emacs kill ring implementation here, but it does not work on a recent version of Sublime (at least on OS X). Still might be a good read.

sublimacs's People

Contributors

andreyvit avatar

Watchers

 avatar  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.