robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
2f5b8a0092
master
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: 2021 Aug 08 6" Last Change: 2022 Nov 13 7" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') 8 9if exists ( "b:did_ftplugin" ) 10finish 11endif 12 13let s: cpo_save = & cpo 14set cpo & vim 15 16let b: undo_ftplugin = "setl com< cms<" 17 18noremap <script> <buffer> <silent> [[< nop > 19noremap <script> <buffer> <silent> ]]< nop > 20 21noremap <script> <buffer> <silent> []< nop > 22noremap <script> <buffer> <silent> ][< nop > 23 24setlocal commentstring = ;\ %s 25setlocal comments = :; 26 27function s: NextSection ( type , backwards , visual ) 28if a: visual 29normal ! gv 30endif 31 32if a: type == 1 33let pattern = '\v(\n\n^\S|%^)' 34let flags = 'e' 35elseif a: type == 2 36let pattern = '\v^\S.*' 37let flags = '' 38endif 39 40if a: backwards 41let dir = '?' 42else 43let dir = '/' 44endif 45 46execute 'silent normal! ' . dir . pattern . dir . flags . "\r" 47endfunction 48 49noremap <script> <buffer> <silent> ]] 50 \ :call< SID > NextSection(1, 0, 0)< cr > 51 52noremap <script> <buffer> <silent> [[ 53 \ :call< SID > NextSection(1, 1, 0)< cr > 54 55noremap <script> <buffer> <silent> ][ 56 \ :call< SID > NextSection(2, 0, 0)< cr > 57 58noremap <script> <buffer> <silent> [] 59 \ :call< SID > NextSection(2, 1, 0)< cr > 60 61vnoremap <script> <buffer> <silent> ]] 62 \ :< c-u > call< SID > NextSection(1, 0, 1)< cr > 63vnoremap <script> <buffer> <silent> [[ 64 \ :< c-u > call< SID > NextSection(1, 1, 1)< cr > 65vnoremap <script> <buffer> <silent> ][ 66 \ :< c-u > call< SID > NextSection(2, 0, 1)< cr > 67vnoremap <script> <buffer> <silent> [] 68 \ :< c-u > call< SID > NextSection(2, 1, 1)< cr > 69 70let & cpo = s: cpo_save 71unlet s: cpo_save