vim: errorformat=%f\:%l\:Error\\,%m $Id: outline.otl 3479 2009-04-30 21:41:18Z adam $ TODO bookmark (last worked on): "quickfix" [X] replace pause parsing in otl2beamer.py [X] add otl2beamer.py example to quickfix bullet [X] scan "Vim vs. Emacs with Patrick" in TODO file for more ideas [X] update my ~/.vimrc on dotfiles.org [_] start full-screen terminal F11 for full-screen F12 to remove menu bar CTRL-plus/CTRL-minus adjusts font size all examples start in ~/Documents/Fun/Presentations/Vim/examples ALT-TAB between full-screen terminal and slides Metadata Copyright: : Copyright (c)2008 Adam M. Monsen : Permission is granted to copy, distribute and/or modify this document : under the terms of the GNU Free Documentation License, Version 1.2 : or any later version published by the Free Software Foundation; : with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. : A copy of the license is available at http://www.gnu.org/licenses/fdl.html Title: Vim Subtitle: Building Your Plaintext Toolkit Subject: Text Editing and Beyond Keywords: text, vim, editor, programming Author: Adam Monsen Date: Saturday, September 27th, 2008 Institute: TwoBulb Consulting Intro Hello [pause] : I've used Vim for about eight years. I'll probably use it for the : rest of my life. : : Sit back, soak it in. Notes will be posted. work: [http://mifos.org Mifos] [pause] : My name is Adam, and I'm a GNU/Linux and FLOSS enthusiast. I'm new : to the Twin Cities; here for at least as long as it takes me to get : a master's in computer science (at umn.edu). I'm "meonkeys" in the : TCLUG and Ubuntu-us-mn IRC channels. My day job is software : engineering at http://mifos.org, working to help end world poverty : by providing software to banks who offer microloans. demo: initial screen : open Vim, hit F11 immediately (full screen) : : Gut reactions? How do those tildes make you feel? Goals To inspire and to motivate [pause] and to have fun [pause] I hope you... [pause] are inspired to refine the way you edit plain text [pause] are amazed [pause] have fun My inspiration vertical row of tildes [pause] : Really. A coworker was getting work done extremely fast with this : magic-looking tool; never touching his mouse. repetitive task: creating HTML from plain text Theses think about plain text [pause] how much of your daily routine involves quick edits to plain text? [pause] : email? : documents that *should* be plain text? building your plain text toolkit [pause] incremental improvements [pause] UNIX philosophy: small, simple, clean interfaces, modular, "they've already tought of it" [pause] these are not prescriptions: use whatever works for you! [pause] : Emacs does all this, too! Why Vim? [pause] fast, extensible, FLOSS [pause] : read "extensible" as "mostly future proof". Think of a feature : another editor or IDE does. Vim can do it, too! charityware, actually (see :help uganda) [pause] : mention what ":help" means active community [pause] mailing list, IRC channel, vim.org [pause] every *NIX-like server has Vim, or at least Vi For Starters... bare minimum: vimtutor [pause] time invested is time saved in the future [pause] take home message from vimtutor: [pause] how to exit Vim [pause] C-X C-C is the only keystroke combination I know for Emacs [pause] moving around [pause] simple editing Commence Fun! searching [pause] : vim science.txt : Apologize for stupid joke. just hit / [pause] incsearch [pause] * and # and % [pause] spell checking [pause] : vim spell.txt : :set spell : :he spell : /suggest : z= see :help spell [pause] reformatting with gq [pause] : vim reformat.txt : : How would I look up relevant help for this command? line numbering [pause] : vim reformat.txt : :set nu see :help 'number' [pause] repeat commands [pause] : 80i- : 10i#include see :help repeating Demos opening a directory in Vim [pause] : vim . see :help netrw [pause] search-and-replace [pause] : vim science.txt : : :%s/computer/math/gc wrap [pause] : vim reformat.txt : :set wrap! list [pause] : vim reformat.txt : :set list! linebreak [pause] : vim reformat.txt : :set lbr open other file with gf [pause] : "goto file" : vim files.txt windows : split, vsplit, resize, etc. Demos (continued) mouse in xterm [pause] : vim spell.txt : :set mouse=a : click around : select a sentence and delete it see :help 'mouse' [pause] grep [pause] : vim (no file) : :grep txt ** : :vimgrep txt ** quickfix also snuck in there... more on that later [pause] folding [pause] foldmethod=syntax [pause] : vim -o Makefile main.c : zM, zR : :set foldcolumn=2 foldmethod=marker [pause] : vim ~/.vimrc The GUI [pause] : vim spell.txt : :set spell : :gui : might need to be compiled in... works on Ubuntu out of the box : : or, just start gvim : navigating GUI's menus can help show you what's available Demos (continued) sort [pause] : no demo, just see manpage starstar [pause] : vim (no file) : : :argadd **txt : :args : :next, :first, :last argdo [pause] : vim **/bulky.vim : follow directions in script quickfix [pause] : cd qf : vim main.c : : Read Comment. : : What's the compile error? Who knows. : : :make vimdiff [pause] : vimdiff files* (open files.txt, files2.txt) omnicompletion [pause] : vim omni.py : : import os, complete os.path.abspath('.') : os.path.abspath('.') : : ./omni.py CSV file editing : vim address.csv assisted by syntax highlighting Svncommand : cd examples/svncommand/wc/trunk : : edit main.c : : :SVNDiff , \sd : : :SVNVimDiff , \sv : : :SVN Vimoutliner basics [pause] : vim todo.otl : : Explain text format : : Calculate weighted percentages: : ,,cz converting to HTML [pause] : examples/otl_html : ,,cz again : make : make view this presentation: converting to LaTeX : Source of these slides is written in Vimoutliner. : : vim outline.otl : : If there's time, we can go over the conversion script later. Specific Tasks GRE prep example [pause] : examples/gre_prep using/changing the K normal mode command [pause] sorting on save hook [pause] other possibilities: validate HTML, indent, etc... [pause] C/C++ [pause] exhuberant ctags [pause] : make tags : vim main.c : CTRL-] on myfunc : CTRL-] on NUM_CHOICES cscope : not covered .vimrc start small I think mine started with syntax on, set nocompatible latest version is here: [http://dotfiles.org/~meonkeys/.vimrc ] Advanced scripting [pause] just for fun: all the modes Basic normal, visual, select, insert, command-line, ex Additional operator-pending, replace, insert normal/visual/select More info see :help vim-modes-intro [pause] svnlog detection : ~/.vim/scripts.vim Embedding Vim in other programs Your favorite IDE Firefox It's All Text caveat here: working w/Selenium Embedding other software in Vim Perl, Python, Ruby, etc. Stuff I didn't cover LOTS buffers tabs multibyte/i18n many other useful plugins Resources (roughly in order of usefulness) for the neophyte vimtutor built-in help system HUGE, well-written, fast searching, tab completion vim.org tips, scripts, mailing lists, vote for next features my startup file [http://dotfiles.org/~meonkeys/.vimrc ] IRC channel [irc.freenode.net#vim ]