Tuesday, July 10, 2012

Vim Navigation tutorial

Hey guys! So, this week I will be sharing with you how to navigate vim which is a text editor. Here goes:


Vim Navigation Tutorial
Basics of navigation
Vim is a text editor that requires navigation different from that of a normal navigation. When in command mode in vim, users cannot use the arrow keys to go up, left, right, and down. There are special keys and various other shortcuts that will come in handy when using this text editor. The following bullets will hopefully be an easy and helpful way for you to understand how to navigate vim.
BEFORE CONTINUING, MAKE SURE YOU ARE IN COMMAND MODE BY HITTING ESC.
To enter insert mode, hit  i.
Moving up, down, left, and right
·         To move up, use the k key
·         To move down, use the j key
·         To move left, use the h key
·         To move right, use the l key
Using the above method is very slow, so here are some shortcuts to make it faster for you to navigate vim.
Line, Word, Paragraph, and Search Navigation Shortcuts
o   LINE NAVIGATIONS

·         If you know how many lines or letters you want to skip, simply type in that number of spaces and then the key which indicates the direction in which you want to go
o   Example: “6l” means 6 spaces to the right     
·         To go to the beginning of the line, type in 0
·         To go to the first non-blank character of the line, type in ^
·         To go to the end of the current line, type in $
·         To go to the last non-blank character of the line, type in g_
·         To go to the Nth percentage line of the file, type in N%
·         To go to the Nth line of the file, type in NG

·         To go to the Nth line of the file after opening it, type in
Vim +N filename

·         To go to the particular pattern’s line where it first occurs inside the file, type in
Vim +/pattern filename

·         To go to the particular pattern’s line where it last occurs inside the file, type in
Vim +?pattern filename

o   WORD NAVIGATIONS
·         To go to the end of a word, type in e
·         To go backward to the beginning of the current word, type in b
·         To go forward to the beginning of a word, type in w
·         By attaching numbers before b and w, you can go back or forward that many words
o   Example: 3w takes you back 3 words
Not only are there shortcuts for navigating words and lines, but there are also shortcuts for navigating paragraphs.
o   PARAGRAPH NAVIGATIONS
·         To go the beginning of the current paragraph, type in {
·         To go the end of the current paragraph, type in }
·         By pressing either of these more than once, you can go to previous paragraphs or go forward to paragraphs
In addition to paragraph navigations, search navigations are essential as well.
o   SEARCH NAVIGATIONS
·         To search for a pattern, type in /I and you will be taken to the next occurrence
·         To search for a pattern, type in?i and you will be taken to the previous occurrence
·         To go to the next occurrence of the word that you are on, type in *
·         To go to the previous occurrence of the word that you are on, type in #


Questions?? Post them! 

Also, check out these other tutorials about vim!


Catch you guys later :D

Sunday, June 24, 2012

Brainchildren Land Experience Week 1

So you may be asking yourself what is a Brainchild? To be precise, a Brainchild is someone who decides to learn during the summer. I mean, who needs a break from school? Not us! That's for sure. We Young Scholars who have decided to dedicate our summer to YSP are basically going to school for 210 days as opposed to the 180 days like normal and sane students. 


On Mondays, Wednesdays, and Fridays, we leave at 8 from our dorm rooms to get to our computer classes. What that really translates to is no sleeping in like the normal child during summer. Not only do we get no sleep, but instead of being one hour long, our classes are 2 hours long! I mean, seriously! After computer science comes the math class, followed by a lunch break. The next class, after lunch is science, and guess what? That one is extra special! You know why? It's because we get to be in it for three hours. Following that class, we head back to Southgate where we are staying for dinner and then we have free time.


When one hears the word free time, one might think oh finally! In this case, free time is something to dread at least a little bit. It's mainly because there is so much of it! We have until 12:00 a.m. to do whatever it is that we want, and the thing is it's really hard to keep yourself occupied in a way that you're having fun for 7 hours straight. Isn't that what free time is for? And then, on weekends, we have even more free time. On Saturdays, like yesterday, we left at 8...they don't even let us sleep in on Saturdays! Anyways, we left and we went to Wakulla Springs where the water is basically freezing. We might as well have taken ice baths. Our bodies pretty much froze and once we froze and got out we ate our lunches which by the way constitute a whole other story. Our lunches, our bag lunches, are very special. Let's just put it this way...it could have been better. Moving on, just a quick shout out to the drinks. We emptied the jugs and found a layer about one centimeter thick of sugar. Enough said.


Once we got back from Wakulla Springs we had free time again, only this time we had till 1:30 a.m. Based on my previous description, I'm sure you can figure out what that must have been like. Yeah, it was kinda bad, but I did watch a movie, take a nap, play ping-pong, and eat. #winning


DISCLAIMER:


So, basically, the attitude in which this entire post was written was employed for my amusement and hopefully yours as well. I'm a bit of a sarcastic person, so when I have to write this at 3:00 a.m. I need some kind of amusement to keep me going. Anyways, YSP has been so awesome! The classes are all so interesting and the professors have so much to teach us. We get to invest in ourselves and give ourselves an opportunity to see what college might be like and how research during our undergraduate schooling might be like as well. The Independent Research Projects are even better. As of now, I do not have much to say other than that I am super excited for it. I will really be getting involved on Tuesday, so for now that's it on that note. We do have homework, but it is manageable, and I think it lets us bond as well. I mean what better way to get brainchildren to bond than over homework? Our free time is a great way for us to use our creative minds and think of ways to keep ourselves occupied, and we have become quite skilled at it. We've been playing four square by making a court outlined by tape, having water gun fights, and having ping-pong competitions. And let's not forget the weekend excursions! Wakulla Springs was awesome! The fact that it is cold year round in a place like Florida is so amazing, and after getting out of the Spring I felt so refreshed and clean. It was fun hanging out with everyone and high diving while holding hands with someone else. Out of all that sarcasm, what I said about the food was true. However, we are so hungry it doesn't really matter. All that matters is that it is edible and the cookies are a great addition to the meal. That is one thing I definitely look forward to everyday. Dessert.


I can't wait to see what else YSP has to offer me. The people are absolutely awesome and everyone is special in their own way. It might seem cliche, but it's the truth. At this point, I would absolutely recommend YSP to next year's group of rising seniors.