aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMax Christian Pohle2020-08-02 00:28:44 +0200
committerMax Christian Pohle2020-08-02 00:28:44 +0200
commitd8a86a92ae825bb2863dc25f02a267f240588140 (patch)
treedf3590de0bc1f8f0dd506793038e956cea21bf5b /plugin
downloadvim-karlmarks-d8a86a92ae825bb2863dc25f02a267f240588140.tar.bz2
vim-karlmarks-d8a86a92ae825bb2863dc25f02a267f240588140.zip
First release
Diffstat (limited to 'plugin')
-rw-r--r--plugin/vim-karlmarks.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugin/vim-karlmarks.vim b/plugin/vim-karlmarks.vim
new file mode 100644
index 0000000..f0699e1
--- /dev/null
+++ b/plugin/vim-karlmarks.vim
@@ -0,0 +1,29 @@
1let g:markerbar_additional = '"' " position in buffer when left
2let g:markerbar_additional .= '<>' " start/end last selection
3let g:markerbar_additional .= '{}' " start/end paragraph
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
10function! KarlMarks()
11 for c in map(split(g:markerbar_additional, '\zs'), "char2nr(v:val)") +
12 \ range(char2nr('a'), char2nr('z')) +
13 \ range(char2nr('A'), char2nr('Z')) +
14 \ range(char2nr('0'), char2nr('9'))
15
16 let p = getpos("'".nr2char(c))
17
18 if (p[0] == 0 || p[0] == winbufnr(0)) && p[1] > 0
19 exec "sign unplace ".c
20 exec "sign define mark_".c." text=".nr2char(c)." texthl=SignColumn"
21 exec "sign place ".c." name=mark_".c." line=".p[1]." buffer=".winbufnr(0)
22 endif
23 endfor
24endfunction
25
26autocmd CursorHold * call KarlMarks()
27
28" important for distraction free reading while changing windows
29" setlocal signcolumn=yes
..