diff options
author | Max Christian Pohle | 2021-01-18 20:18:53 +0100 |
---|---|---|
committer | Max Christian Pohle | 2021-01-18 20:18:53 +0100 |
commit | 3b9cb8322fd7e8370553cd2dd4d1734a45f1f377 (patch) | |
tree | 916727ee6c358b1b41739acbc09f37fea58b7dfa /plugin | |
parent | ad266961572412e853e4e72f1df99dddf8764284 (diff) | |
download | vim-3b9cb8322fd7e8370553cd2dd4d1734a45f1f377.tar.bz2 vim-3b9cb8322fd7e8370553cd2dd4d1734a45f1f377.zip |
Removed karlmarks, made it a plugin and readded it
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/KarlMarks.vim | 29 | ||||
-rw-r--r-- | plugin/karlmarks.vim | 7 |
2 files changed, 7 insertions, 29 deletions
diff --git a/plugin/KarlMarks.vim b/plugin/KarlMarks.vim deleted file mode 100644 index f0699e1..0000000 --- a/plugin/KarlMarks.vim +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | let g:markerbar_additional = '"' " position in buffer when left | ||
2 | let g:markerbar_additional .= '<>' " start/end last selection | ||
3 | let g:markerbar_additional .= '{}' " start/end paragraph | ||
4 | let g:markerbar_additional .= '()' " start/end sentence | ||
5 | let g:markerbar_additional .= '[]' " start/end sentence | ||
6 | let g:markerbar_additional .= '.' " last change | ||
7 | let g:markerbar_additional .= "^" " insert mode stopped | ||
8 | let g:markerbar_additional .= "'`" | ||
9 | |||
10 | function! 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 | ||
24 | endfunction | ||
25 | |||
26 | autocmd CursorHold * call KarlMarks() | ||
27 | |||
28 | " important for distraction free reading while changing windows | ||
29 | " setlocal signcolumn=yes | ||
diff --git a/plugin/karlmarks.vim b/plugin/karlmarks.vim new file mode 100644 index 0000000..9e22144 --- /dev/null +++ b/plugin/karlmarks.vim | |||
@@ -0,0 +1,7 @@ | |||
1 | let g:karlmarks = '"' " position in buffer when left | ||
2 | let g:karlmarks .= '{}' " start/end paragraph | ||
3 | let g:karlmarks .= '()' " start/end sentence | ||
4 | let g:karlmarks .= '[]' " start/end sentence | ||
5 | let g:karlmarks .= '.' " last change | ||
6 | let g:karlmarks .= "^" " insert mode stopped | ||
7 | let g:karlmarks .= "'`" | ||