Skip to content

Instantly share code, notes, and snippets.

@bling
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bling/ab8b83c60686b3653828 to your computer and use it in GitHub Desktop.
Save bling/ab8b83c60686b3653828 to your computer and use it in GitHub Desktop.
evil-mode lightning talk emacs nyc

evil-mode

who am i?

Bailey Ling

lab49

github/bling @blingcoder

some things i’ve done

vim-bufferline

vim-airline

dotvim

dotemacs

evil-visualstar

pt.el

modal editing

this seems to be what people think of when you mention vim, but…

emacs is modal too

package-list-packages

n and p move up and down i and d to install or delete and x to execute

dired

n and p move up and down j jumps to a buffer with completion m marking files to perform an action afterwards

C-c

every major-mode will add useful goodies in here

so why modal for editing?

because as developers, we are editing text most of the time, not writing

that’s why it’s called ‘normal’ mode, and is the default

it’s the better ergonomic choice. there is no such thing as vim pinky.

for me, i hate where ALT is. and all the cool/important stuff is with Meta

back to basics

let’s start with emacs motions

C-f, C-b, M-f, M-b, M-{, M-}, etc.

and some manipulation commands

killing lines: C-k killing words: M-d killing sentences: M-k

anything more complicated, is a bit more painful

C-SPC, <motion>, <operation>

for example, delete all the text inside (these parentheses with cursor here)

emacs users tend to think in terms of code, not text. they would probably backward-kill-sexp followed by kill-sexp

it’s not uncommon for emacs users to create functions for commonly used text manipulation

composibility is a first-class citizen in vim

what does that mean?

operator

+ motion

+ text object

= awesome

operator + motion + text-object = awesome

operator: [c]hange, [d]elete, [y]ank motion: [i]nner, [a]round text-object: [w]ord, [p]aragraph, [s]entence, [b]lock

easily memorable. you all know how to use vim now, it’s just muscle memory from here.

i know what C-x 5 2 does, do you?

coding can be repetitive

dot operator to the rescue

if i like vim so much, why emacs?

examples

deleting words with the cursor in the middle

changing inside of c-style function block

changing inside of arguments

cgn

gc

surround

ace-jump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment