aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 3f7231e1b0f149890f9d7613d139ed3a823c4c62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# vim-karlmarks

A teaching plugin for Vim. It uses the `signcolumn` to display currently active
`marks`. These are mostly used as jump locations and some are set by Vim
automatically during the edit sessions. Also user defined marks are shown.
These can be set with `m[a-z]`, e.g. `ma` sets mark `a` and this plugin would
display its line and you can jump to that line with ```a``. Captital letters
even allow jumps between files and session persistent marks.

![screencast](screencast.gif)

Chances are that you have learned only some of the marks Vim has to offer. This
plugin will remember you to use more and once you have that on disk you can
always deinstall it again.


## Prerequirements

I recommend you use this in your `~/.vim/vimrc`

```vim
set signcolumn=yes
```

because if you set it to `signcolumn=auto` it will flicker when you change
the window.

## Installation

Download the [zip file](https://git.entwicklerseite.de/vim-karlmarks/snapshot/vim-karlmarks-master.zip)
and extract it inside `~/.vim/pack/coderonline/start/`.

### Example

```sh
mkdir ~/.vim/pack/coderonline/start/
cd    ~/.vim/pack/coderonline/start/
# download plugin in that directory:
curl -o vim-karlmarks.zip  https://git.entwicklerseite.de/vim-karlmarks/snapshot/vim-karlmarks-master.zip
# unzip the zip file
unzip vim-karlmarks.zip
# remove zip file (not needed any more)
rm vim-karlmarks.zip
```

## Configure optional and additional marks

Here comes some inspiration for additional marks you could enable. Some
are potentially disturbing and are not pre-configured for that reason:

```vim
let g:karlmarks  =   '"'  " position in buffer when left
let g:karlmarks .=  '{}'  " start/end paragraph
let g:karlmarks .=  '()'  " start/end sentence
let g:karlmarks .=  '[]'  " start/end sentence
let g:karlmarks .=  '.'   " last change
let g:karlmarks .=  "^"   " insert mode stopped
let g:karlmarks .=  "'`"
```

but the `g_karlmarks` setting defaults to

```vim
let g:karlmarks = "<>"
```

to allow easier modification of the last selected block, e.g. reposition the
start of the block with `m<` and use `gv` to show the new selection.


## Deinstallation

Remove the folder `~/.vim/pack/coderonline/start/vim-karlmarks` (if you named
it as suggested in the Installation section)

### Exmaple

```sh
rm -irv ~/.vim/pack/coderonline/start/vim-karlmarks
```

..