31200
|
1 " Vim filetype plugin file
|
|
2 " Language: Oblivion Language (obl)
|
|
3 " Original Creator: Kat <katisntgood@gmail.com>
|
|
4 " Maintainer: Kat <katisntgood@gmail.com>
|
|
5 " Created: August 08, 2021
|
|
6 " Last Change: 13 November 2022
|
|
7
|
|
8 if exists("b:did_ftplugin")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 let s:cpo_save = &cpo
|
|
13 set cpo&vim
|
|
14
|
|
15 let b:undo_ftplugin = "setl com< cms<"
|
|
16
|
|
17 noremap <script> <buffer> <silent> [[ <nop>
|
|
18 noremap <script> <buffer> <silent> ]] <nop>
|
|
19
|
|
20 noremap <script> <buffer> <silent> [] <nop>
|
|
21 noremap <script> <buffer> <silent> ][ <nop>
|
|
22
|
|
23 setlocal commentstring=;%s
|
|
24 setlocal comments=:;
|
|
25
|
|
26 function s:NextSection(type, backwards, visual)
|
|
27 if a:visual
|
|
28 normal! gv
|
|
29 endif
|
|
30
|
|
31 if a:type == 1
|
|
32 let pattern = '\v(\n\n^\S|%^)'
|
|
33 let flags = 'e'
|
|
34 elseif a:type == 2
|
|
35 let pattern = '\v^\S.*'
|
|
36 let flags = ''
|
|
37 endif
|
|
38
|
|
39 if a:backwards
|
|
40 let dir = '?'
|
|
41 else
|
|
42 let dir = '/'
|
|
43 endif
|
|
44
|
|
45 execute 'silent normal! ' . dir . pattern . dir . flags . "\r"
|
|
46 endfunction
|
|
47
|
|
48 noremap <script> <buffer> <silent> ]]
|
|
49 \ :call <SID>NextSection(1, 0, 0)<cr>
|
|
50
|
|
51 noremap <script> <buffer> <silent> [[
|
|
52 \ :call <SID>NextSection(1, 1, 0)<cr>
|
|
53
|
|
54 noremap <script> <buffer> <silent> ][
|
|
55 \ :call <SID>NextSection(2, 0, 0)<cr>
|
|
56
|
|
57 noremap <script> <buffer> <silent> []
|
|
58 \ :call <SID>NextSection(2, 1, 0)<cr>
|
|
59
|
|
60 vnoremap <script> <buffer> <silent> ]]
|
|
61 \ :<c-u>call <SID>NextSection(1, 0, 1)<cr>
|
|
62 vnoremap <script> <buffer> <silent> [[
|
|
63 \ :<c-u>call <SID>NextSection(1, 1, 1)<cr>
|
|
64 vnoremap <script> <buffer> <silent> ][
|
|
65 \ :<c-u>call <SID>NextSection(2, 0, 1)<cr>
|
|
66 vnoremap <script> <buffer> <silent> []
|
|
67 \ :<c-u>call <SID>NextSection(2, 1, 1)<cr>
|
|
68
|
|
69 let &cpo = s:cpo_save
|
|
70 unlet s:cpo_save
|