Created
May 7, 2012 12:06
-
-
Save tomnomnom/2627430 to your computer and use it in GitHub Desktop.
Vim "in" and "ambient" motions exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>My awesome homepage</title> | |
<script type="text/javascript"> | |
(function(){ | |
// Press ci" (Change In quotes) with the cursor between | |
// the quotes below to remove the text and be left in insert mode | |
var welcomeMessage = "Welcome to my homepage!"; | |
// Press ci( (Change In braces) with the cursor between the braces | |
// below to remove the text between the braces and be left in insert mode | |
alert(theWrongVariable); | |
})(); | |
// Now press di{ (Delete In curly braces) with the cursor | |
// inside the function body above to remove it | |
</script> | |
</head> | |
<body> | |
<!-- Press cit (Change In Tag) with the cursor between the h1 | |
tags to delete the text and be left in insert mode --> | |
<h1>This is the heading</h1> | |
<!-- Press yat (Yank Ambient Tag) with the cursor between the p | |
tags to yank the whole block including the p tags --> | |
<p> | |
This is the first paragraph. | |
It's a pretty boring paragraph. | |
</p> | |
<!-- Press cat (Change Ambient Tag) with the curor between the em tags to | |
remove the text including the em tags and be left in insert mode--> | |
<p> | |
This is the <em>second paragraph</em> | |
</p> | |
<!-- Now press dit (Delete In Tag) with the cursor down here | |
to remove everything between the body tags --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment