An emacs command that is clone of "ci" in vim.
Emacs Lisp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.txt
README.md
ciel.el

README.md

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