Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Emacs evil-mode

Emacs evil-mode

Why Emacs + evil-mode might be a viable (or better?) alternative to regular Vim.
History, LISP and short how to write your own customizations.

https://vimeo.com/90132316

Łukasz Korecki

March 10, 2014
Tweet

More Decks by Łukasz Korecki

Other Decks in Programming

Transcript

  1. EVIL (come to the dark side - we have LISP)

    Łukasz Korecki - @lukaszkorecki everywhere where it matters VimLondon March 2014
  2. I like text editors Vim - 6+ years E -

    2 years Borland Pascal text editor - 2 years
  3. I like text editors Vim - 6+ years E -

    2 years Borland Pascal text editor - 2 years Sublime Text - 3 minutes
  4. I like text editors Vim - 6+ years E -

    2 years Borland Pascal text editor - 2 years Sublime Text - 3 minutes Emacs - 1 year
  5. I like text editors Vim - 6+ years E -

    2 years Borland Pascal text editor - 2 years Sublime Text - 3 minutes Emacs - 1 year Emacs + evil-mode - 3 months
  6. Emacs? Old (1976) Elisp Powerful Decent editor (really!) Hundreds of

    packages Everywhere Old (1976) Kitchen sink Painful to configure Not modal M-x everything Built-in therapist
  7. The evil good HJKL (duh) All major modes supported (insert,

    visual, etc) Text objects Emacs wiki Lisp
  8. The evil ugly Command mode - missing q: -no C-r

    0 (pasting from paste buffer into command) Abbreviations Tags - kinda there, but uses etags and it’s all weird Documentation Emacs Wiki
  9. The evil dead Major and minor mode integration - fixable

    with plugins, but… Indentation Can’t avoid using Control/Alt/Shift in some cases
  10. Why then? We deserve better first-class extension language in Vim.

    And people want it. That’s not going to change.
  11. Example (defun ruby-convert-hash () (interactive) (delete-char 1) (search-forward " ")

    (delete-backward-char 1) (zap-to-char 1 ?>) (insert ":")) (evil-leader/set-key “ch” ‘ruby-convert-hash)
  12. Example - abbreviations (define-abbrev-table 'ruby-mode-abbrev-table '(("bli" "{ |XXX| }" abbrevs-jump-to-placeholder

    0)) (defun abbrevs-jump-to-placeholder () (search-backward "XXX") (delete-char 3))
  13. Migrating Ctrl-P - Projectile - needs adding key bindings (I

    use <leader>p|P|d|T|t) Fugitive - Magit - doesn’t integrate at all but is as powerful as fugitive NERDtree - CEDET (good luck!) or Speedbar or at least 3 other solutions
  14. “Fixing” magit ; done already - magit-status is an existing

    function (evil-ex-define-cmd "Git-status" 'magit-status) ; we will fill in the blanks (evil-ex-define-cmd "Git-remove" 'evil-git-remove-current-file) (evil-ex-define-cmd "Git-checkout" 'evil-git-checkout-current- file)
  15. Steal it https://github.com/lukaszkorecki/DotFiles (bash, tmux and stuff) https://github.com/lukaszkorecki/cult-leader (my own

    “starter-kit”) https://github.com/lukaszkorecki/DotVim (my minimal vim config)