Latest change: Wed Jun 29 14:00:27 CEST 2005 === Abstract Vim has become *the* clone of the text editor "vi". Almost every user of a free operating system will get to know it at some point or other. Vim starts up quite minimalistic, usually just showing some tilde characters on the screen. But it has a lot of power inside! Real show stoppers are syntax coloring and folding, but to show how to use these would take some time. Many users do not know about these features, though: abbreviations, prefix expansion, macro recording, digraph input, filename completion, split windows, help system (:helpg), text formatting, viminfo, and visual modes. Goal: After the talk everyone should know that you can do more than insert and delete with this editor. ;-) Knowledge required: none. this is for everyone who has a need to edit some text. Sven Guckes Julius Plenz === Talk on Vim in 2004 The year before has seen a talk on vim. We will intentionally leave out everything which had been mentioned in it, so if you had been there you will see something new. those of you who had not attended that talk are advised to read up on the slides. "Power Vim Usage - Tips & Tricks for Everyday Editing" by Simon Myers Smylers@stripey.com (Donhost Project Management) http://www.ukuug.org/bios+profiles/SMyers.shtml http://www.ukuug.org/events/linux2004/programme/paper-SMyers/Linux_2004_slides/vim_tips/index.html 1 Intro 2 Learning Vim 3 Moving About 4 Visual Mode 5 Settings in .vimrc 6 Indenting 7 Indenting Done Right 8 Pasting 9 Filetype-Dependent Settings 10 Custom Filetype Settings 11 Easier Typing 12 Spelling Help 13 Working with Text 14 Spelling Checking 15 Reflowing Text 16 Vim in Mozilla 17 CVS 18 Working with Multiple Files 19 Loading Files 20 Repetitive Shell Commands 21 Complex Transformations 22 Summary UKUUG Linux Conference 2004, Leeds, West Yorkshire http://www.ukuug.org/events/linux2004/ Thursday 5th - Sunday 8th August 2004 === Vim 2005 front slide: Sven + Julius, email, link to this talk latex+prosper? tpp? pure text? or as an additional vim help text? ideas: features to show: no changes! positioning cursor H M L repositioning line zz zt zb copy + paste yy p P simple changes: replacement r (rX) R (Rabc) s (xi) switch to insert 1 o+O switch to insert 2 A ($a) I (^i) easy deletions + changes: deleting and insert D (d$) C (c$) S (0C) filter: :r!date !!date vip!par global+subst :g/RE/s,foo,bar, insert mode: inline indenting i_CTRL-D + i_CTRL-T recalling data CTRL-R % # : / command line editing: expansions of filenames, CTRL-D, wildchar=tab, wildmenu visual history: ":history" + ":history /" command line window :q file bookmarks :tag foo splitting windows :sp :vsp horizontal + vertical scrolling sideways zl + zh -> CTRL-W commands, :new, :close, rotate virtual editing (set ve=all) vimdiff could take some time: abbreviations + mappings folding macro recording plugins syntax highlighting first steps only? abbrev: words and phrases, URLs mappings: (de)indent and reformat current paragraph folding: fold current/all/special paragraphs syntax: highlight special words (typos) plugins: suggestions? last pages: summary plug - for zsh workshop thanks - to all that helped feedback - personally & via email! links - to docs etc === Why Vi? general vi advantages: - availability: ubiquitous! (well, almost) - startup: very fast - visual: minimal changes on terminal during editing good for use over slow lines - keyboard: works without cursor keys and function keys, minimal keyboard (plain "us" qwerty) suffices, very good for touch typists - modes: allows prefix numbers and command combinations downside: - modal concept + command combinations - cryptic command names -> steep learning curve Why Vim? Improvements! === Extended Vi Cup Movement: Cursor: h j k l Start/End: 0 $ gm Window: H M L GotoLine: G gg JumpWord: W B E w b e FindChar: fC FC tC TC , ; Searches: / ? n N Paragraphs: { } Sections: [ ] CurrWord: * # . Undo+Redo: u CTRL-R . Join/Sep: J gJ r . Yanking: yy Y yfC ytC Deleting: dd D d^ dw d3w dtC dfC x X - ddp Pasting: p P - "rp - xp . NumPref: 23G 42| 3yy 5dd 23p CommComb: y2w yfC ytC dip Registers: "yy$ "yp vip"vy . Deleting: D (d$) C (c$) Replacing: r R Substitute: s S C Comm->Ins: a i o A I O s cc c3w 20s C S Insert: ^W ^U ^P ^N ^X^F Visual: v V ^V VisualOps: y d ! u U (vip!par) Macro: qCq@C, rek.: qqCj@qq@q - @q -> @@ Windows: ^W + hjkl HJKL n s c Ex: :w :wq :x :q! :wq! :qa! :e foo :new :only :sp :vsp Buffers: :ls :N :bn :bp :ba :b foo :sb foo Arguments: :arg :next :prev :first :last :rew :n `find ...`