Skip to content

Commit ef493a3

Browse files
author
Kenneth Söderlund
committedJun 7, 2021
Add vim workshop files
- Markdown files for the presentation - Assignments
1 parent 194ca93 commit ef493a3

9 files changed

+460
-0
lines changed
 

‎assignment-1.txt

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
Assignment 1, speaking the vim language
2+
---
3+
4+
In this assignment we learn how to speak the language called vim. Remember, we have the verbs, modifiers and nouns. In this assignment we also learn to move around in the text file.
5+
6+
Move around this file with the keys "hjkl", then try to go to the end of the file with "<S-G>" (that's shift+g). and back to the top with "gg".
7+
Try to move by words with the "w"/"e" and "b" keys. NOTE: Here you can also use the modifiers, e.g. using a number before the key, you will jump that many words forward or backwards, e.g. "3w" jumps forward 3 words.
8+
9+
10+
Here's some text that you can work on. We're going to have some paragraphs, sentences and maybe some lorem ipsum to fill up the space. We'll have enough text so you can try out all the different types of movements, verbs and so on. We'll also have some typos, which you'll want to fix with the "c" key, perhaps something that needs to be removed with the "x" key and so onn.
11+
12+
Coorrecting text is somoetghing that you need too do when using vim to edit either normal text files or markdwn files. Go ahead and fix the issues with this paragraph.
13+
14+
Now go ahead and try out "change inside sentence" (delete the current sentence and enter insert mode), you can copy some text from outside vim, and then paste it instead of the given sentence you should replace. SENTENCE TO REPLACE HERE. So once you've changed the sentence, this should be the next one.
15+
16+
You can also use "yank inside paragraph", which will copy the paragraph you're in. So let's say we have a little bit more text here, for example talking about the current weather, which is great by the way. So, the sun is shining, the usual Finnish summer is shining with it's absence, meaning, no snow yet. We love it, right? OK, so now that we have a paragraph, you should be able to yank it and paste below.
17+
18+
--- paste here ---
19+
20+
Go ahead and use the change to tag functionality, e.g. let's say that you should change text in the following sentence until the colon-sign (:).
21+
Place your cursor HERE, and use the change to tag functionality to replace the text until this colon-sign:
22+
23+
Now that you have those basics ready, here's some Samuel L. Ipsum for you to try out the moving on screen and perhaps searching for some words and replacing the words with something else. You may choose to do whatever you want with this text.
24+
25+
26+
--- SLIPSUM STARTS ---
27+
28+
The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
29+
30+
Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.
31+
32+
The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
33+
34+
Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.
35+
36+
Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.
37+
38+
Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.
39+
40+
Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.
41+
42+
My money's in that office, right? If she start giving me some bullshit about it ain't there, and we got to go someplace else and get it, I'm gonna shoot you in the head then and there. Then I'm gonna shoot that bitch in the kneecaps, find out where my goddamn money is. She gonna tell me too. Hey, look at me when I'm talking to you, motherfucker. You listen: we go in there, and that nigga Winston or anybody else is in there, you the first motherfucker to get shot. You understand?
43+
44+
Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.
45+
46+
The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
47+
48+
Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass.
49+
50+
Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.
51+
52+
Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.
53+
54+
Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.
55+
56+
Look, just because I don't be givin' no man a foot massage don't make it right for Marsellus to throw Antwone into a glass motherfuckin' house, fuckin' up the way the nigger talks. Motherfucker do that shit to me, he better paralyze my ass, 'cause I'll kill the motherfucker, know what I'm sayin'?
57+
58+
Normally, both your asses would be dead as fucking fried chicken, but you happen to pull this shit while I'm in a transitional period so I don't wanna kill you, I wanna help you. But I can't give you this case, it don't belong to me. Besides, I've already been through too much shit this morning over this case to hand it over to your dumb ass.
59+
60+
Now that there is the Tec-9, a crappy spray gun from South Miami. This gun is advertised as the most popular gun in American crime. Do you believe that shit? It actually says that in the little book that comes with it: the most popular gun in American crime. Like they're actually proud of that shit.
61+
62+
Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.
63+
64+
Look, just because I don't be givin' no man a foot massage don't make it right for Marsellus to throw Antwone into a glass motherfuckin' house, fuckin' up the way the nigger talks. Motherfucker do that shit to me, he better paralyze my ass, 'cause I'll kill the motherfucker, know what I'm sayin'?
65+
66+
Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.
67+
68+
Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.
69+
70+
You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.
71+
72+
Now that there is the Tec-9, a crappy spray gun from South Miami. This gun is advertised as the most popular gun in American crime. Do you believe that shit? It actually says that in the little book that comes with it: the most popular gun in American crime. Like they're actually proud of that shit.
73+
74+
Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.
75+
76+
Now that there is the Tec-9, a crappy spray gun from South Miami. This gun is advertised as the most popular gun in American crime. Do you believe that shit? It actually says that in the little book that comes with it: the most popular gun in American crime. Like they're actually proud of that shit.
77+
78+
Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.
79+
80+
Now that there is the Tec-9, a crappy spray gun from South Miami. This gun is advertised as the most popular gun in American crime. Do you believe that shit? It actually says that in the little book that comes with it: the most popular gun in American crime. Like they're actually proud of that shit.
81+
82+
Now that there is the Tec-9, a crappy spray gun from South Miami. This gun is advertised as the most popular gun in American crime. Do you believe that shit? It actually says that in the little book that comes with it: the most popular gun in American crime. Like they're actually proud of that shit.
83+
84+
The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
85+
86+
You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man.

‎assignment-2.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
In this assignment we're going to use everything we learnt in the first assignment, and build on top of that.
2+
3+
Some clues on this assignment are found in the changing-text.md and text-objects.md.
4+
5+
We're going to use the different modes to our advantage, and do some actions on the text from within them. So, lets start with some simple things.
6+
7+
8+
This sentence is missing a period at the end of it, add the period at the end, but you can only use two keystrokes while your cursor is at the beginning of the line
9+
10+
This sentence should start with an asterisk (*), but it doesn't at the moment. You need to insert the asterisk at the beginning of this line, but only with two keystrokes while the cursor is at the end of this line.
11+
12+
This paragraph has a lot of text in it. We're going to do some basic manipulation on it. Some things to note for this paragraph is, that words with underscores before and after the words (or sentences) should be deleted, words with asterisks (*) should be replaced with something else. I hope this is _is_ enough information *to* you so that you can perform _reform_ the necessary changes. _This whole sentence should be deleted btw_. This sentence starts out very well, *but continues very poorly, and it should be changed to something else starting for the first asterisk*, and it still continues, so this sentence is quite complex.
13+
14+
After you have modified the previous paragraph, copy and paste it below this sentence, but you can only use three keystrokes to copy the whole paragraph.
15+
16+
17+
18+
19+
20+
Now we work on different matching pairs of things, such as double quotes, parenthesis, brackets and braces.
21+
22+
This paragraph will include some text within "quites", (typo there of course), and [basic python lists] or {python sets}. These aren't really that, but bear with me. Now I want you to try to 'select text within the pairs' of things, copy and paste, delete them if you don't like them, replace them with something else, etc. You can also try to do something with these HTML tags <em>italic</em> <p>This is a paragraph</p>.
23+
24+
There's a lot of things you can do with the vim language, and it's all about just getting used to the commands. Just keep practicing on the paragraph selections, sentence selections and "pair selections".

‎assignment-3.txt

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
In this assignment we're going to be using the visual mode, macros and registers to get familiar with them.
2+
3+
We will have some text that you can select, modify etc.
4+
5+
Below you will find a shopping list, that should have a dash (-) at the beginning of the line. The list can be fixed in a few different ways. We'll have the same list here a couple of times, and you should use at least visual selection, the repeatable command and record a macro and apply it to the list.
6+
7+
8+
Shopping list (visual selection):
9+
Eggs
10+
Milk
11+
Cheese
12+
Ham
13+
Toilet paper
14+
Bread
15+
Soap
16+
17+
Shopping list (repeatable command):
18+
Eggs
19+
Milk
20+
Cheese
21+
Ham
22+
Toilet paper
23+
Bread
24+
Soap
25+
26+
Shopping list (macro):
27+
Eggs
28+
Milk
29+
Cheese
30+
Ham
31+
Toilet paper
32+
Bread
33+
Soap
34+
35+
36+
Paste below the output of the system command ls by using the expression register:
37+
38+
39+
40+
41+
42+
43+
44+
Paste the current file path by using the percent register:
45+
46+
Copy this URL: https://www.openvim.com/ into the clipboard register and paste it in your browser's address bar.

0 commit comments

Comments
 (0)
Please sign in to comment.