romanodesouza / evilmacs

Emacs settings for vim users (DEPRECATED)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

evilmacs (DEPRECATED)

Emacs settings for vim users.

Table of Contents

Motivation

Vim is a great and powerful editor with awesome and clever motions for fast editing, but when you intend to use it like an ide with some plugins, it becomes slow, mainly because its lack of asynchronous I/O. Emacs is another great editor, fully responsive and relatively fast, but its bindings aren't fluent and ergonomic like vim. This is a try to bring the best of both worlds.

How?

Thanks to evil-mode. It's simply the best vim emulator made ever. With it we can have a sweet experience feeling like home. The plugin is developed by advanced vim users and the Emacs's extensibility makes this possible.

Screenshot

Screenshot

Supported versions

Emacs >= 24

Install

git clone --depth 1 https://github.com/romanoaugusto88/evilmacs ~/.emacs.d

Custom key bindings

Consider C as Ctrl, S as Shift and M as Alt or Command, depending on OS.

Key binding Action Insert Mode Normal Mode Visual Mode
C-p Find files y y y
C-= Expand selection y y y
C-- Contract selection y y y
C-] or gd Jump to definition n y y
K Show doc n y y
,q Kill buffer and q uit indow y y y
,w Delete another opened w indows y y y
,e Goes to e nd of line y y y
,a a g: find in files(requires ag) y y y
,s s ave and goes to normal mode y y y
,d Goes to symbol d efinition in current buffer y y y
,g To g gle with last opened buffer y y y
,h Clear previous h ighlighted search in current buffer y y y
,x Call sme x y y y
,b Switch to b uffer y y y
,v v ertical split y y y
C-return Open new line below y y y
S-return Open new line above y y y
M-/ Alternative search using helm-swoop y y y
tab Expand snippet/emmet or print a tab stop y y y
f5 Revert buffer y y y
f11 Enter distraction free mode y y y

Note: Use C-n and C-p to cycle between menu items, like company or ido.

Note 2: The key bindings leading with , has a delay and should be pressed quickly, otherwise, the keyboard characters will be printed.

Key bindings from evil-nerd-commenter plugin

Key binding Action Insert Mode Normal Mode Visual Mode
,, Comment or uncomment lines n n y
,ci Comment or uncomment lines n y n
,cl Comment or uncomment to the line n y n
,cc Copy and comment lines n y n
,cp Comment or uncomment paragraphs n y n
,cr Comment or uncomment region n y n

Multiple cursors

Binding Action Insert Mode Normal Mode Visual Mode
C-> Mark next occurrence of selected region n n y
C-< Mark previous occurrence of selected region n n y
C-, Mark all occurrences of selected region n n y
C-; Mark next occurrence of selected region interactively n y y
C-S-mouse1 Add new cursor on click y y y

Programming modes

Go

go get golang.org/x/tools/cmd/goimports
go get golang.org/x/tools/cmd/oracle
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/refactor/rename
go get github.com/golang/lint
go get github.com/nsf/gocode
go get code.google.com/p/rog-go/exp/cmd/godef

Tip: Emacs must be aware of $GOPATH env variable. The easy way is just open it from the shell.

Custom key bindings:

Key binding Action Insert Mode Normal Mode Visual Mode
SPCgr Go rename n y n
SPCgoi Go oracle implements n y n
SPCgoc Go oracle callers n y n
SPCgos Go oracle callstack n y n

JavaScript

npm install tern
npm install js-beautify 

Other modes

  • NGINX
  • Dockerfile
  • lua
  • php
  • yaml
  • html
  • css
  • scss

Customizing

You can customize evilmacs by creating a local-config/init-local-config.el file like the example below:

; Load color theme
(require-package 'color-theme-solarized)
(load-theme 'solarized-light t)

(provide 'init-local-config)

License

The MIT License (MIT)

Copyright (c) 2014 Romano Augusto

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Emacs settings for vim users (DEPRECATED)

License:MIT License


Languages

Language:Emacs Lisp 100.0%