Giter Site home page Giter Site logo

ciel.el's Introduction

Introduction

An emacs command that is clone of "ci" in vim.
You can use ci", ci(, ciw and so on with Ctrl-c, i.
Also you can copy them with Ctrl-c, o instead of Ctrl-c, i.
This is standalone package and you can probably use in any mode.

circleanimationmuvie

I decided to remove cit on master branch, because it's too huge.
I'm not going to add cit againg for now.
Other command is still available and I think it's almost complete.

Comapision with others

  • Similar to the behavior of vim.
  • Possible to kill the nested parentheses if cursor is inside.
  • No dependencies.
  • Works in any mode.
  • Support copying to register.

Installation

Download ciel.el somewhere.
For example:

cd ~/.emacs.d/elisp/
git clone https://github.com/cs14095/ciel.el

or download from melpa.

M-x package-install ciel

Then add the following in your .emacs file:

(setq load-path (cons "~/.emacs.d/elisp/ciel.el" load-path))
(require 'ciel)
(global-set-key "\C-ci" 'ciel-ci)
(global-set-key "\C-co" 'ciel-co)
(global-set-key "\C-crs" 'ciel-copy-to-register)

or you installed by melpa, then just add

(global-set-key "\C-ci" 'ciel-ci)
(global-set-key "\C-co" 'ciel-co)
(global-set-key "\C-crs" 'ciel-copy-to-register)

additionaly you want to bind spacific command, then add

(global-set-key "favorite key" 'ciel-kill-a-word)
(global-set-key "favorite key" 'ciel-copy-a-word)
(global-set-key "favorite key" '(lambda ()
									(interactive) 
									(ciel-kill-region-quote "favorite quote")
(global-set-key "favorite key" '(lambda ()
									(interactive)
									(ciel-kill-region-paren "favorite parentheses")

Usage

Press Ctrl-c, i or Ctrl-c, o and enter the available character.
See example or vim usage for more information.

Example

Ctrl-c, i, w => kill a word  
Ctrl-c, i, ' => kill inside ''
Ctrl-c, i, " => kill inside ""  
Ctrl-c, i, ` => kill inside ``  
Ctrl-c, i, [()] => kill inside ()  
Ctrl-c, i, [{}] => kill inside {}  
Ctrl-c, i, [<>] => kill inside <>  
Ctrl-c, i, [[]] => kill inside []  

Ctrl-c, o, w => copy a word  
Ctrl-c, o, ' => copy inside ''
Ctrl-c, o, " => copy inside ""  
Ctrl-c, o, ` => copy inside ``  
Ctrl-c, o, [()] => copy inside ()  
Ctrl-c, o, [{}] => copy inside {}  
Ctrl-c, o, [<>] => copy inside <>  
Ctrl-c, o, [[]] => copy inside []  

Ctrl-c, r, s => copy to register

You can also kill the nested parentheses as you can see.

circleanimationmuvie

Additionaly Functions

  • ciel-kill-region-paren : kill enclosed region in parentheses by parenthesis given as args
  • ciel-copy-region-paren : copy enclosed region in parentheses by parenthesis given as args
  • ciel-kill-region-quote : kill quoted region by quote given as args
  • ciel-copy-region-quote : copy quoted region by quote given as args
  • ciel-kill-a-word : just kill a word
  • ciel-copy-a-word : just copy a word

Conclusion

Almost commands that I know are ready.
Please give me any comments.

License

MIT

ciel.el's People

Contributors

cs14095 avatar zonuexe avatar

Watchers

Zou Bibo 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.