13:07:21 <x3mboy> #startmeeting Fedora classroom 13:07:21 <zodbot> Meeting started Fri Aug 18 13:07:21 2017 UTC. The chair is x3mboy. Information about MeetBot at http://wiki.debian.org/MeetBot. 13:07:21 <zodbot> Useful Commands: #action #agreed #halp #info #idea #link #topic. 13:07:21 <zodbot> The meeting name has been set to 'fedora_classroom' 13:07:37 <x3mboy> #meetingname "Fedora classroom - VIM 101" 13:07:37 <zodbot> The meeting name has been set to '"fedora_classroom_-_vim_101"' 13:07:50 <x3mboy> #topic Hello! 13:08:18 <linuxEnthusiast> Hi 13:08:38 <aditya_r> Hi 13:08:45 <pany> .hellomynameis pany 13:08:46 <zodbot> pany: pany 'Pany' <geekpany@gmail.com> 13:09:35 <x3mboy> Hello everyone, my name is Eduard Lucena. I'm a contributor in the Fedora Project, working with Marketing, the Fedora Magazine, Ambassadors and other little things. 13:09:41 <nb> .hello2 13:09:42 <zodbot> nb: nb 'Nick Bebout' <nb@nb.zone> 13:09:45 <foxmean> Hello 13:10:00 <vanheckcz> hi 13:10:07 <x3mboy> We are here to have a little introduction to vim, IMHO the most powerfull cli editor ever 13:10:09 <x3mboy> :D 13:10:21 <mehdi> Really? 13:10:32 <x3mboy> #chair nb 13:10:32 <zodbot> Current chairs: nb x3mboy 13:10:38 <mehdi> the most powerful editor? 13:10:57 <x3mboy> For me, yes. And we will see why 13:11:06 <mehdi> Interesting 13:11:32 <mehdi> I always find it a bit hard to use, accessible though 13:11:57 <x3mboy> mehdi, Well, we are here to learn how to 13:12:14 <mehdi> Yes, we are 13:12:53 <x3mboy> linuxEnthusiast aditya_r pany foxmean vanheckcz mehdi nb welcome to this class 13:13:05 <x3mboy> I will give 2 more minutes to more people to join 13:13:26 <mehdi> Thanks Eduard 13:13:30 <x3mboy> In the meanwhile, please can somebody tell me, what version of vim do you have installed in your system? 13:13:49 <pany> Nice to meet you guys :D 13:13:54 <borg0> 8.0.885 13:14:06 <nmnbd[m]> 8.0 for me 13:14:22 <mehdi> Mine is Vi. Are they the same? 13:14:32 <nb> mehdi, vi is not the same as vim but similar 13:14:34 <pany> version 8.0.946 13:14:38 <nb> vim is a more enhanced version of vi 13:14:40 <linuxEnthusiast> 8.0.855 13:14:54 <linuxEnthusiast> sorry 8.0.885 13:15:00 <mech> 8.0.606 13:15:09 <mehdi> OK, let me install vim 13:15:23 <foxmean> Nice to meet you, I'm the first experience to join tutorial in IRC. Today, I'm plan to observe because of I'm in Job Time. My vim version is 8.0 in Debian 9.1 13:15:31 <nmnbd[m]> can i follow on vi? 13:15:44 <vanheckcz> vim 8.0.586 13:16:21 <mehdi> But, when I run `vi --help` it displays `VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 7 2017 13:21:18)` 13:16:45 <x3mboy> nmnbd[m], probably don't and I'm going to tell you why 13:16:45 <mehdi> So, I guess I have VIM 8.0 installed 13:17:18 <foxmean> mehdi, maybe try $ which vim? 13:17:20 <t-rey> 8.0.855 13:17:43 <foxmean> I guess you have Vim mehdi 13:18:06 <mehdi> foxmean, so which one should I have? 13:18:36 <foxmean> mehdi, try run $ vim --version 13:18:51 <bt0> Hi 13:18:52 <mehdi> When I run `vim` it tells me I need to install it. But, when I enter `vi --help` it shows Vi Improved` 13:19:14 <aditya_r> mine 8.0 13:19:14 <nmnbd[m]> same goes for me 13:19:31 <mehdi> Install package 'vim-enhanced' to provide command 'vim'? [N/y] y * Waiting in queue... * Loading list of packages.... The following packages have to be installed: vim-common-2:8.0.885-1.fc26.x86_64 The common files needed by any version of the VIM editor vim-enhanced-2:8.0.885-1.fc26.x86_64 A version of the VIM editor which includes recent enhancements vim-filesystem-2:8.0.885-1.fc26.x86_64 VIM filesystem layout 13:19:49 <x3mboy> And that's what happens 13:19:55 <x3mboy> Let me explain this quickly 13:20:04 <mehdi> OK, thanks 13:20:07 <x3mboy> Fedora comes with vim-minimal 13:20:21 <x3mboy> That's more similar with the old vi 13:20:46 <x3mboy> vim it's just: VI iMproved 13:20:55 <x3mboy> A better and extended version 13:21:03 <mehdi> Yes 13:21:11 <x3mboy> So, in order to have vim, instead of vi, you need to install vim-enhanced 13:21:46 <x3mboy> So 13:21:55 <mehdi> So, what is vim-common? 13:22:52 <bt0> libraries for vim 13:23:12 <x3mboy> vim-common is just the common files that are shared by all vim versions: vim-X11, vim-gtk and vim-enhanced 13:23:16 <x3mboy> bt0, +1 13:23:29 <x3mboy> Are the libraries that extend vi into vim 13:24:18 <mehdi> And the installation is a little weird, it does not show packages size, as compared to other packages I normally install via `dnf install` 13:25:51 <x3mboy> That's other issue. As you installed saying yes to that question, you use PackageKit to install it, no dnf 13:25:53 <mehdi> And that's because I did not install vim via `dnf install`, rather by responding 'yes' to Fedora's suggestion when I tried to run the missing `vim` 13:26:11 <mehdi> Yes x3mboy exactly 13:26:35 <x3mboy> But, continuing with the class 13:26:54 <mehdi> OK, now I have vim 8.0.885 installed 13:26:55 <x3mboy> #topic Quick review of the history of vim 13:29:05 <x3mboy> Vi was written for Unix, as an alternative of the line editors 13:29:16 <x3mboy> Someone knows what a line editor is? 13:29:23 <borg0> ed 13:29:39 <x3mboy> borg0, +1 13:29:52 <x3mboy> ed and sed are the most common 13:30:30 <x3mboy> line editors doesn't allow you to see the whole file while editing, they work by buffering each line and performing the commanded changes 13:30:31 <mehdi> What does it do? 13:30:36 <mehdi> It must be a boring editor 13:30:37 <mehdi> lol 13:30:51 <x3mboy> That means that you can't read the file in the screen 13:31:10 <mehdi> Oh that's terrible 13:31:14 <x3mboy> That why the idea of screen edirots comes out 13:31:32 <x3mboy> The most populars were/are emacs and vi 13:31:47 <x3mboy> vi, stands for VIsual editor 13:32:29 <x3mboy> And its main characteristic is that you can see the file and explore it by lines, by character, by page 13:32:34 <x3mboy> Or in any way you need 13:32:41 <x3mboy> #chair bt0 13:32:41 <zodbot> Current chairs: bt0 nb x3mboy 13:32:54 <x3mboy> bt0, sorry, just in case I need help ;) 13:32:58 <bt0> ok 13:33:30 <mehdi> This is good 13:33:49 <skamath> .hello skamath 13:33:52 <zodbot> skamath: skamath 'Sachin S Kamath ' <sskamath96@gmail.com> 13:34:30 <x3mboy> Then, when linux and the Free Software movement comes out, we found a hero called???? 13:34:55 <borg0> tux 13:34:58 <x3mboy> LOL 13:35:18 <skamath> tux yes :P 13:35:23 <mehdi> Richard 13:35:24 <mehdi> Stallman 13:35:26 <x3mboy> Bram Moolenaar, comes in 1991 with his improved version of vi, and he called vim 13:35:51 <mehdi> Oh, I was mistaken :( 13:36:00 <x3mboy> Just because vii sounds aweful 13:36:11 <x3mboy> (vee-eye-eye) 13:36:21 <x3mboy> So, now we have this little editor here 13:36:29 <x3mboy> Let's explore it 13:36:38 <x3mboy> #topic Starting vim 13:36:43 <x3mboy> #chair skamath 13:36:43 <zodbot> Current chairs: bt0 nb skamath x3mboy 13:36:43 <skamath> (na-nn-oo) sounds worse 13:37:20 <mehdi> Sorry to be off-topic, can someone tell me what a chair is? 13:37:39 <skamath> mehdi, people who can control meetings. 13:38:08 <mehdi> Via IRC commands? 13:38:08 <skamath> chairs can do things like add more chairs, change topic, close meeting, etc 13:38:21 <x3mboy> bt0, nb and skamath are colaborators, that can manage the control of the meeting 13:38:32 <skamath> mehdi, no via zodbot commands. 13:38:39 <x3mboy> mehdi, exactly, via IRC commands, sent to the zodbot, the meet bot 13:38:44 <x3mboy> Ok, on-topic again 13:38:51 <mehdi> OK, thanks 13:38:59 <x3mboy> Please, if you can, download this file: https://github.com/X3MBoy/toolbox/blob/master/README.md 13:39:17 <mehdi> i think I need a zodbot class session! 13:39:25 <skamath> mehdi, https://wiki.debian.org/MeetBot 13:39:26 <x3mboy> And please, of you are a developer, don't judge my github, I'm a sysadmin, not a developer 13:39:33 <x3mboy> geek_cl, hello! 13:39:42 <geek_cl> hello x3mboy 13:40:11 <x3mboy> Do you download the file? 13:40:16 <x3mboy> geek_cl, https://github.com/X3MBoy/toolbox/blob/master/README.md 13:40:17 <dominicpg> +1 13:40:21 <skamath> +1 13:40:21 <x3mboy> Just a text file 13:40:33 <mehdi> x3mboy: so your toolbox is a collection of vim related software? 13:41:10 <x3mboy> No, a collection of scripts that I use regularly 13:41:20 <x3mboy> Just I have my vimrc file there 13:41:39 <skamath> x3mboy, should I clone the entire repo? 13:41:39 <x3mboy> But vimrc is advanced, we probably will see that in vim 102 session 13:41:50 <dominicpg> ok 13:41:58 <bt0> +1 13:42:01 <x3mboy> skamath, If you want. You can just download the md file for the session 13:42:10 <skamath> Ack. 13:42:16 <x3mboy> Ok, continuing 13:42:31 <x3mboy> Please invoke the command "vim README.md" 13:43:07 <dominicpg> +1 13:43:13 <nmnbd[m]> +1 13:43:17 <sver> +1 13:43:30 <skamath> +1 13:43:31 <pany> +1 13:43:32 <x3mboy> Ok, one the most common things that people face when using vim is how to exit vim 13:43:43 <bt0> +1 13:43:45 <x3mboy> Can you name at least 3 ways to exit vim? 13:43:48 <t-rey> +1 13:43:54 <borg0> timeout 13:43:55 <t-rey> :q 13:43:56 <dominicpg> save, exit - wq 13:44:03 <sver> :wq :q :q! :x 13:44:06 <t-rey> esc + :x 13:44:09 <skamath> #link https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/ 13:44:13 <skamath> Bonus read 13:44:15 <ramzay> ZZ 13:44:19 <x3mboy> skamath, +1 13:44:27 <x3mboy> ramzay, that's it!!! 13:44:33 <nmnbd[m]> closing the terminal :p 13:44:54 <x3mboy> nmnbd[m], that's other common one (even if you can't beleive it) 13:45:00 <x3mboy> Ok, let's see 13:45:07 <x3mboy> We have to different ways here 13:45:29 <x3mboy> One is sendind a :<command> and the other one is calling directly a command 13:46:26 <x3mboy> If you enter the file without pressing any other keys, you enter into a Command mode 13:46:35 <x3mboy> So any key pressed is just a command 13:46:52 <x3mboy> Please if you have the file close, open it again 13:47:03 <x3mboy> And see in the interface of vim 13:47:48 <skamath> !+1 13:47:55 <mehdi> Sorry, I missed a bit of the class. Which file do you mean? 13:47:57 <x3mboy> You can see in the bottom of the interface a line that says "1,1 All" at the end 13:48:04 <skamath> mehdi, https://raw.githubusercontent.com/X3MBoy/toolbox/master/README.md 13:48:51 <x3mboy> And nothng else 13:48:57 <mehdi> OK, I opened the link using vim 13:49:13 <dominicpg> I see " 1,0-1 " at right bottom 13:49:18 <skamath> mehdi, opened link using vim? 13:49:30 <x3mboy> mehdi, No, please, download the file and then open it with vim README.md 13:49:42 <mehdi> OK 13:49:45 <skamath> wget https://raw.githubusercontent.com/X3MBoy/toolbox/master/README.md; vim README.md 13:49:47 <bt0> try wget https://raw.githubusercontent.com/X3MBoy/toolbox/master/README.md 13:50:12 <x3mboy> dominicpg, Ok, do you open the file README.md? 13:50:15 <skamath> I read everyone's mind :P 13:50:19 <x3mboy> Or you just execute vim 13:50:29 <x3mboy> skamath, mindmaster 13:50:29 <dominicpg> I opened file x3mboy 13:50:52 <x3mboy> dominicpg, ok, but do you actually see the file? 13:51:09 <mehdi> NOw I have downloaded README.md 13:51:14 <x3mboy> I'm going to explain a little bit what you are seeing 13:51:17 <mehdi> I have it open in vim 13:51:36 <x3mboy> 1,1 means line 1 column 1 13:51:36 <dominicpg> yes I see the file content x3mboy 13:51:38 <dominicpg> ok 13:52:01 <x3mboy> When you see 0-1 in the column part, means you are in an empty line 13:52:28 <mehdi> Yes I see 0-1 13:52:33 <x3mboy> That's why I found weird to see 1,0-1 because the first line of the README.md file is not empty 13:52:46 <dominicpg> ah ok 13:53:07 <x3mboy> But ok, continuing 13:53:12 <x3mboy> #topic Basic movements 13:53:20 <dominicpg> make sense. I could move the cursor to a valid line and it displayed values as explained . 13:53:27 <dominicpg> ack 13:53:27 <x3mboy> In vim we can move with the arrows keys 13:53:48 <mehdi> x3mboy: can 0-1 be just 0? 13:54:02 <mehdi> I mean what does each part of 0-1 tell us? 13:54:17 <dominicpg> .:x3mboy:. 1,1 means line 1 column 1 13:54:24 <dominicpg> > When you see 0-1 in the column part, means you are in an empty line 13:54:26 <x3mboy> the 0 means that is not character in that position 13:54:27 <dominicpg> mehdi, ^ 13:54:57 <x3mboy> But it says 0-1 becuase the empty line is there, so there is a carriage return 13:55:10 <x3mboy> Do you know what a carriage return means? 13:55:37 <mehdi> Yes, a new line? 13:55:44 <x3mboy> mehdi, exactly 13:56:26 <x3mboy> A new line is not a character, but it needs to be represented, so, 0-1 means that there is a character, but is not visible, just a new line indicator 13:56:35 <x3mboy> Also, the All, sorry I skip that. "All" means that you are seeing the complete file in one screen 13:57:06 <x3mboy> If you open a larger file, you will see a percentage, indicating what percentage of the file you are seeing 13:57:34 <pany> 3% 13:58:01 <x3mboy> pany, you're seing 3 %??? 13:58:13 <mehdi> x3mboy: Sorry but I do not see 'All' 13:58:40 <x3mboy> mehdi, what do you see after 1,1 or line, column indicator??? 13:58:47 <pany> Yeah 13:59:18 <mehdi> I see Top 13:59:23 <x3mboy> pany, that means that you are in the 3% of the file. It's just vim making math about how many lines are and where are you seeing 13:59:25 <mehdi> 'Top' 13:59:44 <x3mboy> Top means that you are in the top of the file, but it's not calculated the percentage yet 13:59:53 <x3mboy> So, it basically the header of the file 14:00:08 <pany> OK 14:00:09 <x3mboy> Also, you can see 'Bot' 14:00:17 <mehdi> x3mboy: Sometimes I see percentage and sometimes I see Bot 14:00:20 <x3mboy> Meaning that you are at the end of the file 14:00:30 <x3mboy> mehdi, I read your mind 14:00:37 <mehdi> lol 14:00:50 <pany> Oh sorry, I installed powerline for vim 14:00:52 <x3mboy> Maybe too many time working with skamath :P 14:01:06 <x3mboy> pany, that's ok. We are covering the basic 14:01:10 <x3mboy> pany, no problem 14:01:14 <x3mboy> SO lets start moving 14:01:21 <pany> :D 14:01:26 <vanheckcz> Will a record be made from this class? I have to go 14:01:38 <x3mboy> vanheckcz, yes, zodbot is recording 14:01:57 <x3mboy> And the log will be share in the wiki page, https://fedoraproject.org/wiki/Classroom 14:02:19 <vanheckcz> thx 14:02:25 <x3mboy> vanheckcz, stay tuned with the magazine we will publish the next session and the logs and files used in passed sessions 14:02:58 <x3mboy> Ok, as you can see, you can use the arrows, and PgUp and PgDn keys to read the file 14:03:16 <x3mboy> But that wasn't always the way to move 14:04:02 <x3mboy> How can you move through the file without the arrow keys??? 14:04:09 <mehdi> x3mboy: I know there are shortcuts to move 14:04:14 <mehdi> with W, E 14:04:17 <pany> j k h l 14:04:17 <geek_cl> hjkl 14:04:23 <x3mboy> +1 14:04:24 <mehdi> Sorry 14:04:32 <x3mboy> You're on fire! 14:04:48 <x3mboy> Ok, just hjkl 14:04:58 <mehdi> hjkl 14:05:12 <x3mboy> There are no special meaning on those keys AFAIK, but w and e have a meaining 14:05:21 <x3mboy> What do they mean? 14:05:38 <dominicpg> w: save ? 14:05:49 <mehdi> I do not know 14:05:57 <skamath> x3mboy, hahah 14:06:05 <x3mboy> Nope, in command mode 14:06:10 <x3mboy> W means word 14:06:10 <mehdi> dominicpg: I think that's `:w' 14:06:25 <dominicpg> yeah, I meant :w 14:06:31 <dominicpg> ack 14:06:33 <mehdi> x3mboy: What is it good for? 14:06:37 <x3mboy> If you use just the W ( without the : ) you will move a complete word 14:06:38 <geek_cl> jump by Words 14:06:49 <nmnbd[m]> how i can enter insert mode 14:06:50 <x3mboy> E means end of word 14:06:56 <nmnbd[m]> so i can navigate with hjkl 14:07:04 <x3mboy> nmnbd[m], just a little bit 14:07:10 <x3mboy> ;) 14:07:24 <x3mboy> Just the other shortcut is b 14:07:30 <geek_cl> hjkl is a replacement for arrow keys. 14:07:46 <x3mboy> B is to go backwards word by word 14:07:48 <geek_cl> b is for backward by word. 14:08:00 <x3mboy> geek_cl, exactly 14:08:03 <x3mboy> +1 14:08:12 <x3mboy> So, now we are going to write :D 14:08:30 <x3mboy> There are 3 types of "Insert modes" 14:08:37 <x3mboy> Insert, replace and add 14:09:02 <x3mboy> i, s and a 14:09:14 <mehdi> Oh I thought i and s are the same 14:09:52 <x3mboy> i is insert from the current place, s is replace the current character and start from the current place, and a is add after the current place 14:09:59 <x3mboy> Just easy like that 14:10:09 <x3mboy> In Insert mode, the commands are not available 14:10:23 <x3mboy> To go back into command mode we need to press the ESC key 14:10:27 <skamath> x3mboy, o for newline :D 14:10:38 <x3mboy> skamath, +1 14:10:48 <geek_cl> o insert in a newline 14:10:48 <x3mboy> o is for insert text into a new line 14:11:06 <x3mboy> (Sorry, i always forgot that one) 14:11:24 <x3mboy> Anyone knows why there are so many keyboard shorcuts in vim? 14:11:45 <skamath> Coz vim is awesome? 14:11:50 <x3mboy> skamath, LOL 14:12:00 <ramzay> to keep admins busy 14:12:02 <borg0> slow terminal 14:12:12 <pany> there was no mouse that time? 14:12:16 <dominicpg> O is for insert a new line above present position 14:12:22 <x3mboy> pany, +1 14:12:25 <x3mboy> dominicpg, +1 14:12:32 <geek_cl> to emulate old terminals, and keep the compatibility 14:12:46 <x3mboy> geek_cl, +1 14:12:51 <pany> :) 14:12:52 <x3mboy> You are all good 14:13:00 <mehdi> Because it is convenient for keyboardists 14:13:02 <skamath> :( 14:13:21 <x3mboy> vim was created as a clone of vi, and vi was intended to use in all computers, that doesn't have graphical interfaces 14:13:27 <x3mboy> So, we only have keyboards 14:13:42 <x3mboy> And really old computers doesn't have arrow keys 14:14:04 <mehdi> Wow 14:14:16 <x3mboy> Remember that the first keyboards were emulating typewritters keyboards 14:14:31 <x3mboy> typewritters? Is that word right? 14:14:49 <bt0> yeah 14:14:52 <mehdi> I think it's typewriter 14:15:10 <x3mboy> There weren't arrow keys there, so first keyboards doesn't have those ine 14:15:14 <x3mboy> ones* 14:15:33 <mehdi> Yes 14:15:42 <x3mboy> dominicpg found another shortcut, O (capital o) insert text in the line above the current position 14:16:37 <dominicpg> :) 14:16:59 <mehdi> x3mboy: intersting how O and o do inserts 14:17:00 <x3mboy> Please, make a new line at the end of the file, and write: Fedora Classroom vim 101 14:17:31 <x3mboy> Of you feel we are going too slow, please say it 14:17:55 <mehdi> No, I think we're fine 14:18:07 <bt0> for me is fine 14:18:20 <x3mboy> Now, after inserting this new line at the end just put your cursor at the end of the line (in the last 1 of 101) 14:18:41 <dominicpg> e :D 14:18:55 <x3mboy> Goes out of Insert mode and enter command mode 14:18:58 <x3mboy> How do you do that? 14:19:19 <geek_cl> Esc 14:19:32 <geek_cl> Well . Esc : 14:19:39 <mehdi> No it does not 14:19:39 <x3mboy> geek_cl, +1 14:19:56 <mehdi> I have to press Esc to do that 14:20:14 <x3mboy> mehdi, +1 14:20:26 <x3mboy> In command mode, please press 2b 14:20:38 <x3mboy> Actually the 2 key and the b key 14:20:42 <x3mboy> What happens? 14:20:49 <mehdi> invalid range 14:21:09 <x3mboy> mehdi, O.O 14:21:13 <ramzay> moves back 2 words 14:21:25 <x3mboy> ramzay, +1 14:21:27 <geek_cl> +1 ramzay 14:21:31 <bt0> right ramzay +1 14:21:42 <mehdi> But for me it does not 14:21:46 <x3mboy> IF you use one command with a number before the command, the command is executed that number of times 14:22:18 <x3mboy> mehdi, Please goes into insert mode and then just press ESC 14:22:21 <x3mboy> And try again 14:22:33 <mehdi> Oh, I thought I had to enter it with `:2b` 14:22:34 <skamath> +1 14:22:50 <dominicpg> +1 14:22:51 <mehdi> but just '2b' works cool! 14:23:00 <x3mboy> No, we are still out of the :<command> part 14:23:04 <x3mboy> ;) 14:23:18 <mehdi> Such a complex editor lol! 14:23:39 <x3mboy> mehdi, it will get easier when you use it 14:23:40 <mehdi> Or let's say huge editor 14:23:58 <x3mboy> I can bet that geek_cl can't live without vim 14:24:00 <x3mboy> :D 14:24:07 <geek_cl> :) 14:24:18 <x3mboy> Ok 14:24:21 <geek_cl> many of us. 14:24:29 <bt0> yeah 14:24:32 <x3mboy> #topic Search and replace 14:24:34 <mehdi> I use gedit often 14:24:59 <x3mboy> mehdi, the first thing I do when I open my session is open my terminal 14:25:02 <x3mboy> :D 14:25:15 <mehdi> :) 14:25:30 <x3mboy> Ok, now, how do you look for a word (we called string) into a text file? 14:25:42 <skamath> x3mboy edits with cat > filename. That's his secret ;) 14:25:52 <borg0> '/<string>' 14:25:58 <mehdi> x3mboy: I use `? word` 14:26:02 <x3mboy> skamath, ssshhhh nobody else now 14:26:31 <x3mboy> borg0, +1 14:26:33 <x3mboy> mehdi, +1 14:26:42 <x3mboy> Those 2 are search methods 14:26:52 <dominicpg> that's bottom-up search mehdi 14:27:11 <x3mboy> The difference? / looks Top to bottom and ? looks Botton to top 14:27:12 <mehdi> So what is the other method? 14:27:13 <x3mboy> dominicpg, +1 14:27:24 <borg0> * 14:27:41 <mehdi> +1 14:27:43 <x3mboy> Just search forward and backward 14:28:03 <x3mboy> So, how do you look the next ocurrence of the string? 14:28:06 <mehdi> x3mboy: Are there any shortcuts for fast navigations to first and end of file? 14:28:16 <geek_cl> n N 14:28:17 <borg0> n & N 14:28:25 <ramzay> gg and G 14:28:50 <x3mboy> mehdi, ramzay answer you 14:28:51 <mehdi> Cool 14:28:52 <x3mboy> gg and G 14:28:57 <x3mboy> geek_cl, borg0 +1 14:28:57 <mehdi> ramzay: +1 14:29:09 <x3mboy> n and N are to go to next and previuos ocurrence 14:29:35 <mehdi> That's nice 14:29:56 <mehdi> I have a big problem with vim, though I kind of liked it since 2009 14:30:15 <x3mboy> mehdi, what's the problem??? 14:30:20 <x3mboy> Ok, replace??? 14:30:24 <mehdi> x3mboy: Can you tell me how to copy and paste lines and words in vim? 14:30:25 <x3mboy> Anyone? 14:30:38 <x3mboy> mehdi, that will be the end of this session 14:30:41 <ramzay> .,$s/word1/word2/g 14:30:45 <mehdi> I used mouse for that :(( 14:30:48 <borg0> :%s/a/b/g 14:31:04 <mehdi> OK, sorry. I can wait for that 14:31:23 <mehdi> ramzay: I did not understand it 14:31:33 <x3mboy> ramzay, borg0 +1 14:31:56 <x3mboy> It looks realy weird but to search and replace we need to use a little hard command 14:32:42 <mehdi> What is the %s part? 14:32:49 <borg0> whole file 14:32:59 <borg0> search 14:33:32 <x3mboy> It's weird, nobody ask how to unhighlight the searched words 14:33:33 <x3mboy> :D 14:33:41 <mehdi> ramzay: what is .,$s? 14:34:03 <ramzay> current line to end of file search 14:34:10 <nmnbd[m]> thats because we re still fighting :p 14:34:17 <borg0> :noh 14:34:24 <x3mboy> nmnbd[m], LOL 14:34:35 <x3mboy> Ok, do you need to ask something??? 14:34:57 <x3mboy> Ok, lets search zsh 14:35:10 <bt0> OMG, x3mboy please tel us how to unhighlight 14:35:11 <x3mboy> Please type /zsh into the command mode 14:35:16 <x3mboy> :nohl 14:35:25 <x3mboy> OR :noh 14:35:30 <bt0> x3mboy++ 14:35:32 <pany> unhighlight search a string that doesn't exist 14:35:54 <x3mboy> pany, that's an engineer solution! 14:36:07 <pany> haha 14:36:16 <x3mboy> But the real way should be to use :nohl or :noh command 14:36:27 <x3mboy> That means "no highlight" 14:36:36 <x3mboy> Do yuou search for zsh string? 14:36:39 <bt0> by example i can highlight any occurrence with # 14:36:54 <mehdi> I did 14:37:08 <mehdi> zshrc is selected 14:37:25 <mehdi> zshrc is highlighted 14:38:01 <x3mboy> Beatiful 14:38:12 <x3mboy> mehdi, +1 14:38:16 <mehdi> How? 14:38:19 <mehdi> How so? 14:39:11 <x3mboy> Now, move to the next ocurrence 14:39:44 <mehdi> How should I do that? 14:39:46 <borg0> n 14:40:04 <mehdi> Oh sorry I forgot to hit Enter 14:40:23 <x3mboy> Now, press c 14:40:39 <mehdi> Ok nothing happens 14:40:46 <mehdi> c appears at the bottom 14:41:41 <bt0> mehdi: +1 14:41:41 <mehdi> Does that copy the pattern? 14:42:14 <mehdi> And can we paste it with p ? 14:42:25 <x3mboy> w 14:42:31 <x3mboy> Sorry 14:42:45 <x3mboy> The idea was, search, press c and then press w 14:42:59 <x3mboy> Remember what w means??? 14:43:09 <linuxEnthusiast> word ? 14:43:11 <borg0> word 14:43:15 <x3mboy> =1 14:43:16 <mehdi> word 14:43:16 <x3mboy> +1 14:43:18 <x3mboy> Word 14:43:21 <x3mboy> C means change 14:43:30 <x3mboy> So, c+w means change word 14:43:32 <mehdi> It deletes one word 14:43:58 <x3mboy> So, search: / and ? 14:44:05 <x3mboy> n and N next and previous 14:44:32 <x3mboy> :%s/WordToSearch/WordToReplace/g search and replace 14:44:42 <x3mboy> And c+w change a word 14:45:00 <x3mboy> #topic deletion 14:45:04 <x3mboy> To delete characters in command mode we use x 14:45:11 <x3mboy> And d command 14:45:13 <mehdi> Cool 14:45:15 <x3mboy> d means delete 14:45:25 <x3mboy> So if we use d+w that will mean??? 14:45:48 <borg0> delete word 14:45:56 <x3mboy> +1 14:46:02 <x3mboy> d+b???? 14:46:20 <borg0> dekete back 14:46:23 <x3mboy> +1 14:46:27 <x3mboy> dd 14:46:30 <x3mboy> ??? 14:46:34 <borg0> delete line 14:46:52 <x3mboy> dG??? 14:47:27 <ramzay> delete all below current line 14:47:32 <bt0> (u undo :P ) 14:47:32 <mehdi> the whole file? 14:47:46 <x3mboy> mehdi, if you are in the first character, yes 14:47:57 <x3mboy> It means delete from current position until the end of file 14:48:17 <x3mboy> dgg means delete from current position until the beggining of the file 14:48:21 <x3mboy> Ok 14:48:25 <x3mboy> That was easy 14:48:31 <x3mboy> Now, the Yank 14:48:36 <x3mboy> #topic Yank 14:49:26 <mehdi> +1 14:49:29 <x3mboy> Do you know what yank (y) means??? 14:49:30 <mehdi> never heard of it 14:49:34 <mehdi> lol 14:49:35 <borg0> copy 14:50:26 <x3mboy> borg0, +1 14:50:27 <x3mboy> Copy 14:50:39 <mehdi> How is that used? 14:51:06 <x3mboy> Move into line 9 column 9 14:51:09 <x3mboy> And press y 14:51:44 <x3mboy> And then w 14:51:58 <x3mboy> Nothing seems to happens, right? 14:52:10 <linuxEnthusiast> it just skips a word 14:52:11 <mehdi> yes 14:52:12 <mehdi> nothing 14:52:22 <x3mboy> Everyone less borg0 or any of the chairmans, what we did??? 14:52:50 <x3mboy> Nothing??? 14:52:57 <mehdi> No way 14:53:02 <x3mboy> What I just said that y means??? 14:53:07 <linuxEnthusiast> copying 14:53:13 <x3mboy> And w? 14:53:19 <linuxEnthusiast> word ??? 14:53:20 <mehdi> word 14:53:22 <x3mboy> Ok 14:53:24 <mehdi> copy one word 14:53:28 <x3mboy> mehdi, +1 14:53:33 <x3mboy> But we need to paste it 14:53:39 <mehdi> :D 14:53:51 <x3mboy> Because now is in the "Clipboard" 14:53:59 <x3mboy> In vim is called buffer 14:54:11 <x3mboy> now goes to the line bellow and press p 14:54:20 <x3mboy> Into line 11 14:54:24 <x3mboy> That should be empty 14:54:35 <mehdi> Good, that pastes the word 14:54:57 <x3mboy> Now, we can combine our knowledge 14:55:12 <x3mboy> y+b, y+G, y+gg??? 14:55:22 <borg0> why did it copy the space at the end? 14:55:34 <mehdi> y+b: copy one word back 14:55:44 <x3mboy> borg0, becuase the delimiter of a "word" is a space 14:55:51 <mehdi> y+G copy to the end of the file 14:55:57 <mehdi> y+gg: copy to the beginning of the file 14:56:17 <x3mboy> mehdi, +1 14:56:22 <x3mboy> You are on fire right now 14:56:35 <x3mboy> But how to select what I need??? 14:56:36 <mehdi> :D 14:56:40 <x3mboy> For exampe 2 words? 14:56:57 <mehdi> :y+2w? 14:56:58 <borg0> 2yw 14:57:03 <x3mboy> borg0, +1 14:57:09 <x3mboy> mehdi, without the : 14:57:20 <x3mboy> Another shortcut, $ 14:57:21 <mehdi> ok sorry 14:57:25 <x3mboy> $ meanse end of line 14:57:37 <x3mboy> :%s/meanse/means/g 14:58:24 <x3mboy> Now, let's see 5yy??? 14:58:40 <borg0> copy 5 lines 14:58:49 <mehdi> x3mboy: and what is beginning of the line? 14:59:00 <mehdi> shortcut I mean as opposed to $ 14:59:15 <x3mboy> ^ 14:59:48 <x3mboy> So ^ beggining of line, $ end of line 15:00:02 <x3mboy> Nyy where N is any number, meanse N lines 15:00:07 <x3mboy> And to paste just p or P 15:00:45 <x3mboy> The difference between p and P is paste after current position and before position 15:00:47 <mehdi> So it copies 10 lines forward? 15:01:45 <x3mboy> +1 15:01:53 <x3mboy> mehdi, for select text to copy we need to use visual mode, but we will do that in vim 102 15:02:02 <x3mboy> Now just how to close? 15:02:11 <x3mboy> Saving, and without save the changes???? 15:02:27 <mehdi> :w 15:02:29 <pany> ZZ ZQ 15:02:30 <mehdi> :q! 15:02:32 <x3mboy> :wq saving :q! without saving 15:02:54 <x3mboy> ZZ saving ZQ without saving 15:02:54 <mehdi> :wq save and quit 15:03:06 <x3mboy> :w alone, just save 15:03:18 <mehdi> what is ZZ? never used it 15:03:29 <x3mboy> mehdi, Save and exit 15:03:41 <x3mboy> Well my people, that's all 15:03:43 <borg0> ;qa! 15:03:52 <pany> and :x 15:03:58 <mehdi> That's really cool 15:04:00 <bt0> .thanks x3mboy 15:04:09 <x3mboy> We learn how to move, insert, search, replace, copy and paste test 15:04:11 <mehdi> Thanks Eduard 15:04:19 <mehdi> It really helped 15:04:38 <x3mboy> s/test/text/g 15:04:57 <linuxEnthusiast> Thank you x3mboy 15:05:04 <x3mboy> Any question??? 15:05:13 <mehdi> one 15:05:26 <x3mboy> Please, go ahead 15:05:29 <mehdi> beginning of search/replace what can we use? 15:05:35 <mehdi> s, $, %S 15:05:36 <mehdi> ? 15:05:43 <mehdi> I am a bit confused 15:06:02 <x3mboy> :%s/meanse/means/g 15:06:39 <mehdi> Is that it? 15:07:02 <mehdi> Thanks 15:07:38 <x3mboy> The first one is the word to search, and the second one the one to replace 15:08:08 <mehdi> Thank you sir 15:08:16 <x3mboy> Anything else??? 15:08:18 <linuxEnthusiast> and g is ? 15:08:28 <x3mboy> #topic Q&A 15:08:44 <x3mboy> g in the search command is just to apply 15:08:51 <mehdi> Just a small recap on insert if possible please? 15:09:36 <mehdi> We have three ways to insert: i s and o and O ? 15:12:00 <bt0> i insert in the current position 15:12:13 <pany> mehdi: i and a and o 15:12:28 <bt0> s replace the actual character and insert 15:13:07 <mehdi> thanks 15:13:11 <bt0> o insert one line down 15:13:12 <mehdi> pany: +1 15:13:21 <mehdi> bt0: +1 15:13:23 <bt0> O insert one line up 15:14:00 <mehdi> Is there a way to go a number of words forward or backward? 15:14:42 <mehdi> Oh sorry it was Nw and Nb 15:14:48 <mehdi> Forgot it 15:14:56 <bt0> yeah 15:15:43 <x3mboy> Maybe another guy can help me here, (about the g means in the search and replace commands) 15:16:22 <mehdi> ? 15:16:56 <mech> x3mboy, I think it's "global" from regex? 15:17:15 <x3mboy> mech, probably 15:17:59 <x3mboy> linuxEnthusiast, the problem with search and replace is that is being done by a regular expression or regex, that is a quite advance term 15:18:20 <x3mboy> Just we need to know that we use s/word1/word2/g to search and replace all ocurrences 15:18:27 <bt0> yeah, that come from the sed command 15:18:44 <linuxEnthusiast> got it, thnx 15:19:35 <bt0> means global 15:20:00 <x3mboy> Ok, now we are done 15:20:13 <linuxEnthusiast> thanks a lot 15:20:16 <x3mboy> Thanks for assist and I hope you can find it usefull 15:20:20 <linuxEnthusiast> great session 15:20:30 <mehdi> Great class 15:20:39 <mehdi> Really useful thanks 15:20:40 <bt0> many thanks x3mboy 15:20:41 <x3mboy> Logs will be published in the wiki: https://fedoraproject.org/wiki/Classroom 15:21:03 <x3mboy> And please stay tuned with the magazine, where we will publish the incoming sessions 15:21:37 <linuxEnthusiast> looking forward to join the next one 15:21:39 <x3mboy> Also, I will try to put some material (Just need to check the licence of the material), but some useful books and guidelines to use vim 15:21:40 <linuxEnthusiast> goodbye 15:21:44 <x3mboy> #endmeeting