Fun with VIM: The Basics
Introduction
- Thank you for coming!
- Vim is fun! I hope you enjoy the presentation!
- Today geared toward absolute beginners
- Thursday after break will cover additional features
- First cover a little background, then start using vim
- Background
- Brief History
- Installation
- Resources
- Insert mode and normal mode
History
- vi: visual editor - Bill Joy - 1976 - BSD Unix
- Vi-IMitation - Bram Moolenaar - 1991
- Vi-IMproved - Bram Moolenaar - 1992
- Vim 5 - 1998
- Syntax highlighting
- Scripting language
- Vim 6 - 2001
- Folding
- Vertical splits
- Diff mode
- File Browser
- Command Window
- Vim 7 - 2006
- spell checking
- Dictionary in scripts
- Omni completion (ie intellisense)
- Tabbed editing
Installation
- Vim.org: The main vim page
- Download gvim71.exe to install
- Two versions:
- Command line: vim
- GUI: gvim
- On Windows, choose batch files option to get command line
- Note: Ada vim is broken - fixes are described in the 320 pages
Online References
- Vim.org: The main vim page
- Dr. Chip's Vim Page has lots of nice stuff
- User Manual and other documentation is
here
- From within vim, get User Manual with :h user-manual
- Google
- Reference pages:
Books
Modes!!!!!
- Vim editor uses several modes
- Definition of modes: mode determines how vim responds to input
- Most important modes: normal and insert
- Startup in normal mode
- In startup mode, keystrokes are COMMANDS!
- Keystroke i changes to insert mode
- In insert mode, keystrokes are entered into the file!
- Keystroke ESC changes from insert mode to normal mode
Let's look at/edit some notes
Benefits
- fast: keep hands on keys
- fast: minimal keystrokes
- powerful editing features (eg column operations)
- highly configurable (eg smartcase)
- extensible: scripting language built in, can also use perl, ruby, python
- ubiquitous
- use same environment for programming in any language
Advice
- Use vimtutor and the user manual
- Learn most frequently used operations til they are completely natural:
- Basic movement, input, changing
- Ranges/blocks
- Help
- To swap lines and characters
- Undo, redo
- Use abbreviations and <TAB> completion
- Add new commands as needed
- The more you learn, the easier it is to learn (because it's well designed)