Tuesday, July 10, 2012

Vim Navigation Tutorial


WELCOME EVERYONE! Below, I will be sharing a tutorial on how to navigate a text editor called vim. Let's begin!

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 #

Feel free to ask any questions or make any suggestions.

Also, check out these other tutorials on vim!


Until next time... check back -- there is more to come!

Sunday, June 24, 2012

WEEK 1: 6/17/12 - 6/24/12

  • So far, my experience at YSP has been interesting in many ways. Seeing that I have never been away from my family for 6 weeks, the responsibility and independence given to us is something entirely new to me. After navigating through the gigantic FSU campus and attending different classes, I believe, by the end of the program, I will be well-prepared for the college lifestyle next year. I think our schedules are perfectly tailored so that we get the most out of this summer, without it being too overwhelming. Amidst the rigorous schedule in the morning and afternoon, there is conveniently plenty of time to unwind. 
  • First off (on M/W/F), I have enjoyed learning the material in each class greatly because it is much different from the lessons taught at my high school. Computer Science is a class I've always wanted to enroll in and after the first week of class, my interest in the subject has grown even more; it is a course I most definitely will continue to pursue as I enter my senior year. Although at times challenging, the Differential Equations math class has already improved and developed my analytical skills. Further, I am extremely looking forward to the hands-on experimentation offered in Biochemistry class. Lastly (on T/TH), the individual research project allows us to apply textbook concepts into practical application — in my case, my professor has introduced my partner and I to understanding the basic mechanisms underlying cancer through DNA damage. In summary, I am confident YSP will provide us with not only a great summer but also a good taste of what to expect in our future careers in the math and sciences.