aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md23
-rw-r--r--plugin/vim-karlmarks.vim14
2 files changed, 24 insertions, 13 deletions
diff --git a/README.md b/README.md
index 3576431..8ba6d83 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,6 @@ plugin will remember you to use more and once you have that on disk you can
14always deinstall it again. 14always deinstall it again.
15 15
16 16
17
18
19## Prerequirements 17## Prerequirements
20 18
21I recommend you use this in your `~/.vim/vimrc` 19I recommend you use this in your `~/.vim/vimrc`
@@ -25,7 +23,6 @@ I recommend you use this in your `~/.vim/vimrc`
25because if you set it to `signcolumn=auto` it will flicker when you change 23because if you set it to `signcolumn=auto` it will flicker when you change
26the window. 24the window.
27 25
28
29## Installation 26## Installation
30 27
31Download the [zip file](https://git.entwicklerseite.de/vim-karlmarks/snapshot/vim-karlmarks-master.zip) 28Download the [zip file](https://git.entwicklerseite.de/vim-karlmarks/snapshot/vim-karlmarks-master.zip)
@@ -42,6 +39,26 @@ and extract it inside `~/.vim/pack/coderonline/start/`.
42 # remove zip file (not needed any more) 39 # remove zip file (not needed any more)
43 rm vim-karlmarks.zip 40 rm vim-karlmarks.zip
44 41
42## Configure optional and additional marks
43
44Here comes some inspiration for additional marks you could enable. Some
45are potentially disturbing and were for that reason not pre-configured:
46
47 let g:karlmarks = '"' " position in buffer when left
48 let g:karlmarks .= '{}' " start/end paragraph
49 let g:karlmarks .= '()' " start/end sentence
50 let g:karlmarks .= '[]' " start/end sentence
51 let g:karlmarks .= '.' " last change
52 let g:karlmarks .= "^" " insert mode stopped
53 let g:karlmarks .= "'`"
54
55but the `g_karlmarks_additional` setting defaults to
56
57 let g:karlmarks_additional = "<>"
58
59to allow easier modification of the last selected block, e.g. reposition the
60start of the block with `m<` and use `gv` to show the new selection.
61
45 62
46## Deinstallation 63## Deinstallation
47 64
diff --git a/plugin/vim-karlmarks.vim b/plugin/vim-karlmarks.vim
index f0699e1..cd54fa5 100644
--- a/plugin/vim-karlmarks.vim
+++ b/plugin/vim-karlmarks.vim
@@ -1,14 +1,9 @@
1let g:markerbar_additional = '"' " position in buffer when left 1if !exists("g:karlmarks")
2let g:markerbar_additional .= '<>' " start/end last selection 2 let g:karlmarks = "<>"
3let g:markerbar_additional .= '{}' " start/end paragraph 3endif
4let g:markerbar_additional .= '()' " start/end sentence
5let g:markerbar_additional .= '[]' " start/end sentence
6let g:markerbar_additional .= '.' " last change
7let g:markerbar_additional .= "^" " insert mode stopped
8let g:markerbar_additional .= "'`"
9 4
10function! KarlMarks() 5function! KarlMarks()
11 for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") + 6 for c in map(split(g:karlmarks, '\zs'), "char2nr(v:val)") +
12 \ range(char2nr('a'), char2nr('z')) + 7 \ range(char2nr('a'), char2nr('z')) +
13 \ range(char2nr('A'), char2nr('Z')) + 8 \ range(char2nr('A'), char2nr('Z')) +
14 \ range(char2nr('0'), char2nr('9')) 9 \ range(char2nr('0'), char2nr('9'))
@@ -22,7 +17,6 @@ function! KarlMarks()
22 endif 17 endif
23 endfor 18 endfor
24endfunction 19endfunction
25
26autocmd CursorHold * call KarlMarks() 20autocmd CursorHold * call KarlMarks()
27 21
28" important for distraction free reading while changing windows 22" important for distraction free reading while changing windows
..