Learn how to use Vim Editor technique inside Sublime Text 2 editor

If you are interested in speeding up your productivity, you may want to spend some time learning the Vim way. There is a plethora of great tutorials out there but this one is free and fast. It is an online way to quickly get up to speed. After 30 minutes you will see why the investment in Vim is important. Switching to Vim mode in ST2 is simple.

Here are some things that will be covered:
w – moves to the start of the next work
e – moves to the end of the word
b – moves to the beginning of the word

combining commands with numbers
3w – moves you to the next word three times (taking you to the third word)

how would I add 30 dashes the vim way?
30i-
(works in vim (not in st2))

How to find the next occurrence of the letter ‘o’
fo

the third occurrence of the letter ‘o’
3fo

How would I find the ending parentheses?
shift+%(the 5 key) (toggle to go back and forth)

How to get to the beginning of the line?
0

How to get to the end of the line?
$

If you are in command mode and the current cursor is under a word, how to you jump to the next occurrence of that word?
shift + #

If you are in command mode and the current cursor is under a word, how to you jump to the previous occurrence of that word?
shift + *

how to get to the beginning of a file?
gg

how to get to the end of a file?
G

how to go to a specific line number?
line number(numeric value) + G

searching with vim
type / + what you are searching for
add ‘n’ to find next occurrence
note: n toggles if only one next occurrence

how to add a line of text below the current line of text
o

how to add a line of text above the current line of text
shift + o (capital O)

how to remove the previous letter (delete the previous letter)
x

how to remove the previous letter without entering into insert mode
r (doesn’t work in vim mode st2 only working in terminal)

how do you delete the next word?
d + w (use the other command combinations w,e,b for similar deletions)

how do you repeat the previous command?
. (type the period character)
context – so if you delete the next 2 words with d2w and press enter, then hit . again and again and you will delete the next two words each time you hit . (period)

visual mode

in visual mode you select text using movement keys before you decide what to do with it

how to enter visual mode
v

if you want to highlight some text
v to enter visual mode
type w to highlight the next word
d to delete the highlighted portion

Leave a Reply

Your email address will not be published. Required fields are marked *