- Vim is the descendant of vi, designed to be (mostly) backwards-compatible
- learning vi is useful when you need to edit a file over ssh, since vi is usually installed in any UNIX/UNIX-based system by default
- Vim’s shortcuts and design, once you learn them, help you search/create/edit/etc files quicker
- these shortcuts are also used in UNIX-based terminals, such as the man page viewer
- Vim offers flexible window management (splitting, etc) and works well with tmux, a popular terminal multiplexer
- Vim’s plugin ecosystem is thriving and full of useful tools for development in most (if not all) languages
- you can extend Vim yourself using Vimscript
- Emacs is highly extensible – if you need a particular function, either someone has released it or you can code it yourself using Emacs Lisp
- Emacs’s abundance of packages gives it the same functionality as a modern IDE
- … and offers other things as well
- manage tasks and todo lists, create presentations, blog posts, and other documents, etc using Org mode
- check mail/IRC within Emacs
- browse Stack Exchange within Emacs (24+)
- play tetris within Emacs
- … etc (check out the Emacs 30-day challenge for other ideas)
- both Emacs and Vim have a very steep learning curve – expect to be slow for at least a week
- both allow you to use the mouse and common navigation keys (eg, the arrow keys, Page Up, Page Down, etc), so go ahead and use them (and a cheatsheet) during the transition period
- Emacs’s heavy reliance on the Ctrl key will literally hurt you – many workarounds exist to avoid RSI
- make your Caps Lock another Ctrl key, or avoid using your pinky when typing
- use a mode such as CUA mode (or a set of configs, such as Spacemacs) that remaps common shortcuts to different keys
- Homebrew:
brew install vim
- macvim
- requires full installation of Xcode (available from App Store)
brew install macvim
- see MacVim in Yosemite article from usevim for possible issues
- emacs-mac-port (recommended for Spacemacs)
- Emacs for Mac OS X
- insert mode
- command mode
- visual mode
- movement
- buffers
- cut/copy/paste
- copy sample config for .vimrc from Github readme
- to install a plugin from Github, include the ff. line in .vimrc (between
call vundle#begin()
andcall vundle#end()
):Plugin 'username/reponame'
- after saving .vimrc, run
:source %
then:PluginInstall
- restart Vim and check if plugin commands are working
- movement
- buffers
- cut/copy/paste
Examples:
- dired - edit directories and the files within them
init.el (.emacs for pre-Emacs 24)
- vim-ruby - documentation: VimRubySupport
- Ruby support is enabled out of the box for Vim 7.x
- vim-rails
- vim-javascript
- vim-haml - also supports Sass/SCSS
- vundle or pathogen - plugin manager
- ctrlp or unite - find things easily
- fugitive - git wrapper within Vim
- (Optional) emmet-vim - expand HTML & CSS snippets, see Emmet
- (Optional) nerdtree - file tree side bar
- (Optional) solarized, zenburn - popular themes
Another sample config: Vim Config for Rails
Other plugins: 10 Vim plugins for Ruby
Note: Use tmux to get more mileage out of your shell
- web-mode - supports multiple languages, including Ruby and JavaScript
- prefer this over javascript-mode
- haml-mode
- helm or ido mode - find things easily
- projectile - project interaction library
- magit - git porcelain within Emacs
- (Optional) emmet-mode - expand HTML & CSS snippets, see Emmet
- (Optional) ace-jump-mode - move your cursor anywhere in 3-4 keystrokes
- (Optional) neotree - file tree side bar similar to nerdtree for Vim
- (Optional) solarized, zenburn - popular themes (more here)
Another sample config: Emacs Config for Rails
Note: Emacs on its own can act as a terminal multiplexer, but you can also integrate it with tmux using a package