aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-11-24 10:23:50 +0000
committerGitHub <noreply@github.com>2022-11-24 10:23:50 +0000
commit868d8d69627c4b8fd5225da0dff5905f75645946 (patch)
tree56f21690606a99140cfc2df4422626d56b1fca51 /runtime
parentc9adbcafaec6c7aecb01e8f06a423a74b0a01116 (diff)
downloadrneovim-868d8d69627c4b8fd5225da0dff5905f75645946.tar.gz
rneovim-868d8d69627c4b8fd5225da0dff5905f75645946.tar.bz2
rneovim-868d8d69627c4b8fd5225da0dff5905f75645946.zip
vim-patch:partial:b59ae59a5870 (#21170)
Update runtime files https://github.com/vim/vim/commit/b59ae59a58706e454ef8c78276f021b1f58466e7 - Omit `map()` lambda arg comment. Not worth mentioning for legacy script (and is already hinted at below). - Cherry-pick latest `'thesaurusfunc'` example. - Skip `optwin.vim` `'keyprotocol'` change. - 🧜‍♀️ Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt9
-rw-r--r--runtime/doc/builtin.txt43
-rw-r--r--runtime/doc/digraph.txt2
-rw-r--r--runtime/doc/insert.txt44
-rw-r--r--runtime/doc/map.txt2
-rw-r--r--runtime/doc/options.txt8
-rw-r--r--runtime/doc/tips.txt2
-rw-r--r--runtime/ftplugin/lua.vim4
-rw-r--r--runtime/ftplugin/mermaid.vim49
-rw-r--r--runtime/ftplugin/obse.vim70
-rw-r--r--runtime/indent/obse.vim55
-rw-r--r--runtime/optwin.vim2
-rw-r--r--runtime/syntax/mermaid.vim155
-rw-r--r--runtime/syntax/obse.vim3360
-rw-r--r--runtime/syntax/swayconfig.vim28
15 files changed, 3774 insertions, 59 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 9bb835e661..a39407aeca 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -823,8 +823,8 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
command is run, before jumping to the first
location. For |:cfile| and |:lfile| commands
- it is run after error file is read and before
- moving to the first error.
+ it is run after the error file is read and
+ before moving to the first error.
See |QuickFixCmdPost-example|.
*QuitPre*
QuitPre When using `:quit`, `:wq` or `:qall`, before
@@ -1065,8 +1065,9 @@ VimResume After Nvim resumes from |suspend| state.
*VimSuspend*
VimSuspend Before Nvim enters |suspend| state.
*WinClosed*
-WinClosed After closing a window. The pattern is
- matched against the |window-ID|. Both
+WinClosed When closing a window, just before it is
+ removed from the window layout. The pattern
+ is matched against the |window-ID|. Both
<amatch> and <afile> are set to the |window-ID|.
After WinLeave.
Non-recursive (event cannot trigger itself).
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index fdee409639..08c8e2e9d6 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -6921,29 +6921,38 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()*
setcellwidths({list}) *setcellwidths()*
Specify overrides for cell widths of character ranges. This
- tells Vim how wide characters are, counted in screen cells.
- This overrides 'ambiwidth'. Example: >
- setcellwidths([[0xad, 0xad, 1],
- \ [0x2194, 0x2199, 2]])
-
-< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
- The {list} argument is a list of lists with each three
- numbers. These three numbers are [low, high, width]. "low"
- and "high" can be the same, in which case this refers to one
- character. Otherwise it is the range of characters from "low"
- to "high" (inclusive). "width" is either 1 or 2, indicating
- the character width in screen cells.
- An error is given if the argument is invalid, also when a
- range overlaps with another.
+ tells Vim how wide characters are when displayed in the
+ terminal, counted in screen cells. The values override
+ 'ambiwidth'. Example: >
+ call setcellwidths([
+ \ [0x111, 0x111, 1],
+ \ [0x2194, 0x2199, 2],
+ \ ])
+
+< The {list} argument is a List of Lists with each three
+ numbers: [{low}, {high}, {width}]. *E1109* *E1110*
+ {low} and {high} can be the same, in which case this refers to
+ one character. Otherwise it is the range of characters from
+ {low} to {high} (inclusive). *E1111* *E1114*
Only characters with value 0x100 and higher can be used.
+ {width} must be either 1 or 2, indicating the character width
+ in screen cells. *E1112*
+ An error is given if the argument is invalid, also when a
+ range overlaps with another. *E1113*
+
If the new value causes 'fillchars' or 'listchars' to become
invalid it is rejected and an error is given.
- To clear the overrides pass an empty list: >
- setcellwidths([]);
+ To clear the overrides pass an empty {list}: >
+ call setcellwidths([])
+
< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
- the effect for known emoji characters.
+ the effect for known emoji characters. Move the cursor
+ through the text to check if the cell widths of your terminal
+ match with what Vim knows about each emoji. If it doesn't
+ look right you need to adjust the {list} argument.
+
setcharpos({expr}, {list}) *setcharpos()*
Same as |setpos()| but uses the specified column number as the
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index eb3de0111f..ce0a929bc1 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -156,7 +156,7 @@ These are the RFC1345 digraphs for the one-byte characters. See the output of
":digraphs" for the others.
EURO
-
+ *euro* *euro-digraph*
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
added for this. Note the difference between latin1, where the digraph Cu is
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 0133824e76..e25f5901ef 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -857,29 +857,27 @@ invoked and what it should return.
Here is an example that uses the "aiksaurus" command (provided by Magnus
Groß): >
- func Thesaur(findstart, base)
- if a:findstart
- let line = getline('.')
- let start = col('.') - 1
- while start > 0 && line[start - 1] =~ '\a'
- let start -= 1
- endwhile
- return start
- else
- let res = []
- let h = ''
- for l in split(system('aiksaurus ' .. shellescape(a:base)), '\n')
- if l[:3] == '=== '
- let h = substitute(l[4:], ' =*$', '', '')
- elseif l[0] =~ '\a'
- call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
- endif
- endfor
- return res
- endif
- endfunc
-
- set thesaurusfunc=Thesaur
+ func Thesaur(findstart, base)
+ if a:findstart
+ return searchpos('\<', 'bnW', line('.'))[1] - 1
+ endif
+ let res = []
+ let h = ''
+ for l in systemlist('aiksaurus ' .. shellescape(a:base))
+ if l[:3] == '=== '
+ let h = '(' .. substitute(l[4:], ' =*$', ')', '')
+ elseif l ==# 'Alphabetically similar known words are: '
+ let h = "\U0001f52e"
+ elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t")
+ call extend(res, map(split(substitute(l, '^\t', '', ''), ', '), {_, val -> {'word': val, 'menu': h}}))
+ endif
+ endfor
+ return res
+ endfunc
+
+ if exists('+thesaurusfunc')
+ set thesaurusfunc=Thesaur
+ endif
Completing keywords in the current and included files *compl-keyword*
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index c4bacfd632..fe07c2e1c1 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1713,7 +1713,7 @@ When executed as: >
This will invoke: >
:call Myfunc("arg1","arg2")
-< *q-args-example*
+< *q-args-example*
A more substantial example: >
:function Allargs(command)
: let i = 0
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 0895d980f5..36eabfdcbf 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3349,9 +3349,13 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
Expression to be used to transform the string found with the 'include'
option to a file name. Mostly useful to change "." to "/" for Java: >
- :set includeexpr=substitute(v:fname,'\\.','/','g')
+ :setlocal includeexpr=substitute(v:fname,'\\.','/','g')
< The "v:fname" variable will be set to the file name that was detected.
-
+ Note the double backslash: the `:set` command first halves them, then
+ one remains in the value, where "\." matches a dot literally. For
+ simple character replacements `tr()` avoids the need for escaping: >
+ :setlocal includeexpr=tr(v:fname,'.','/')
+<
Also used for the |gf| command if an unmodified file name can't be
found. Allows doing "gf" on the name after an 'include' statement.
Also used for |<cfile>|.
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 5416ba5d89..559f31eb2d 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -454,7 +454,7 @@ the current window, try this custom `:HelpCurwin` command:
>
command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
let s:did_open_help = v:false
-
+
function s:HelpCurwin(subject) abort
let mods = 'silent noautocmd keepalt'
if !s:did_open_help
diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim
index c6ce4a0615..88b1fc9d44 100644
--- a/runtime/ftplugin/lua.vim
+++ b/runtime/ftplugin/lua.vim
@@ -4,7 +4,7 @@
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
" Contributor: Dorai Sitaram <ds26@gte.com>
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
-" Last Change: 2022 Nov 16
+" Last Change: 2022 Nov 19
if exists("b:did_ftplugin")
finish
@@ -21,7 +21,7 @@ setlocal formatoptions-=t formatoptions+=croql
let &l:define = '\<function\|\<local\%(\s\+function\)\='
" TODO: handle init.lua
-setlocal includeexpr=substitute(v:fname,'\.','/','g')
+setlocal includeexpr=tr(v:fname,'.','/')
setlocal suffixesadd=.lua
let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<"
diff --git a/runtime/ftplugin/mermaid.vim b/runtime/ftplugin/mermaid.vim
new file mode 100644
index 0000000000..fe84ab37cf
--- /dev/null
+++ b/runtime/ftplugin/mermaid.vim
@@ -0,0 +1,49 @@
+" Vim filetype plugin
+" Language: Mermaid
+" Maintainer: Craig MacEachern <https://github.com/craigmac/vim-mermaid>
+" Last Change: 2022 Oct 13
+
+if exists("b:did_ftplugin")
+ finish
+endif
+
+let s:keepcpo= &cpo
+set cpo&vim
+
+" Use mermaid live editor's style
+setlocal expandtab
+setlocal shiftwidth=2
+setlocal softtabstop=-1
+setlocal tabstop=4
+
+" TODO: comments, formatlist stuff, based on what?
+setlocal comments=b:#,fb:-
+setlocal commentstring=#\ %s
+setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
+setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\}
+
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<"
+else
+ let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<"
+endif
+
+if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps")
+ nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
+ nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
+ xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
+ xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
+ let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]'
+endif
+
+" if has("folding") && get(g:, "markdown_folding", 0)
+" setlocal foldexpr=MarkdownFold()
+" setlocal foldmethod=expr
+" setlocal foldtext=MarkdownFoldText()
+" let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<"
+" endif
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
+" vim:set sw=2:
diff --git a/runtime/ftplugin/obse.vim b/runtime/ftplugin/obse.vim
new file mode 100644
index 0000000000..6d865f05ee
--- /dev/null
+++ b/runtime/ftplugin/obse.vim
@@ -0,0 +1,70 @@
+" Vim filetype plugin file
+" Language: Oblivion Language (obl)
+" Original Creator: Kat <katisntgood@gmail.com>
+" Maintainer: Kat <katisntgood@gmail.com>
+" Created: August 08, 2021
+" Last Change: 13 November 2022
+
+if exists("b:did_ftplugin")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+let b:undo_ftplugin = "setl com< cms<"
+
+noremap <script> <buffer> <silent> [[ <nop>
+noremap <script> <buffer> <silent> ]] <nop>
+
+noremap <script> <buffer> <silent> [] <nop>
+noremap <script> <buffer> <silent> ][ <nop>
+
+setlocal commentstring=;%s
+setlocal comments=:;
+
+function s:NextSection(type, backwards, visual)
+ if a:visual
+ normal! gv
+ endif
+
+ if a:type == 1
+ let pattern = '\v(\n\n^\S|%^)'
+ let flags = 'e'
+ elseif a:type == 2
+ let pattern = '\v^\S.*'
+ let flags = ''
+ endif
+
+ if a:backwards
+ let dir = '?'
+ else
+ let dir = '/'
+ endif
+
+ execute 'silent normal! ' . dir . pattern . dir . flags . "\r"
+endfunction
+
+noremap <script> <buffer> <silent> ]]
+ \ :call <SID>NextSection(1, 0, 0)<cr>
+
+noremap <script> <buffer> <silent> [[
+ \ :call <SID>NextSection(1, 1, 0)<cr>
+
+noremap <script> <buffer> <silent> ][
+ \ :call <SID>NextSection(2, 0, 0)<cr>
+
+noremap <script> <buffer> <silent> []
+ \ :call <SID>NextSection(2, 1, 0)<cr>
+
+vnoremap <script> <buffer> <silent> ]]
+ \ :<c-u>call <SID>NextSection(1, 0, 1)<cr>
+vnoremap <script> <buffer> <silent> [[
+ \ :<c-u>call <SID>NextSection(1, 1, 1)<cr>
+vnoremap <script> <buffer> <silent> ][
+ \ :<c-u>call <SID>NextSection(2, 0, 1)<cr>
+vnoremap <script> <buffer> <silent> []
+ \ :<c-u>call <SID>NextSection(2, 1, 1)<cr>
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/indent/obse.vim b/runtime/indent/obse.vim
new file mode 100644
index 0000000000..6603723dba
--- /dev/null
+++ b/runtime/indent/obse.vim
@@ -0,0 +1,55 @@
+" Vim indent file
+" Language: Oblivion Language (obl)
+" Original Creator: Kat <katisntgood@gmail.com>
+" Maintainer: Kat <katisntgood@gmail.com>
+" Created: 01 November 2021
+" Last Change: 13 November 2022
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+let b:undo_indent = 'setlocal indentkeys< indentexpr<'
+
+setlocal indentexpr=GetOblIndent()
+setlocal indentkeys+==~endif,=~else,=~loop,=~end
+
+if exists("*GetOblIndent")
+ finish
+endif
+let s:keepcpo = &cpo
+set cpo&vim
+
+let s:SKIP_LINES = '^\s*\(;.*\)'
+function! GetOblIndent()
+
+ let lnum = prevnonblank(v:lnum - 1)
+ let cur_text = getline(v:lnum)
+ if lnum == 0
+ return 0
+ endif
+ let prev_text = getline(lnum)
+ let found_cont = 0
+ let ind = indent(lnum)
+
+ " indent next line on start terms
+ let i = match(prev_text, '\c^\s*\(\s\+\)\?\(\(if\|while\|foreach\|begin\|else\%[if]\)\>\)')
+ if i >= 0
+ let ind += shiftwidth()
+ if strpart(prev_text, i, 1) == '|' && has('syntax_items')
+ \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
+ let ind -= shiftwidth()
+ endif
+ endif
+ " indent current line on end/else terms
+ if cur_text =~ '\c^\s*\(\s\+\)\?\(\(loop\|endif\|else\%[if]\)\>\)'
+ let ind = ind - shiftwidth()
+ " if we are at a begin block just go to column 0
+ elseif cur_text =~ '\c^\s*\(\s\+\)\?\(\(begin\|end\)\>\)'
+ let ind = 0
+ endif
+ return ind
+endfunction
+
+let &cpo = s:keepcpo
+unlet s:keepcpo
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index db21066819..23562c6830 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Oct 28
+" Last Change: 2022 Nov 23
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
diff --git a/runtime/syntax/mermaid.vim b/runtime/syntax/mermaid.vim
new file mode 100644
index 0000000000..afdbcc3d62
--- /dev/null
+++ b/runtime/syntax/mermaid.vim
@@ -0,0 +1,155 @@
+" Vim syntax file
+" Language: Mermaid
+" Maintainer: Craig MacEahern <https://github.com/craigmac/vim-mermaid>
+" Filenames: *.mmd
+" Last Change: 2022 Nov 22
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syntax iskeyword @,48-57,192-255,$,_,-,:
+syntax keyword mermaidKeyword
+ \ _blank
+ \ _self
+ \ _parent
+ \ _top
+ \ ::icon
+ \ accDescr
+ \ accTitle
+ \ actor
+ \ activate
+ \ alt
+ \ and
+ \ as
+ \ autonumber
+ \ branch
+ \ break
+ \ callback
+ \ checkout
+ \ class
+ \ classDef
+ \ classDiagram
+ \ click
+ \ commit
+ \ commitgitGraph
+ \ critical
+ \ dataFormat
+ \ dateFormat
+ \ deactivate
+ \ direction
+ \ element
+ \ else
+ \ end
+ \ erDiagram
+ \ flowchart
+ \ gantt
+ \ gitGraph
+ \ graph
+ \ journey
+ \ link
+ \ LR
+ \ TD
+ \ TB
+ \ RL
+ \ loop
+ \ merge
+ \ mindmap root
+ \ Note
+ \ Note right of
+ \ Note left of
+ \ Note over
+ \ note
+ \ note right of
+ \ note left of
+ \ note over
+ \ opt
+ \ option
+ \ par
+ \ participant
+ \ pie
+ \ rect
+ \ requirement
+ \ rgb
+ \ section
+ \ sequenceDiagram
+ \ state
+ \ stateDiagram
+ \ stateDiagram-v2
+ \ style
+ \ subgraph
+ \ title
+highlight link mermaidKeyword Keyword
+
+syntax match mermaidStatement "|"
+syntax match mermaidStatement "--\?[>x)]>\?+\?-\?"
+syntax match mermaidStatement "\~\~\~"
+syntax match mermaidStatement "--"
+syntax match mermaidStatement "---"
+syntax match mermaidStatement "-->"
+syntax match mermaidStatement "-\."
+syntax match mermaidStatement "\.->"
+syntax match mermaidStatement "-\.-"
+syntax match mermaidStatement "-\.\.-"
+syntax match mermaidStatement "-\.\.\.-"
+syntax match mermaidStatement "=="
+syntax match mermaidStatement "==>"
+syntax match mermaidStatement "===>"
+syntax match mermaidStatement "====>"
+syntax match mermaidStatement "&"
+syntax match mermaidStatement "--o"
+syntax match mermaidStatement "--x"
+syntax match mermaidStatement "x--x"
+syntax match mermaidStatement "-----"
+syntax match mermaidStatement "---->"
+syntax match mermaidStatement "==="
+syntax match mermaidStatement "===="
+syntax match mermaidStatement "====="
+syntax match mermaidStatement ":::"
+syntax match mermaidStatement "<|--"
+syntax match mermaidStatement "\*--"
+syntax match mermaidStatement "o--"
+syntax match mermaidStatement "o--o"
+syntax match mermaidStatement "<--"
+syntax match mermaidStatement "<-->"
+syntax match mermaidStatement "\.\."
+syntax match mermaidStatement "<\.\."
+syntax match mermaidStatement "<|\.\."
+syntax match mermaidStatement "--|>"
+syntax match mermaidStatement "--\*"
+syntax match mermaidStatement "--o"
+syntax match mermaidStatement "\.\.>"
+syntax match mermaidStatement "\.\.|>"
+syntax match mermaidStatement "<|--|>"
+syntax match mermaidStatement "||--o{"
+highlight link mermaidStatement Statement
+
+syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?"
+highlight link mermaidIdentifier Identifier
+
+syntax match mermaidType "[\+-\#\~]\?\cint\>"
+syntax match mermaidType "[\+-\#\~]\?\cString\>"
+syntax match mermaidType "[\+-\#\~]\?\cbool\>"
+syntax match mermaidType "[\+-\#\~]\?\cBigDecimal\>"
+syntax match mermaidType "[\+-\#\~]\?\cList\~.\+\~"
+syntax match mermaidType "<<\w\+>>"
+highlight link mermaidType Type
+
+syntax match mermaidComment "%%.*$"
+highlight link mermaidComment Comment
+
+syntax region mermaidDirective start="%%{" end="\}%%"
+highlight link mermaidDirective PreProc
+
+syntax region mermaidString start=/"/ skip=/\\"/ end=/"/
+highlight link mermaidString String
+
+let b:current_syntax = "mermaid"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:set sw=2:
diff --git a/runtime/syntax/obse.vim b/runtime/syntax/obse.vim
new file mode 100644
index 0000000000..4ff04281f3
--- /dev/null
+++ b/runtime/syntax/obse.vim
@@ -0,0 +1,3360 @@
+" Vim syntax file
+" Language: Oblivion Language (obl)
+" Original Creator: Ulthar Seramis
+" Maintainer: Kat <katisntgood@gmail.com>
+" Latest Revision: 13 November 2022
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" obse is case insensitive
+syntax case ignore
+
+" Statements {{{
+syn keyword obseStatement set let to skipwhite
+" the second part needs to be separate as to not mess up the next group
+syn match obseStatementTwo ":="
+" }}}
+
+" Regex matched objects {{{
+" these are matched with regex and thus must be set first
+syn match obseNames '\w\+'
+syn match obseScriptNameRegion '\i\+' contained
+syn match obseVariable '\w*\S' contained
+syn match obseReference '\zs\w\+\>\ze\.'
+" }}}
+
+" Operators {{{
+syn match obseOperator "\v\*"
+syn match obseOperator "\v\-"
+syn match obseOperator "\v\+"
+syn match obseOperator "\v\/"
+syn match obseOperator "\v\^"
+syn match obseOperator "\v\="
+syn match obseOperator "\v\>"
+syn match obseOperator "\v\<"
+syn match obseOperator "\v\!"
+syn match obseOperator "\v\&"
+syn match obseOperator "\v\|"
+" }}}
+
+" Numbers {{{
+syn match obseInt '\d\+'
+syn match obseInt '[-+]\d\+'
+syn match obseFloat '\d\+\.\d*'
+syn match obseFloat '[-+]\d\+\.\d*'
+" }}}
+
+" Comments and strings {{{
+syn region obseComment start=";" end="$" keepend fold contains=obseToDo
+syn region obseString start=/"/ end=/"/ keepend fold contains=obseStringFormatting
+syn match obseStringFormatting "%%" contained
+syn match obseStringFormatting "%a" contained
+syn match obseStringFormatting "%B" contained
+syn match obseStringFormatting "%b" contained
+syn match obseStringFormatting "%c" contained
+syn match obseStringFormatting "%e" contained
+syn match obseStringFormatting "%g" contained
+syn match obseStringFormatting "%i" contained
+syn match obseStringFormatting "%k" contained
+syn match obseStringFormatting "%n" contained
+syn match obseStringFormatting "%p" contained
+syn match obseStringFormatting "%ps" contained
+syn match obseStringFormatting "%pp" contained
+syn match obseStringFormatting "%po" contained
+syn match obseStringFormatting "%q" contained
+syn match obseStringFormatting "%r" contained
+syn match obseStringFormatting "%v" contained
+syn match obseStringFormatting "%x" contained
+syn match obseStringFormatting "%z" contained
+syn match obseStringFormatting "%{" contained
+syn match obseStringFormatting "%}" contained
+syn match obseStringFormatting "%\d*.\d*f" contained
+syn match obseStringFormatting "% \d*.\d*f" contained
+syn match obseStringFormatting "%-\d*.\d*f" contained
+syn match obseStringFormatting "%+\d*.\d*f" contained
+syn match obseStringFormatting "%\d*.\d*e" contained
+syn match obseStringFormatting "%-\d*.\d*e" contained
+syn match obseStringFormatting "% \d*.\d*e" contained
+syn match obseStringFormatting "%+\d*.\d*e" contained
+syn keyword obseToDo contained TODO todo Todo ToDo FIXME fixme NOTE note
+" }}}
+
+
+" Conditionals {{{
+syn match obseCondition "If"
+syn match obseCondition "Eval"
+syn match obseCondition "Return"
+syn match obseCondition "EndIf"
+syn match obseCondition "ElseIf"
+syn match obseCondition "Else"
+" }}}
+
+" Repeat loops {{{
+syn match obseRepeat "Label"
+syn match obseRepeat "GoTo"
+syn match obseRepeat "While"
+syn match obseRepeat "Loop"
+syn match obseRepeat "ForEach"
+syn match obseRepeat "Break"
+syn match obseRepeat "Continue"
+" }}}
+
+" Basic Types {{{
+syn keyword obseTypes array_var float int long ref reference short string_var nextgroup=obseNames skipwhite
+syn keyword obseOtherKey Player player playerRef playerREF PlayerRef PlayerREF
+syn keyword obseScriptName ScriptName scriptname Scriptname scn nextgroup=obseScriptNameRegion skipwhite
+syn keyword obseBlock Begin End
+" }}}
+
+" Fold {{{
+setlocal foldmethod=syntax
+syn cluster obseNoFold contains=obseComment,obseString
+syn region obseFoldIfContainer
+ \ start="^\s*\<if\>"
+ \ end="^\s*\<endif\>"
+ \ keepend extend
+ \ containedin=ALLBUT,@obseNoFold
+ \ contains=ALLBUT,obseScriptName,obseScriptNameRegion
+syn region obseFoldIf
+ \ start="^\s*\<if\>"
+ \ end="^\s*\<endif\>"
+ \ fold
+ \ keepend
+ \ contained containedin=obseFoldIfContainer
+ \ nextgroup=obseFoldElseIf,obseFoldElse
+ \ contains=TOP,NONE
+syn region obseFoldElseIf
+ \ start="^\s*\<elseif\>"
+ \ end="^\s*\<endif\>"
+ \ fold
+ \ keepend
+ \ contained containedin=obseFoldIfContainer
+ \ nextgroup=obseFoldElseIf,obseFoldElse
+ \ contains=TOP
+syn region obseFoldElse
+ \ start="^\s*\<else\>"
+ \ end="^\s*\<endif\>"
+ \ fold
+ \ keepend
+ \ contained containedin=obseFoldIfContainer
+ \ contains=TOP
+syn region obseFoldWhile
+ \ start="^\s*\<while\>"
+ \ end="^\s*\<loop\>"
+ \ fold
+ \ keepend extend
+ \ contains=TOP
+ \ containedin=ALLBUT,@obseNoFold
+" fold for loops
+syn region obseFoldFor
+ \ start="^\s*\<foreach\>"
+ \ end="^\s*\<loop\>"
+ \ fold
+ \ keepend extend
+ \ contains=TOP
+ \ containedin=ALLBUT,@obseNoFold
+ \ nextgroup=obseVariable
+" }}}
+
+" Skills and Attributes {{{
+syn keyword skillAttribute
+ \ Strength
+ \ Willpower
+ \ Speed
+ \ Personality
+ \ Intelligence
+ \ Agility
+ \ Endurance
+ \ Luck
+ \ Armorer
+ \ Athletics
+ \ Blade
+ \ Block
+ \ Blunt
+ \ HandToHand
+ \ HeavyArmor
+ \ Alchemy
+ \ Alteration
+ \ Conjuration
+ \ Destruction
+ \ Illusion
+ \ Mysticism
+ \ Restoration
+ \ Acrobatics
+ \ LightArmor
+ \ Marksman
+ \ Mercantile
+ \ Security
+ \ Sneak
+ \ Speechcraft
+" }}}
+
+" Block Types {{{
+syn keyword obseBlockType
+ \ ExitGame
+ \ ExitToMainMenu
+ \ Function
+ \ GameMode
+ \ LoadGame
+ \ MenuMode
+ \ OnActivate
+ \ OnActorDrop
+ \ OnActorEquip
+ \ OnActorUnequip
+ \ OnAdd
+ \ OnAlarm
+ \ OnAlarmTrespass
+ \ OnAlarmVictim
+ \ OnAttack
+ \ OnBlock
+ \ OnBowAttack
+ \ OnClick
+ \ OnClose
+ \ OnCreatePotion
+ \ OnCreateSpell
+ \ OnDeath
+ \ OnDodge
+ \ OnDrinkPotion
+ \ OnDrop
+ \ OnEatIngredient
+ \ OnEnchant
+ \ OnEquip
+ \ OnFallImpact
+ \ OnHealthDamage
+ \ OnHit
+ \ OnHitWith
+ \ OnKnockout
+ \ OnLoad
+ \ OnMagicApply
+ \ OnMagicCast
+ \ OnMagicEffectHit
+ \ OnMagicEffectHit2
+ \ OnMapMarkerAdd
+ \ OnMouseover
+ \ OnMurder
+ \ OnNewGame
+ \ OnOpen
+ \ OnPackageChange
+ \ OnPackageDone
+ \ OnPackageStart
+ \ OnQuestComplete
+ \ OnRecoil
+ \ OnRelease
+ \ OnReset
+ \ OnSaveIni
+ \ OnScriptedSkillUp
+ \ OnScrollCast
+ \ OnSell
+ \ OnSkillUp
+ \ OnSoulTrap
+ \ OnSpellCast
+ \ OnStagger
+ \ OnStartCombat
+ \ OnTrigger
+ \ OnTriggerActor
+ \ OnTriggerMob
+ \ OnUnequip
+ \ OnVampireFeed
+ \ OnWaterDive
+ \ OnWaterSurface
+ \ PostLoadGame
+ \ QQQ
+ \ SaveGame
+ \ ScriptEffectFinish
+ \ ScriptEffectStart
+ \ ScriptEffectUpdate
+" }}}
+
+" Functions {{{
+" CS functions {{{
+syn keyword csFunction
+ \ Activate
+ \ AddAchievement
+ \ AddFlames
+ \ AddItem
+ \ AddScriptPackage
+ \ AddSpell
+ \ AddTopic
+ \ AdvSkill
+ \ AdvancePCLevel
+ \ AdvancePCSkill
+ \ Autosave
+ \ CanHaveFlames
+ \ CanPayCrimeGold
+ \ Cast
+ \ ClearOwnership
+ \ CloseCurrentOblivionGate
+ \ CloseOblivionGate
+ \ CompleteQuest
+ \ CreateFullActorCopy
+ \ DeleteFullActorCopy
+ \ Disable
+ \ DisableLinkedPathPoints
+ \ DisablePlayerControls
+ \ Dispel
+ \ DispelAllSpells
+ \ Drop
+ \ DropMe
+ \ DuplicateAllItems
+ \ DuplicateNPCStats
+ \ Enable
+ \ EnableFastTravel
+ \ EnableLinkedPathPoints
+ \ EnablePlayerControls
+ \ EquipItem
+ \ EssentialDeathReload
+ \ EvaluatePackage
+ \ ForceAV
+ \ ForceActorValue
+ \ ForceCloseOblivionGate
+ \ ForceFlee
+ \ ForceTakeCover
+ \ ForceWeather
+ \ GetAV
+ \ GetActionRef
+ \ GetActorValue
+ \ GetAlarmed
+ \ GetAmountSoldStolen
+ \ GetAngle
+ \ GetArmorRating
+ \ GetArmorRatingUpperBody
+ \ GetAttacked
+ \ GetBarterGold
+ \ GetBaseAV
+ \ GetBaseActorValue
+ \ GetButtonPressed
+ \ GetClassDefaultMatch
+ \ GetClothingValue
+ \ GetContainer
+ \ GetCrime
+ \ GetCrimeGold
+ \ GetCrimeKnown
+ \ GetCurrentAIPackage
+ \ GetCurrentAIProcedure
+ \ GetCurrentTime
+ \ GetCurrentWeatherPercent
+ \ GetDayOfWeek
+ \ GetDead
+ \ GetDeadCount
+ \ GetDestroyed
+ \ GetDetected
+ \ GetDetectionLevel
+ \ GetDisabled
+ \ GetDisposition
+ \ GetDistance
+ \ GetDoorDefaultOpen
+ \ GetEquipped
+ \ GetFactionRank
+ \ GetFactionRankDifference
+ \ GetFactionReaction
+ \ GetFatiguePercentage
+ \ GetForceRun
+ \ GetForceSneak
+ \ GetFriendHit
+ \ GetFurnitureMarkerID
+ \ GetGS
+ \ GetGameSetting
+ \ GetGlobalValue
+ \ GetGold
+ \ GetHeadingAngle
+ \ GetIdleDoneOnce
+ \ GetIgnoreFriendlyHits
+ \ GetInCell
+ \ GetInCellParam
+ \ GetInFaction
+