http://www.guckes.net/vimberlin/2012-10-25.notes.txt Latest change: Fri Oct 26 12:00:00 CEST 2012 ---------------------------------------------------------- = Meetup = attendees: * 5 male: Kai Peter Rico .. * 1 female: Susanna * 3 coaches: Luca Matthias Sven = Teaching= == jumps == "jumps" are movements of the cursor. == left/down/up/right == h jump one character to the left j jump one line down k jump one line up l jump one character to the right == BOL/EOL == jumps to begin-of-line (BOL) and end-of-line (EOL): 0 jump to "column zero" (begin-of-line) $ jump to last column == word vs WORD == concept of "word" and "WORD": word string of "letters" WORD string of non-whitespace == BOW/EOW == jumps to begin-of-WORD and end-of-WORD: B jump back onto previous begin-of-WORD E jump forward onto next end-of-WORD W jump forward onto next begin-of-WORD == home/middle/last line == jumps within the current window: H "home" to first line within current windows M "middle" to middle line within current windows L "last" to last line within current windows the cursor will be positioned on the first non-whitespace == line jumps == "line jumps" which only find matches on the current line. fx find next 'x', forward - and jump onto it Fx find next 'x', backward - and jump onto it tx jump unto next 'x', forward - and jump onto character before it Tx jump unto next 'x', backward - and jump onto character before it == bracket match == jumping between matching brackets: % jump to the matching 'item' under the cursor eg bracket ('()'), square bracket ('[]'), or curly brace ('{}') = Options = display partial/uncompleted commands: :set showcmd display of special characters: :set list turns on "list display/mode" :set listchars=eol:$,tab:>.,trail:* EOLs with dollar signs TABs starting with '>' and expansion with '.' (dots) trail trailing whitespaces with asterisks :set nu shows line NUmbers expansion of current option values: :set option= changing TABs to spaces (of current tabstop): :set expandtab :retab == Concepts == undo+redo: u undo last (change) command does not undo jumps, only changes. CTRL-R redo last undone command see also: :help redo.txt concept of number prefix 9dd delete nine lines (current line and the next 8 lines) concept of command combination dt) delete unto the next closing bracket a combination of both number prefix and command combination: d2f, delete to the second finding of the next comma = Summary = you should now know these things: jumps: hjkl 0 $ BEW HML fFtT % concepts: number prefix command combination undo+redo options: expandtab number showcmd list listchars = Exercises = play vim-adventures.com :-) = Q&A = q: can you apply the fFtT commands to find matches in following lines? a: no. you have to use '/' and '?' for finding characters/strings then. q: can you change the meaning of letters and their commands? a: yes, you can assign other commands (and even command sequences) to letters and other characters with the ":map" command. = Outlook = more "find jumps" with "/?nN". more command combinations. more concepts (filtering, folding, visual modes) more settings (vimrc etc). buffers and registers. session file. when+where? when: Thu Nov 22nd 2012 20-22h where: LAUNCH/CO EOF