Caine
Hardcore Member
A while ago I decided to install EVIL - the Extensible VI Layer package in Emacs. This package adds the modal editing features of VIM on top of the Emacs platform such that you can use the combination of both.
I am not a real VIM user myself, but I've heard from others that the majority of commonly used VIM functionality is available nowadays. Your mileage may vary, but often things work differently in only minor ways.
So, why make this switch? It does not make sense to me to not use the best tool available. I have come to believe that of these two editors, VIM is the better text-editor if we focus primarily on precision manipulation of text, whereas Emacs is by far the better platform of the two. As such, I started on the road to learn more VIM. I think it would be much more interesting to share the tips and tricks of both editors and learn from eachother instead of fighting a holy war about which one is best.
So, my first tip for Emacs & VIM users is to install Emacs and Evil. Fire up an emacs 24.x environment and open (C-x C-f) your ~/.emacs file. Add some repositories by typing the following
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
Either reboot Emacs or execute these lines and type (this opens Emacs built-in package manager): M-x package-list-packagesSearch for evil (C-s) and type i followed by x. Now evil should be installed.
If you are an Emacs user instead of a VIM user you might want to purge VIMs insertion mode to make it behave as emacs in insertion mode. Add the following lines:
(evil-mode)
(setcdr evil-insert-state-map nil)
(define-key evil-insert-state-map
(read-kbd-macro evil-toggle-key) 'evil-emacs-state)
(define-key evil-insert-state-map
(kbd "ESC") 'evil-normal-state)
Now C-z will toggle Emacs/VIM mode (Emacs mode is a mode which completely behaves as regular Emacs).ESC will go to normal mode and insert mode is a regular emacs (which means you rarily need to switch to Emacs mode ).
Another Emacs tip
Learn emacs dired! Dired (C-x d) is a textual file manager which allows you to navigate and manipulate your filesystem in a textual mode.
Some cool tricks:
I am not a real VIM user myself, but I've heard from others that the majority of commonly used VIM functionality is available nowadays. Your mileage may vary, but often things work differently in only minor ways.
So, why make this switch? It does not make sense to me to not use the best tool available. I have come to believe that of these two editors, VIM is the better text-editor if we focus primarily on precision manipulation of text, whereas Emacs is by far the better platform of the two. As such, I started on the road to learn more VIM. I think it would be much more interesting to share the tips and tricks of both editors and learn from eachother instead of fighting a holy war about which one is best.
So, my first tip for Emacs & VIM users is to install Emacs and Evil. Fire up an emacs 24.x environment and open (C-x C-f) your ~/.emacs file. Add some repositories by typing the following
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
Either reboot Emacs or execute these lines and type (this opens Emacs built-in package manager): M-x package-list-packagesSearch for evil (C-s) and type i followed by x. Now evil should be installed.
If you are an Emacs user instead of a VIM user you might want to purge VIMs insertion mode to make it behave as emacs in insertion mode. Add the following lines:
(evil-mode)
(setcdr evil-insert-state-map nil)
(define-key evil-insert-state-map
(read-kbd-macro evil-toggle-key) 'evil-emacs-state)
(define-key evil-insert-state-map
(kbd "ESC") 'evil-normal-state)
Now C-z will toggle Emacs/VIM mode (Emacs mode is a mode which completely behaves as regular Emacs).ESC will go to normal mode and insert mode is a regular emacs (which means you rarily need to switch to Emacs mode ).
Another Emacs tip
Learn emacs dired! Dired (C-x d) is a textual file manager which allows you to navigate and manipulate your filesystem in a textual mode.
Some cool tricks:
- C-x C-q toggles read-only mode in Emacs. When used from a dired buffer you can edit filenames as if you are just changinga text-file (VIM block selection and Emacs replace-regexp are very useful here for mass-renaming). You can then commit these changes to disk by using C-c C-c.
- Keyboard macros work across buffers in Emacs. Combining this with dired you can easily execute keyboard macros across multiple files. Powerful stuff
- Use M-x find-dired and M-x find-name-dired to open a dired buffer with the output of the find command.
- <edit>Some corrections</edit>
Last edited by a moderator: