You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: assignment-1.txt
+6-2
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Move around this file with the keys "hjkl", then try to go to the end of the fil
7
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
8
9
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.
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 (you see what I did there?).
11
11
12
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
13
@@ -18,10 +18,14 @@ You can also use "yank inside paragraph", which will copy the paragraph you're i
18
18
--- paste here ---
19
19
20
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:
21
+
Place your cursor HERE (on the H), and use the change to tag functionality to replace the text until this colon-sign:
22
22
23
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
24
25
+
Some ideas to work with:
26
+
- Find all occurences of the word "Lord" and replace it with "Lordi"
27
+
- Move paragraphs around, e.g. cut some paragraphs and paste them somewhere else with just a few keystrokes
Copy file name to clipboardexpand all lines: assignment-3.txt
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ In this assignment we're going to be using the visual mode, macros and registers
2
2
3
3
We will have some text that you can select, modify etc.
4
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.
5
+
Below you will find a shopping list, that should have a dash (-) at the beginning of each 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.
Copy file name to clipboardexpand all lines: introduction.md
+28
Original file line number
Diff line number
Diff line change
@@ -52,4 +52,32 @@ Write your changes and exit vim: `:wq`
52
52
Save your file as: `:saveas /path/where/to`
53
53
Faster way to do `:wq`: `ZZ`
54
54
55
+
## Configuration
56
+
57
+
Vim configuration is something of an endless swamp, where once you get into, it's really hard to stop. For this workshop, we'll just start out with a minimalistic configuration. If you have vim already configured to your liking, it's fine, continue using that, but for those who doesn't have a sane configuration file, I'll provide the simple one here.
58
+
59
+
The vim configuration file exists at `~/.vimrc` or `~/.vim/vimrc`. You can type in `:version` to print out information about the locations.
60
+
Also `:scriptnames` will print out locations of different script files that vim has loaded.
61
+
62
+
The vim configuration file is just a line by line set up of commands to execute during startup. The double quote (") is a comment, and anything after the quote is ignored.
63
+
64
+
```
65
+
set nocompatible " good to have as first line, see :h nocompatible
66
+
set backspace=indent,eol,start " backspace can move beyond eol, indent and start of line
67
+
set whichwrap+=<,>,h,l " allow <,> and h, l to move to the previous/next line
68
+
set encoding=utf-8 nobomb " set the encoding used in vim, no BOM prepended
69
+
set fileformat=unix " set the file format to unix, e.g. <NL> (newline) is used instead of <CR><NL>
70
+
syntax on " syntax highlighting
71
+
set hlsearch " highlight all search results
72
+
set ignorecase " case insensitive search
73
+
set incsearch " show incremental search results
74
+
set number " show line numbers
75
+
set relativenumber " show the line numbering relative to where you are
76
+
set noswapfile " disable swap files
77
+
set showcmd " show the command being executed on the status bar
78
+
```
79
+
80
+
This is a very minimalistic configuration file, and I encourage you to investigate the many, many ways of configuring vim.
Copy file name to clipboardexpand all lines: movement.md
+12
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,18 @@ Bonus:
49
49
Jump to your previous navigation location: `Ctrl-i`\
50
50
Jump back to where you were: `Ctrl-o`
51
51
52
+
## Searching text
53
+
54
+
You can search for text by entering the search key `/{word to search}<CR>`, then navigate to the next occurrence with `n` and previous occurrence with `N`. You can start searching backwards by entering `?` instead of `/`.
55
+
56
+
Search for string: `/{string}`\
57
+
Jump to character: `t`\
58
+
Jump onto character: `f`\
59
+
Search for other instances of the word under your cursor: `*`\
60
+
Go to the next instance when you've jumped to a character (with `f` or `t`): `;`\
61
+
Go to the previous instance when you've jumped to a character (with `f` or `t`): `,`
62
+
63
+
52
64
# Assignment 1
53
65
54
66
Please read the instructions in the `assignment-1.txt` file, and try out the verbs, modifiers and nouns.
0 commit comments