20:06:04 #startmeeting 20:06:04 Meeting started Tue Dec 13 20:06:04 2011 UTC. The chair is FranciscoD. Information about MeetBot at http://wiki.debian.org/MeetBot. 20:06:04 Useful Commands: #action #agreed #halp #info #idea #link #topic. 20:06:22 #meetingname fedora-classroom session on VIM 20:06:22 The meeting name has been set to 'fedora-classroom_session_on_vim' 20:06:36 http://fedoraproject.org/wiki/Zodbot#Meeting_Functions 20:06:47 do have a quick look on how to use zodbot 20:06:53 * nirik hopes topic now will work for you. ;) 20:07:23 nirik: meetingname and topic different? 20:07:33 meetingname and meetingtopic? 20:07:44 #topic prerequisits 20:07:52 yeah, topic changes the channel topic. ;) 20:07:59 anyhow, do start in. 20:08:09 su -c 'yum install vim vim-X11 vim-vimoutliner' 20:08:25 please run the command to install the required packages from the fedora repositories 20:08:48 if at any point in the class, you have a question, please stop me and ask away :) 20:08:57 done :) 20:09:20 Already done :) 20:09:35 done ! 20:09:41 ok 20:09:50 what about debian users 20:10:14 done 20:10:41 crappy network, sorry 20:10:47 done ! 20:10:55 Awes: should be 'sudo apt-get install vim vim-X11 vim-vimoutliner 20:11:18 thanks chuckf 20:11:27 'sudo apt-get install vim vim-X11 vim-vimoutliner' last char please 20:11:43 please use your distro specific commands, all my commands will be on a fedora machine, 20:11:49 most of them are generic though 20:11:54 next: 20:12:01 please download this file to your system: 20:12:04 http://ankursinha.fedorapeople.org/fedora-classroom.txt 20:12:13 its the file we'll work on 20:12:27 * franciscod waits for all to download the file 20:12:40 done 20:12:58 done 20:13:13 got it 20:13:19 done. 20:13:31 done 20:13:36 done 20:13:39 okay, open a terminal 20:13:57 cd to the directory you downloaded the file to: cd <~/ 20:13:58 ok 20:14:01 done 20:14:15 #topic command invocation 20:14:35 #topic command invocation 20:14:37 ah 20:15:03 once you're in the directory where the file resides (verify with 'ls' command) 20:15:09 vim fedora-classroom.txt 20:15:24 that should open the file for you, in the vim editor 20:15:46 * FranciscoD waits for any issues with this step 20:15:56 done 20:15:59 done 20:16:01 open with vim editor 20:16:34 okay, press "ZQ" that is a CAPITAL Z followed by a CAPITAL Q 20:16:43 (What is the difference between pure Vi and Vim) 20:17:00 Awes: i didnt intend to cover that, but vim is basically vi + features 20:17:18 I'm going to give you a crash course so you cab begin using vim efficiently in day to day life 20:17:39 I will give references at the end that you can read up to learn a lot more 20:17:54 okay, so you should be back at the terminal now 20:18:02 yep 20:18:05 yap 20:18:06 (if you opened the file successfully and hit 'ZQ') 20:18:06 ok 20:18:19 ready 20:18:23 it says Entering Ex mode 20:18:46 kalpurush: hit escape twice, hit 'ZQ' 20:18:54 (you pressed something else ;) ) 20:18:54 (what is the Z for Q = Quit) 20:19:04 Awes: coming to it, patience :) 20:19:23 :) 20:20:00 just quit? 20:20:15 the file quits on ZQ 20:20:24 +1 jacobraj 20:20:34 tocha: yep, you should be back to the terminal now 20:20:48 already there 20:20:51 okay 20:21:00 now, lets copy our file to another name: 20:21:11 cp fedora-classroom.txt another-classroom.txt 20:21:32 for people who missed out: 20:21:33 http://meetbot.fedoraproject.org/fedora-classroom/2011-12-13/fedora-classroom_session_on_vim.2011-12-13-20.06.log.txt 20:21:49 done ! 20:21:50 next: vim -p fedora-classroom.txt another-classroom.txt 20:22:36 done 20:22:41 the '-p' flag opens all the files mentioned in the argument list in separate "tabs" 20:22:42 FranciscoD, is it same like vsplit ? 20:23:00 excelent 20:23:02 soumyaC: no, you see all your splits at once, tabs overlap each other 20:23:05 two tabs 20:23:06 good! 20:23:06 you use one tab at a time 20:23:35 beautiful 20:23:41 this is handly when you're coding, i keep all my source files open at once ;) 20:23:44 How to switch the tabs ? 20:23:50 how to switch b/w the tabs 20:23:50 'gt' 20:23:54 try that 20:23:59 gt: next tab 20:24:05 gT: previous tab 20:24:12 (small t and capital T) 20:24:18 nice 20:24:23 it goes in a cycle 20:24:36 oww 20:24:38 :) 20:24:45 if you press 'gT' when you're at the last tab, it comes back to the first.. 20:24:58 FranciscoD, Is that have another way like using one key ? like "TAB" button ? 20:25:45 gt and GT works 20:25:49 sorry 20:25:52 gt gT 20:26:06 I know ;) 20:26:49 okay 20:26:52 FranciscoD, Is that have another way like using one key ? like "TAB" button ? 20:26:55 that's cool 20:27:09 thunderbirdtr: yeah, you can remap all your keys, 20:27:17 i;ll give you a reference on that later :) 20:27:26 good 20:27:27 FranciscoD, Thank you 20:27:32 although its suggested to keep the default mappings generally :) 20:27:39 okay, so back to the terminal 20:27:52 lets go change some text, 20:27:57 #topic modes 20:28:07 open one of the files: 20:28:12 vim fedora-classroom.txt 20:28:27 done 20:28:28 what vim does is, maintain buffers 20:28:38 each file is opened in one of these buffers 20:28:59 by default, once you open a file, you aren't in "insert" mode 20:30:22 my network is really cross today :/ 20:30:35 continuing 20:30:36 .. 20:30:52 not in insert mode implying, what you type doesnt get inserted as text 20:31:00 for instance, ZQ didn't add ZQ to your document 20:31:34 you are in "command modr" 20:31:48 there are more modes in vim 20:31:56 press ":" (thats a colon) 20:32:31 done 20:32:43 you will see a colon pop up in the left bottom corner. 20:32:44 you are now in "ex mode" 20:32:58 after colon, hit "w" and press enter 20:34:07 ":w" is the command that *w*rites your buffer to file 20:34:15 w -> write 20:34:34 switching between modes: 20:34:45 #topic insert mode 20:35:58 hitting "i" in command mode takes you to insert mode 20:35:58 in this mode, vi is just like notepad 20:36:02 you move around with your keys 20:36:06 arrow keys 20:36:18 you type where you want, you delete what you want 20:36:26 to save, his esc 20:36:32 followed by ":w" 20:36:57 that is: esc to get out of insert mode into command mode, and ":w" to *w*rite your buffer to file 20:37:01 any issues till now? 20:37:20 all good 20:37:32 except for his internet 20:37:48 yeah man :/ 20:37:59 switched to my cell phone, should be more stable now 20:38:36 okay, take a minute to get into insert mode, move around the file a bit 20:38:44 then switch between insert and command modes 20:38:49 a few times, so you get used to it 20:39:11 * FranciscoD counts 30 in his head 20:39:54 question: how many of you use vim like this? in insert mode, like a notepad? :P 20:40:14 nope just vi 20:40:22 vi or vim? 20:40:24 not sure vi has a mode like this 20:40:28 those who r attending class now :P 20:40:37 me too vi 20:40:37 Awes: whatever I teach here should be valid in vi too 20:40:43 these are generic thingys 20:40:44 both of it 20:40:48 but mostly vim 20:41:09 i use vi 20:41:29 okay, now this using insert mode majority of the time is *not* the correct way of using vi/vim 20:41:42 it is the *inefficient* way of using vi/vim 20:41:53 i use gvim :p 20:41:58 lol 20:42:03 vi/vim/gvim :P 20:42:17 yader: all these are valid in gvim btw 20:42:26 okay, please come into command mode 20:42:29 nice :) 20:42:34 we're going to explore it 20:42:52 #topic running around in command mode 20:43:24 okay, now there's something called touch typing 20:43:31 (i wont teach you that here :P) 20:43:46 here, you practice so you can type with minimal movement of your fingers 20:43:54 su -c 'yum install gtypist' 20:44:05 gtypist is a tool that teaches you how to touch type correctly 20:44:29 on your qwerty keyboards, you'll notice marks on the 'f' and 'j' keys 20:44:33 this is called home row 20:44:49 the index finger of your left hand goes on f, and of the right hand goes on j 20:45:00 and the other fingers to the next keys respectively 20:45:13 vim makes is easy for you to work in this position 20:45:27 so you can work with minimal movements of your fingers, and therefore efficiently 20:45:33 j - move down a line 20:45:40 k - move up a line 20:45:47 h - move left a character 20:46:00 l - move right a character 20:46:03 try that 20:46:12 see if it works, you have 30 seconds :) 20:46:18 any issues, stop me 20:46:22 done :) 20:46:51 next 20:46:55 hit 'G' 20:47:01 CAPITAL g 20:47:09 this takes you to the last line of the file 20:47:16 hit 'gg' 20:47:22 that is *small* g twice 20:47:29 this takes you to the *first* line of the file 20:47:49 hit '45G' 20:47:55 this takes you to line #45 20:48:03 hit 'gg' to get back to the first line 20:48:28 any trouble in this part? 20:48:32 anyone? 20:48:45 move around a little, try it out 20:48:46 no 20:48:52 * chuckf is good 20:48:59 hit '$' 20:49:03 takes you to the end of the line 20:49:18 hit '0' to go to the beginning of a line 20:49:21 thats ZERO 20:49:36 hit '10|' to go to column 10 20:49:42 thats TEN followed by a PIPE 20:50:11 you should see the row, column positioning of the cursor in the right hand bottom corner 20:50:17 if you cant, hit 'ctrl g' 20:50:40 this will display the file name on the left botton corner, row,col in right bottom corner 20:50:43 all okay? 20:50:53 * soumyaC fine 20:50:55 just gg 20:51:07 yup 20:51:09 I can't used 20:51:13 take your time thunderbirdtr , I'll wait a minute 20:51:24 thunderbirdtr: are you in command mode? hit esc twice to confirm 20:51:26 then try gg 20:51:40 I do done 20:51:55 okay, now 20:52:05 as mentioned earlier, you can use 'i' to enter insert mode 20:52:08 and thus insert text 20:52:18 now you know how to navigate in command mode, on a line basis 20:53:03 now, instead of doing this, we'll use some more navigation shortcuts to make navigation even faster 20:53:19 'w' - moves forward word by word 20:53:28 'b' - moves back word by word 20:53:53 'e' - moves forward word by word too 20:54:02 what;s the difference between 'w' and 'e' then 20:54:04 anyone? 20:54:15 try it, see how to cursor moves and tell me 20:54:26 e is last char 20:54:29 w is first one 20:54:32 beginning and end of the word 20:54:42 cool 20:57:31 :O 20:58:13 apoligies :$ 20:58:39 You should need new ISP 20:58:39 try 'W' - CAPITAL w 20:58:57 lol, it isnt usually this crappy 20:59:06 capital W is similar to small w 20:59:16 the difference being 'W' ignores punctuation 20:59:31 try it 20:59:36 similar for 'E' 20:59:41 similar for 'B' 21:00:05 why move word wise, when you can move SENTENCE wise? 21:00:08 ')' 21:00:14 moves to the next sentence 21:00:26 try it 21:00:48 even better! 21:01:00 ']' moves forward paragraph wise 21:01:09 ( and [ move backwards 21:01:37 ] moves through the entire page for me, not just paragraph 21:01:41 * soumyaC thinks to paste this VIM shortcuts on a sticky note in the screen 21:01:43 so, everyone comfortable with navigation in command mode? 21:02:26 } moves by paragraph for me 21:02:45 ] moves from the whole page 21:02:47 chuckf: ah, thanks, my bad 21:03:14 { and }, (i didnt realize i had the shift pressed :P) 21:03:21 so all okay with navigation? 21:03:27 Yes . 21:03:38 now 21:03:46 most vim commands can be prefixed by a number 21:03:54 this tells vim how many times to repeat the command 21:04:03 so '2{' will take you back 2 paragraphs 21:04:19 '5j' will take you down 5 lines etc 21:04:35 you dont have to press the same command repeatedly, you can use this instead 21:04:53 works with { ( hjklweb 21:05:03 ill give you a minute to play with it 21:05:28 if moving paragraphs wise isnt quick enough 21:05:45 'ctrl f' moves forward by the screenful 21:05:51 'ctrl b' moves back by the screenful 21:06:06 f - *f*orward 21:06:11 b - *b* backward 21:06:20 e - *e*nd 21:06:27 b - *b*egin 21:06:44 most commands are like this, to make it easy to recall 21:06:48 i - *i*nsert 21:07:13 'ctrl d' moves you down half a page 21:07:18 d - *d*own 21:07:29 'ctrl u' moves you back up 21:07:35 u - *u*p 21:08:15 more on command mode later 21:08:21 everyone got a hang of it I hope? 21:08:30 * FranciscoD waits for a response 21:08:35 all good for me 21:08:52 are you going to upload the log of this class FranciscoD? 21:08:55 its a lot of mappings, but you'll get used to it over time 21:08:59 twisted fingers and twisted brain ;-) 21:09:00 yader: yes 21:09:12 http://meetbot.fedoraproject.org/fedora-classroom/2011-12-13/fedora-classroom_session_on_vim.2011-12-13-20.06.log.txt 21:09:16 here's the log 21:09:25 thanks 21:09:28 simonzz: heh, it isnt that bad ;) 21:09:39 next mode, yay! 21:09:40 #topic ex mode 21:09:58 now, 'ex' itself is an editor 21:10:13 it is a 'line editor' which means you can use it to make changes to one line at a time 21:10:25 it was used earlier, people do use it nowadays too 21:10:35 most unix/linux systems will have the ex util 21:10:58 in escape mode, if you press ":" 21:11:03 you enter 'ex' mode 21:11:18 here, you make modifications to the file line wise 21:11:26 so: 21:11:28 ':40' 21:11:34 that is COLON 40 21:11:38 in esc mode 21:11:45 should take you to line # 40 21:12:29 ':w' *w*rites your buffer to file, like you already know 21:12:42 ':wq' - save and *q*uit 21:12:49 Can we see colon number in the vim ? 21:12:51 try that, go to terminal, reopen file 21:13:05 thunderbirdtr: sure, i was going to come to that 21:13:19 I'm waiting ... :) 21:13:20 reopen fedora-classroom.txt 21:13:32 in command mode, :set nu 21:13:51 that is, go to 'ex' mode, 'set nu' followed by enter 21:13:57 this should bring up the line numbers 21:14:17 thunderbirdtr: did you mean column number? 21:14:33 Line number ? 21:14:35 to remove the line numbers, ':set nonu' 21:14:45 yeah, try ':set nu' 21:14:50 see if that works 21:14:56 yes I mean that 21:15:06 FranciscoD, Thank you 21:15:09 everyone okay with showing and hiding line numbers? 21:15:24 yep 21:15:33 yes 21:15:39 now, lets see what line editing can do for us 21:15:52 #topic search and replace 21:16:17 in command mode, "/" searches *forward* for 21:16:22 '?' searches backwars 21:16:31 try searching for 'Fedora' 21:16:58 hit 'n' (small n) to jump to the next match 21:17:02 n - *n*ext 21:17:13 'N' to go to previous match 21:17:33 your matches should also get highlighted 21:17:39 works for everyone? 21:17:47 yep 21:18:00 yeah 21:18:06 perfectly 21:18:13 if you're searching forward, and hit the end of the file, hitting 'n' will get you to the starting of the file 21:18:17 again, in cylic fashion 21:18:24 same for first line + N 21:18:40 now 21:18:47 we've learnt how to search 21:18:53 or we havent :D 21:18:58 search for 'asdfasfsafad' 21:19:06 to unhighlight your 'Fedora's 21:19:18 (search for random letters) 21:19:29 hit 'gg' 21:19:34 then '0' 21:19:38 to get to the first letter of the first line 21:19:41 this is 'Fedora' 21:19:44 all here? 21:19:53 I see all 21:20:03 yes 21:20:14 hit '*' 21:20:18 what happens? 21:20:32 previous search 21:20:33 highlights 21:20:39 highlights previous search 21:20:46 highligts current word 21:20:57 Aah ok 21:21:31 searches for the current word under cursor 21:21:35 yes 21:21:38 my bad 21:21:42 and takes you to the first match *forward* 21:24:28 oh, and '#' is the opposite => *backwards* 21:25:29 aye 21:25:34 that was next 21:25:41 so, you can either use '?' and '/' 21:25:46 or * and # 21:25:54 notice that '?' and '/' are on the same key 21:26:24 now, search, and *replace* 21:26:31 all, come to command mode 21:26:44 in case you're somewhere else 21:26:44 next 21:27:04 try this: ':%s/Fedora/Fedora Linux/g' 21:27:06 and tell me what happens 21:27:47 64 replaces ... 21:28:00 replaces... 21:28:19 it searched and replaced *all* the occurences of 'Fedora' with 'Fedora Linux' 21:28:26 i'll explain the command 21:28:30 : - ex mode 21:28:36 % - *all* lines 21:28:42 s - search and replace command 21:28:52 /Fedora/ - regex to search 21:29:09 /Fedora Linux/ - regex to be replaced with 21:29:35 g - global: whic implies replace all occurences in each line 21:29:47 hit 'u' 21:29:55 it should *u*ndo all changes 21:30:00 Perhaps the 's' is easier to be memorized as *s*ubstitute here 21:30:11 simonzz: aye 21:30:20 i didnt remember that XD 21:30:40 hit 'u' again, the terminal will blink 21:30:54 and in the left bottom corner, you will get a message saying "already at oldest change' 21:31:12 in one session, you can easily undo as many times as you want 21:31:25 I mean there must be a limit, but its big enough for you to not have to worry about 21:31:45 okay, we'd better hurry 21:32:04 #topic more inserts 21:32:26 #topic more inserts 21:32:36 'I' - insert at starting of current line 21:32:56 'O' - insert above current line 21:33:06 'o' - insert above current line 21:33:14 try it out 21:33:16 hit u to undo 21:33:21 'a' - append 21:33:40 unlike 'i' which brings you in insert on the same character, this takes you to the next char 21:33:47 'A' - append at end of line 21:34:13 many a time , you want to join paragraphs 21:34:26 'J' - join current and next sentence 21:34:30 try it, hit u to undo 21:34:39 #topic copy paste 21:34:48 now, important ;) 21:35:01 in vim, copying is called 'yanking' 21:35:10 so the command to use will be 'y' 21:35:16 paste is 'p' 21:35:37 paste before is 'P' 21:35:42 CAPITAL p 21:35:46 try this 21:35:48 gg 0 21:35:54 'yy' p 21:36:14 it should copy the line you were on (yy) and paste it there 21:36:27 if you want to cut use 'd' - *d*elete 21:36:39 you can paste where you want, use your navigation keys 21:36:49 paste, undo etc 21:37:11 d stand for the *d*elete command 21:37:18 the thing is, vim saves it in a buffer 21:37:22 p just gets it from there 21:37:34 since we went into tabs, 21:37:45 :tabedit temp -> opens a new tab named temp 21:38:02 copy a few lines from fedora-classroom.txt, switch to temp using 'gt' and paste it 21:38:05 * FranciscoD_ waits 21:38:16 any issues, let me kniw 21:38:31 I'm going a little fast now, we're already up 1.5 hours :O 21:39:01 go back to the previous tab 21:39:06 this time CUT instead of copy 21:39:14 like 'yy', 'dd' cuts the current line 21:39:20 * FranciscoD_ pauses 21:39:27 thunderbirdtr: on board? 21:39:33 yes 21:39:35 I do all 21:39:37 alright 21:39:41 and listen 21:39:48 now, you'll often want to copy more than i line 21:39:52 rather, generally want to 21:40:01 so, here's how to do it 21:40:14 method #1 21:40:16 5yy 21:40:27 copies the next five lines from current cursor position 21:40:31 similarly 5dd 21:40:38 method #2 21:40:40 the mark method 21:40:52 navigate to the line you want to begin copying from 21:40:57 lets say '40gg' 21:41:11 or '40G' 21:41:13 both work 21:41:21 ':ma' 21:41:27 will *m*ark this line as 'a' 21:41:48 go to line 60 -> 60G 21:42:01 :ma I can't do it 21:42:08 thunderbirdtr: it wont say anthing 21:42:10 Argument required 21:42:25 oh, no ":" sorry 21:42:34 its a command mode thing, not an ex mode thing 21:42:36 thunderbirdtr: ^ 21:42:41 :) don 21:42:42 40G, followed by ma 21:42:43 done .. 21:42:47 go to 60 21:42:49 60G 21:43:01 yes .. 21:43:04 y + ' + a -> y followed by single quote followed by a 21:43:13 this says: *y*ank from marker a 21:43:39 you'll get a message that says: 21 lines yanked 21:43:49 just min please 21:43:54 * FranciscoD_ waits 21:44:11 * FranciscoD_ notes that we have 17 more minutes 21:44:22 while i wait, any issues anyone? 21:44:34 it doesn't seem to be working here 21:44:51 chuckf: press escape twice, retry 21:44:55 ma doesn't work 21:45:05 simonzz: ^ 21:45:08 ma then go to 60 then ya 21:45:16 chuckf: y'a 21:45:22 y + ' + a -> y followed by single quote followed by a 21:45:29 there's a single quote 21:45:39 ah, that fixed it 21:45:43 great! 21:45:53 try CUTTING instead of COPYING 21:45:57 (use d instead of y' 21:45:59 ) 21:46:15 i mean (d + ' + a) 21:46:40 keep pasting in the other tab to confirm it works ;) 21:46:50 that will also get you used to tab changing 21:47:12 all good? 21:48:08 okay, 'gg + 0' to go to the first word of our document 21:48:17 i want to replace 'Fedora' by 'Linux' 21:48:27 one way is to go into INSERT mode and do this 21:48:33 but that is *inefficient* 21:48:39 'cw' 21:48:45 is for *c*hange word 21:48:56 remember that 'w' was for next word 21:49:15 so, if you're at the beginning of a word, and you hit 'cw', the word gets removed 21:49:24 and you can type in its place in insert mode 21:49:28 works for all? 21:49:35 yup 21:49:35 I do 21:49:51 if you hit '2cw', the next *2* words get replaced! 21:50:00 similarly '2cb' 21:50:01 etc 21:50:12 try it out 21:50:45 another tiny command 21:50:51 f - *f*ind 21:50:56 'fr' 21:51:04 will take you to the next occurence of the letter 'r' 21:51:12 F - takes you backwards 21:51:34 '2fr' takes you to the second occurence of 'r' from current cursor position 21:51:37 try it out 21:52:09 not surprisingly, 'cfr' removes stuff till the first occurence of 'r' 21:52:16 gotta go now. Bye and thanks 21:52:26 bye 21:52:29 also try: '2cfr' 21:52:33 see what happens 21:53:26 youll get a hang of how you can mix commands 21:53:36 all okay? 21:53:42 Good 21:53:49 yup 21:53:57 now to replace *one* character, use 'r' 21:53:58 yes 21:54:11 so if i want to make 'Fedora' -> 'Zedora', 21:54:17 i take my cursor to the 'F' 21:54:19 and press rz 21:54:23 rather rZ 21:54:27 try that 21:54:33 u to undo 21:54:53 so youve noticed how easy it is to modify text *out* of insert mode 21:54:58 yes? 21:55:10 sure 21:55:13 vi is somehow fascinating 21:55:21 it sure is 21:55:25 one final topic 21:55:35 #topic marcos 21:55:40 okay 21:55:47 ':tabedit temp123' 21:55:54 to open a new tab 21:56:15 lets say, i want you to number this file, 1 to 100, on each lines 21:56:18 *line 21:56:22 how would you do it? 21:56:27 anyone? 21:56:44 ask you how to do it? 21:56:47 :D 21:56:48 chuckf: lol 21:57:00 one way is as always: INSERT mode 21:57:08 but thats not the vim way ;) 21:57:18 in the new tab, write -> 1 21:57:27 and come out of insert mode to command mode 21:57:39 (hit escape) 21:57:49 now, your cursor should be at 1 21:57:55 hit 'ctrl a' 21:58:01 what happens? 21:58:02 anyone? 21:58:13 increases to 2 21:58:17 nice 21:58:20 hit 'ctrl x' 21:58:23 what happens now? 21:58:26 hit it a few times 21:58:51 +/- 1 21:58:55 aye 21:58:57 nifty, decreases 1 21:59:00 get it back to 1 ;) 21:59:14 press q 21:59:30 a message saying 'recording' will pop up in the bottom left 21:59:49 then, do the following: 21:59:58 yank the current line -> yy 22:00:09 paste it below -> p 22:00:18 hit 'ctrl a' to increase it 22:00:27 ah, missed someting 22:00:31 'qa', not just q 22:00:47 q -> recording; 'qa' means record and save in 'a' 22:01:15 after hitting ctrl a, it increases to 2, hit 'q' again to STOP recording 22:01:22 * FranciscoD_ waits: this ones a little tricky 22:02:23 now, since you recorded in 'a' 22:02:30 we can invoke 'a' 22:02:53 on the second line, where you have '2', his '@a' 22:03:09 all this does is repeat the sequence of commands you had *recorded* in 'a' 22:03:15 you should get 3 on the next line 22:03:27 thunderbirdtr: chuckf : simonzz : let me know if you get stuck 22:03:40 all fine 22:03:44 great 22:03:55 I'm good 22:03:59 great 22:04:02 thunderbirdtr: :P ? 22:04:03 done 22:04:09 ah! awesome 22:04:14 Should you ask :)) 22:04:19 now, we dont want to hit '@a' 100 times either ;) 22:04:28 so in true vi/vim/gvim style, 22:04:38 we go '100@a' with cursor on '3' 22:04:46 result anyone? :) 22:04:58 103 22:04:58 wow 22:05:18 I have 1,2,3,4,5,6... line by line :P 22:05:21 remember u to undo this entire thing ;) 22:05:26 great, so we covered macros 22:05:33 we're 2 hours +, so I'll end here 22:05:48 but I'll take up follow up classes with more advanced stuff asap 22:06:00 i hope you guys learnt that vim is way more than notepad 22:06:00 That would be great 22:06:09 Awsome 22:06:09 try 'vimtutor' 22:06:17 its a tutor that comes with vim 22:06:21 it'll let you practice a bit 22:06:23 command :help is helpful as well 22:06:26 aye 22:06:31 :help y 22:06:42 will open the help for *y*ank for example 22:06:57 Well I like to use --help / man help and FranciscoD Guides :)) 22:06:58 sometimes beginners find it difficult to understand :help text though 22:07:05 heh :) 22:07:13 there's a book if you want to buy 22:07:26 "learning the vi and vim editors" 22:07:30 it has a *lot* of info 22:07:44 #topic references 22:07:50 1. man page ;) 22:07:53 2. :help 22:07:57 3. google 22:08:01 4. 'vi and vim editors' 22:08:09 last: play with it! 22:08:17 okay, ending class 22:08:21 5. Ask questions 22:08:22 :D 22:08:22 * FranciscoD_ asks all to check out http://ask.fedoraproject.org 22:08:27 thunderbirdtr: ^ ;) 22:08:32 for queries, hop on to ask 22:08:38 #endmeeting