annotate runtime/ftplugin/obse.vim @ 31200:a7801222c9c5

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