aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--runtime/autoload/dist/ft.vim1090
-rw-r--r--runtime/autoload/netrw.vim14
-rw-r--r--runtime/doc/filetype.txt38
-rw-r--r--runtime/doc/help.txt2
-rw-r--r--runtime/doc/indent.txt9
-rw-r--r--runtime/doc/lua.txt5
-rw-r--r--runtime/doc/news.txt11
-rw-r--r--runtime/doc/options.txt18
-rw-r--r--runtime/doc/quickref.txt1
-rw-r--r--runtime/doc/repeat.txt7
-rw-r--r--runtime/doc/starting.txt2
-rw-r--r--runtime/doc/support.txt52
-rw-r--r--runtime/doc/syntax.txt15
-rw-r--r--runtime/doc/userfunc.txt4
-rw-r--r--runtime/filetype.lua3
-rw-r--r--runtime/filetype.vim2676
-rw-r--r--runtime/ftplugin/abaqus.vim43
-rw-r--r--runtime/ftplugin/lua.vim7
-rw-r--r--runtime/ftplugin/markdown.vim36
-rw-r--r--runtime/ftplugin/poefilter.vim13
-rw-r--r--runtime/ftplugin/ssa.vim13
-rw-r--r--runtime/lua/vim/filetype.lua4
-rw-r--r--runtime/lua/vim/filetype/detect.lua2
-rw-r--r--runtime/lua/vim/lsp/protocol.lua2
-rw-r--r--runtime/optwin.vim4
-rw-r--r--runtime/scripts.vim459
-rw-r--r--runtime/synmenu.vim2
-rw-r--r--runtime/syntax/c.vim2
-rw-r--r--runtime/syntax/markdown.vim89
-rw-r--r--runtime/syntax/poefilter.vim167
-rw-r--r--runtime/syntax/sed.vim105
-rw-r--r--runtime/syntax/ssa.vim63
-rwxr-xr-xscripts/vim-patch.sh4
-rw-r--r--src/nvim/buffer.c3
-rw-r--r--src/nvim/buffer_defs.h1
-rw-r--r--src/nvim/change.c24
-rw-r--r--src/nvim/edit.c28
-rw-r--r--src/nvim/edit.h2
-rw-r--r--src/nvim/indent.c43
-rw-r--r--src/nvim/indent.h2
-rw-r--r--src/nvim/ops.c9
-rw-r--r--src/nvim/option.c4
-rw-r--r--src/nvim/option_defs.h2
-rw-r--r--src/nvim/options.lua8
-rw-r--r--src/nvim/optionstr.c5
-rw-r--r--src/nvim/testdir/test_filetype.vim5
-rw-r--r--src/nvim/testdir/test_legacy_filetype.vim4
-rw-r--r--src/nvim/testdir/test_lispindent.vim15
-rw-r--r--src/nvim/testdir/test_visual.vim12
-rw-r--r--src/nvim/version.c3
-rw-r--r--test/functional/plugin/health_spec.lua2
-rw-r--r--test/functional/ui/messages_spec.lua8
53 files changed, 707 insertions, 4437 deletions
diff --git a/README.md b/README.md
index c14531c997..05058f3a2a 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ Pre-built packages for Windows, macOS, and Linux are found on the
Install from source
-------------------
-See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
+See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page and [supported platforms](https://neovim.io/doc/user/support.html#supported-platforms) for details.
The build is CMake-based, but a Makefile is provided as a convenience.
After installing the dependencies, run the following command.
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
deleted file mode 100644
index 7333e5a7e7..0000000000
--- a/runtime/autoload/dist/ft.vim
+++ /dev/null
@@ -1,1090 +0,0 @@
-" Vim functions for file type detection
-"
-" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Apr 13
-
-" These functions are moved here from runtime/filetype.vim to make startup
-" faster.
-
-" Line continuation is used here, remove 'C' from 'cpoptions'
-let s:cpo_save = &cpo
-set cpo&vim
-
-func dist#ft#Check_inp()
- if getline(1) =~ '^\*'
- setf abaqus
- else
- let n = 1
- if line("$") > 500
- let nmax = 500
- else
- let nmax = line("$")
- endif
- while n <= nmax
- if getline(n) =~? "^header surface data"
- setf trasys
- break
- endif
- let n = n + 1
- endwhile
- endif
-endfunc
-
-" This function checks for the kind of assembly that is wanted by the user, or
-" can be detected from the first five lines of the file.
-func dist#ft#FTasm()
- " make sure b:asmsyntax exists
- if !exists("b:asmsyntax")
- let b:asmsyntax = ""
- endif
-
- if b:asmsyntax == ""
- call dist#ft#FTasmsyntax()
- endif
-
- " if b:asmsyntax still isn't set, default to asmsyntax or GNU
- if b:asmsyntax == ""
- if exists("g:asmsyntax")
- let b:asmsyntax = g:asmsyntax
- else
- let b:asmsyntax = "asm"
- endif
- endif
-
- exe "setf " . fnameescape(b:asmsyntax)
-endfunc
-
-func dist#ft#FTasmsyntax()
- " see if file contains any asmsyntax=foo overrides. If so, change
- " b:asmsyntax appropriately
- let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4).
- \" ".getline(5)." "
- let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s')
- if match != ''
- let b:asmsyntax = match
- elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
- let b:asmsyntax = "vmasm"
- endif
-endfunc
-
-let s:ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
-
-" See FTfrm() for Visual Basic form file detection
-func dist#ft#FTbas()
- if exists("g:filetype_bas")
- exe "setf " . g:filetype_bas
- return
- endif
-
- " most frequent FreeBASIC-specific keywords in distro files
- let fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!'
- let fb_preproc = '\c^\s*\%(' ..
- \ '#\s*\a\+\|' ..
- \ 'option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\|' ..
- \ '\%(''\|rem\)\s*\$lang\>\|' ..
- \ 'def\%(byte\|longint\|short\|ubyte\|uint\|ulongint\|ushort\)\>' ..
- \ '\)'
- let fb_comment = "^\\s*/'"
- " OPTION EXPLICIT, without the leading underscore, is common to many dialects
- let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
-
- for lnum in range(1, min([line("$"), 100]))
- let line = getline(lnum)
- if line =~ s:ft_visual_basic_content
- setf vb
- return
- elseif line =~ fb_preproc || line =~ fb_comment || line =~ fb_keywords
- setf freebasic
- return
- elseif line =~ qb64_preproc
- setf qb64
- return
- endif
- endfor
- setf basic
-endfunc
-
-func dist#ft#FTbtm()
- if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm
- setf dosbatch
- else
- setf btm
- endif
-endfunc
-
-func dist#ft#BindzoneCheck(default)
- if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA'
- setf bindzone
- elseif a:default != ''
- exe 'setf ' . a:default
- endif
-endfunc
-
-" Returns true if file content looks like RAPID
-func IsRapid(sChkExt = "")
- if a:sChkExt == "cfg"
- return getline(1) =~? '\v^%(EIO|MMC|MOC|PROC|SIO|SYS):CFG'
- endif
- " called from FTmod, FTprg or FTsys
- return getline(nextnonblank(1)) =~? '\v^\s*%(\%{3}|module\s+\k+\s*%(\(|$))'
-endfunc
-
-func dist#ft#FTcfg()
- if exists("g:filetype_cfg")
- exe "setf " .. g:filetype_cfg
- elseif IsRapid("cfg")
- setf rapid
- else
- setf cfg
- endif
-endfunc
-
-func dist#ft#FTcls()
- if exists("g:filetype_cls")
- exe "setf " .. g:filetype_cls
- return
- endif
-
- if getline(1) =~ '^%'
- setf tex
- elseif getline(1)[0] == '#' && getline(1) =~ 'rexx'
- setf rexx
- elseif getline(1) == 'VERSION 1.0 CLASS'
- setf vb
- else
- setf st
- endif
-endfunc
-
-func dist#ft#FTlpc()
- if exists("g:lpc_syntax_for_c")
- let lnum = 1
- while lnum <= 12
- if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)'
- setf lpc
- return
- endif
- let lnum = lnum + 1
- endwhile
- endif
- setf c
-endfunc
-
-func dist#ft#FTheader()
- if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
- if exists("g:c_syntax_for_h")
- setf objc
- else
- setf objcpp
- endif
- elseif exists("g:c_syntax_for_h")
- setf c
- elseif exists("g:ch_syntax_for_h")
- setf ch
- else
- setf cpp
- endif
-endfunc
-
-" This function checks if one of the first ten lines start with a '@'. In
-" that case it is probably a change file.
-" If the first line starts with # or ! it's probably a ch file.
-" If a line has "main", "include", "//" or "/*" it's probably ch.
-" Otherwise CHILL is assumed.
-func dist#ft#FTchange()
- let lnum = 1
- while lnum <= 10
- if getline(lnum)[0] == '@'
- setf change
- return
- endif
- if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!')
- setf ch
- return
- endif
- if getline(lnum) =~ "MODULE"
- setf chill
- return
- endif
- if getline(lnum) =~ 'main\s*(\|#\s*include\|//'
- setf ch
- return
- endif
- let lnum = lnum + 1
- endwhile
- setf chill
-endfunc
-
-func dist#ft#FTent()
- " This function checks for valid cl syntax in the first five lines.
- " Look for either an opening comment, '#', or a block start, '{'.
- " If not found, assume SGML.
- let lnum = 1
- while lnum < 6
- let line = getline(lnum)
- if line =~ '^\s*[#{]'
- setf cl
- return
- elseif line !~ '^\s*$'
- " Not a blank line, not a comment, and not a block start,
- " so doesn't look like valid cl code.
- break
- endif
- let lnum = lnum + 1
- endw
- setf dtd
-endfunc
-
-func dist#ft#ExCheck()
- let lines = getline(1, min([line("$"), 100]))
- if exists('g:filetype_euphoria')
- exe 'setf ' . g:filetype_euphoria
- elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1
- setf euphoria3
- else
- setf elixir
- endif
-endfunc
-
-func dist#ft#EuphoriaCheck()
- if exists('g:filetype_euphoria')
- exe 'setf ' . g:filetype_euphoria
- else
- setf euphoria3
- endif
-endfunc
-
-func dist#ft#DtraceCheck()
- if did_filetype()
- " Filetype was already detected
- return
- endif
- let lines = getline(1, min([line("$"), 100]))
- if match(lines, '^module\>\|^import\>') > -1
- " D files often start with a module and/or import statement.
- setf d
- elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1
- setf dtrace
- else
- setf d
- endif
-endfunc
-
-func dist#ft#FTe()
- if exists('g:filetype_euphoria')
- exe 'setf ' . g:filetype_euphoria
- else
- let n = 1
- while n < 100 && n <= line("$")
- if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
- setf specman
- return
- endif
- let n = n + 1
- endwhile
- setf eiffel
- endif
-endfunc
-
-func dist#ft#FTfrm()
- if exists("g:filetype_frm")
- exe "setf " . g:filetype_frm
- return
- endif
-
- let lines = getline(1, min([line("$"), 5]))
-
- if match(lines, s:ft_visual_basic_content) > -1
- setf vb
- else
- setf form
- endif
-endfunc
-
-" Distinguish between Forth and F#.
-" Provided by Doug Kearns.
-func dist#ft#FTfs()
- if exists("g:filetype_fs")
- exe "setf " . g:filetype_fs
- else
- let line = getline(nextnonblank(1))
- " comments and colon definitions
- if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$'
- \ || line =~ '^\s*: \S'
- setf forth
- else
- setf fsharp
- endif
- endif
-endfunc
-
-" Distinguish between HTML, XHTML and Django
-func dist#ft#FThtml()
- let n = 1
- while n < 10 && n <= line("$")
- if getline(n) =~ '\<DTD\s\+XHTML\s'
- setf xhtml
- return
- endif
- if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+'
- setf htmldjango
- return
- endif
- let n = n + 1
- endwhile
- setf FALLBACK html
-endfunc
-
-" Distinguish between standard IDL and MS-IDL
-func dist#ft#FTidl()
- let n = 1
- while n < 50 && n <= line("$")
- if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
- setf msidl
- return
- endif
- let n = n + 1
- endwhile
- setf idl
-endfunc
-
-" Distinguish between "default", Prolog and Cproto prototype file. */
-func dist#ft#ProtoCheck(default)
- " Cproto files have a comment in the first line and a function prototype in
- " the second line, it always ends in ";". Indent files may also have
- " comments, thus we can't match comments to see the difference.
- " IDL files can have a single ';' in the second line, require at least one
- " chacter before the ';'.
- if getline(2) =~ '.;$'
- setf cpp
- else
- " recognize Prolog by specific text in the first non-empty line
- " require a blank after the '%' because Perl uses "%list" and "%translate"
- let l = getline(nextnonblank(1))
- if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
- setf prolog
- else
- exe 'setf ' .. a:default
- endif
- endif
-endfunc
-
-func dist#ft#FTm()
- if exists("g:filetype_m")
- exe "setf " . g:filetype_m
- return
- endif
-
- " excluding end(for|function|if|switch|while) common to Murphi
- let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
-
- let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>'
-
- let n = 1
- let saw_comment = 0 " Whether we've seen a multiline comment leader.
- while n < 100
- let line = getline(n)
- if line =~ '^\s*/\*'
- " /* ... */ is a comment in Objective C and Murphi, so we can't conclude
- " it's either of them yet, but track this as a hint in case we don't see
- " anything more definitive.
- let saw_comment = 1
- endif
- if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor
- setf objc
- return
- endif
- if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' ||
- \ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
- setf octave
- return
- endif
- " TODO: could be Matlab or Octave
- if line =~ '^\s*%'
- setf matlab
- return
- endif
- if line =~ '^\s*(\*'
- setf mma
- return
- endif
- if line =~ '^\c\s*\(\(type\|var\)\>\|--\)'
- setf murphi
- return
- endif
- let n = n + 1
- endwhile
-
- if saw_comment
- " We didn't see anything definitive, but this looks like either Objective C
- " or Murphi based on the comment leader. Assume the former as it is more
- " common.
- setf objc
- else
- " Default is Matlab
- setf matlab
- endif
-endfunc
-
-func dist#ft#FTmms()
- let n = 1
- while n < 20
- let line = getline(n)
- if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
- setf mmix
- return
- endif
- if line =~ '^\s*#'
- setf make
- return
- endif
- let n = n + 1
- endwhile
- setf mmix
-endfunc
-
-" This function checks if one of the first five lines start with a dot. In
-" that case it is probably an nroff file: 'filetype' is set and 1 is returned.
-func dist#ft#FTnroff()
- if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.'
- setf nroff
- return 1
- endif
- return 0
-endfunc
-
-func dist#ft#FTmm()
- let n = 1
- while n < 20
- let line = getline(n)
- if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
- setf objcpp
- return
- endif
- let n = n + 1
- endwhile
- setf nroff
-endfunc
-
-" Returns true if file content looks like LambdaProlog module
-func IsLProlog()
- " skip apparent comments and blank lines, what looks like
- " LambdaProlog comment may be RAPID header
- let l = nextnonblank(1)
- while l > 0 && l < line('$') && getline(l) =~ '^\s*%' " LambdaProlog comment
- let l = nextnonblank(l + 1)
- endwhile
- " this pattern must not catch a go.mod file
- return getline(l) =~ '\<module\s\+\w\+\s*\.\s*\(%\|$\)'
-endfunc
-
-" Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod
-func dist#ft#FTmod()
- if exists("g:filetype_mod")
- exe "setf " .. g:filetype_mod
- elseif IsLProlog()
- setf lprolog
- elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)'
- setf modula2
- elseif IsRapid()
- setf rapid
- elseif expand("<afile>") =~ '\<go.mod$'
- setf gomod
- else
- " Nothing recognized, assume modsim3
- setf modsim3
- endif
-endfunc
-
-func dist#ft#FTpl()
- if exists("g:filetype_pl")
- exe "setf " . g:filetype_pl
- else
- " recognize Prolog by specific text in the first non-empty line
- " require a blank after the '%' because Perl uses "%list" and "%translate"
- let l = getline(nextnonblank(1))
- if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
- setf prolog
- else
- setf perl
- endif
- endif
-endfunc
-
-func dist#ft#FTinc()
- if exists("g:filetype_inc")
- exe "setf " . g:filetype_inc
- else
- let lines = getline(1).getline(2).getline(3)
- if lines =~? "perlscript"
- setf aspperl
- elseif lines =~ "<%"
- setf aspvbs
- elseif lines =~ "<?"
- setf php
- " Pascal supports // comments but they're vary rarely used for file
- " headers so assume POV-Ray
- elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
- setf pascal
- elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
- setf bitbake
- else
- call dist#ft#FTasmsyntax()
- if exists("b:asmsyntax")
- exe "setf " . fnameescape(b:asmsyntax)
- else
- setf pov
- endif
- endif
- endif
-endfunc
-
-func dist#ft#FTprogress_cweb()
- if exists("g:filetype_w")
- exe "setf " . g:filetype_w
- return
- endif
- if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE'
- setf progress
- else
- setf cweb
- endif
-endfunc
-
-func dist#ft#FTprogress_asm()
- if exists("g:filetype_i")
- exe "setf " . g:filetype_i
- return
- endif
- " This function checks for an assembly comment the first ten lines.
- " If not found, assume Progress.
- let lnum = 1
- while lnum <= 10 && lnum < line('$')
- let line = getline(lnum)
- if line =~ '^\s*;' || line =~ '^\*'
- call dist#ft#FTasm()
- return
- elseif line !~ '^\s*$' || line =~ '^/\*'
- " Not an empty line: Doesn't look like valid assembly code.
- " Or it looks like a Progress /* comment
- break
- endif
- let lnum = lnum + 1
- endw
- setf progress
-endfunc
-
-let s:ft_pascal_comments = '^\s*\%({\|(\*\|//\)'
-let s:ft_pascal_keywords = '^\s*\%(program\|unit\|library\|uses\|begin\|procedure\|function\|const\|type\|var\)\>'
-
-func dist#ft#FTprogress_pascal()
- if exists("g:filetype_p")
- exe "setf " . g:filetype_p
- return
- endif
- " This function checks for valid Pascal syntax in the first ten lines.
- " Look for either an opening comment or a program start.
- " If not found, assume Progress.
- let lnum = 1
- while lnum <= 10 && lnum < line('$')
- let line = getline(lnum)
- if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
- setf pascal
- return
- elseif line !~ '^\s*$' || line =~ '^/\*'
- " Not an empty line: Doesn't look like valid Pascal code.
- " Or it looks like a Progress /* comment
- break
- endif
- let lnum = lnum + 1
- endw
- setf progress
-endfunc
-
-func dist#ft#FTpp()
- if exists("g:filetype_pp")
- exe "setf " . g:filetype_pp
- else
- let line = getline(nextnonblank(1))
- if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
- setf pascal
- else
- setf puppet
- endif
- endif
-endfunc
-
-" Determine if *.prg is ABB RAPID. Can also be Clipper, FoxPro or eviews
-func dist#ft#FTprg()
- if exists("g:filetype_prg")
- exe "setf " .. g:filetype_prg
- elseif IsRapid()
- setf rapid
- else
- " Nothing recognized, assume Clipper
- setf clipper
- endif
-endfunc
-
-func dist#ft#FTr()
- let max = line("$") > 50 ? 50 : line("$")
-
- for n in range(1, max)
- " Rebol is easy to recognize, check for that first
- if getline(n) =~? '\<REBOL\>'
- setf rebol
- return
- endif
- endfor
-
- for n in range(1, max)
- " R has # comments
- if getline(n) =~ '^\s*#'
- setf r
- return
- endif
- " Rexx has /* comments */
- if getline(n) =~ '^\s*/\*'
- setf rexx
- return
- endif
- endfor
-
- " Nothing recognized, use user default or assume Rexx
- if exists("g:filetype_r")
- exe "setf " . g:filetype_r
- else
- " Rexx used to be the default, but R appears to be much more popular.
- setf r
- endif
-endfunc
-
-func dist#ft#McSetf()
- " Rely on the file to start with a comment.
- " MS message text files use ';', Sendmail files use '#' or 'dnl'
- for lnum in range(1, min([line("$"), 20]))
- let line = getline(lnum)
- if line =~ '^\s*\(#\|dnl\)'
- setf m4 " Sendmail .mc file
- return
- elseif line =~ '^\s*;'
- setf msmessages " MS Message text file
- return
- endif
- endfor
- setf m4 " Default: Sendmail .mc file
-endfunc
-
-" Called from filetype.vim and scripts.vim.
-func dist#ft#SetFileTypeSH(name)
- if did_filetype()
- " Filetype was already detected
- return
- endif
- if expand("<amatch>") =~ g:ft_ignore_pat
- return
- endif
- if a:name =~ '\<csh\>'
- " Some .sh scripts contain #!/bin/csh.
- call dist#ft#SetFileTypeShell("csh")
- return
- elseif a:name =~ '\<tcsh\>'
- " Some .sh scripts contain #!/bin/tcsh.
- call dist#ft#SetFileTypeShell("tcsh")
- return
- elseif a:name =~ '\<zsh\>'
- " Some .sh scripts contain #!/bin/zsh.
- call dist#ft#SetFileTypeShell("zsh")
- return
- elseif a:name =~ '\<ksh\>'
- let b:is_kornshell = 1
- if exists("b:is_bash")
- unlet b:is_bash
- endif
- if exists("b:is_sh")
- unlet b:is_sh
- endif
- elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>'
- let b:is_bash = 1
- if exists("b:is_kornshell")
- unlet b:is_kornshell
- endif
- if exists("b:is_sh")
- unlet b:is_sh
- endif
- elseif a:name =~ '\<sh\>'
- let b:is_sh = 1
- if exists("b:is_kornshell")
- unlet b:is_kornshell
- endif
- if exists("b:is_bash")
- unlet b:is_bash
- endif
- endif
- call dist#ft#SetFileTypeShell("sh")
-endfunc
-
-" For shell-like file types, check for an "exec" command hidden in a comment,
-" as used for Tcl.
-" Also called from scripts.vim, thus can't be local to this script.
-func dist#ft#SetFileTypeShell(name)
- if did_filetype()
- " Filetype was already detected
- return
- endif
- if expand("<amatch>") =~ g:ft_ignore_pat
- return
- endif
- let l = 2
- while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)'
- " Skip empty and comment lines.
- let l = l + 1
- endwhile
- if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$'
- " Found an "exec" line after a comment with continuation
- let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '')
- if n =~ '\<tclsh\|\<wish'
- setf tcl
- return
- endif
- endif
- exe "setf " . a:name
-endfunc
-
-func dist#ft#CSH()
- if did_filetype()
- " Filetype was already detected
- return
- endif
- if exists("g:filetype_csh")
- call dist#ft#SetFileTypeShell(g:filetype_csh)
- elseif &shell =~ "tcsh"
- call dist#ft#SetFileTypeShell("tcsh")
- else
- call dist#ft#SetFileTypeShell("csh")
- endif
-endfunc
-
-let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*'
-func dist#ft#FTRules()
- let path = expand('<amatch>:p')
- if path =~ '/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|\%(usr/\)\=lib/udev/\%(rules\.d/\)\=.*\.rules\)$'
- setf udevrules
- return
- endif
- if path =~ '^/etc/ufw/'
- setf conf " Better than hog
- return
- endif
- if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
- setf javascript
- return
- endif
- try
- let config_lines = readfile('/etc/udev/udev.conf')
- catch /^Vim\%((\a\+)\)\=:E484/
- setf hog
- return
- endtry
- let dir = expand('<amatch>:p:h')
- for line in config_lines
- if line =~ s:ft_rules_udev_rules_pattern
- let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "")
- if dir == udev_rules
- setf udevrules
- endif
- break
- endif
- endfor
- setf hog
-endfunc
-
-func dist#ft#SQL()
- if exists("g:filetype_sql")
- exe "setf " . g:filetype_sql
- else
- setf sql
- endif
-endfunc
-
-" This function checks the first 25 lines of file extension "sc" to resolve
-" detection between scala and SuperCollider
-func dist#ft#FTsc()
- for lnum in range(1, min([line("$"), 25]))
- if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s'
- setf supercollider
- return
- endif
- endfor
- setf scala
-endfunc
-
-" This function checks the first line of file extension "scd" to resolve
-" detection between scdoc and SuperCollider
-func dist#ft#FTscd()
- if getline(1) =~# '\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$'
- setf scdoc
- else
- setf supercollider
- endif
-endfunc
-
-" If the file has an extension of 't' and is in a directory 't' or 'xt' then
-" it is almost certainly a Perl test file.
-" If the first line starts with '#' and contains 'perl' it's probably a Perl
-" file.
-" (Slow test) If a file contains a 'use' statement then it is almost certainly
-" a Perl file.
-func dist#ft#FTperl()
- let dirname = expand("%:p:h:t")
- if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt')
- setf perl
- return 1
- endif
- if getline(1)[0] == '#' && getline(1) =~ 'perl'
- setf perl
- return 1
- endif
- let save_cursor = getpos('.')
- call cursor(1,1)
- let has_use = search('^use\s\s*\k', 'c', 30) > 0
- call setpos('.', save_cursor)
- if has_use
- setf perl
- return 1
- endif
- return 0
-endfunc
-
-" LambdaProlog and Standard ML signature files
-func dist#ft#FTsig()
- if exists("g:filetype_sig")
- exe "setf " .. g:filetype_sig
- return
- endif
-
- let lprolog_comment = '^\s*\%(/\*\|%\)'
- let lprolog_keyword = '^\s*sig\s\+\a'
- let sml_comment = '^\s*(\*'
- let sml_keyword = '^\s*\%(signature\|structure\)\s\+\a'
-
- let line = getline(nextnonblank(1))
-
- if line =~ lprolog_comment || line =~# lprolog_keyword
- setf lprolog
- elseif line =~ sml_comment || line =~# sml_keyword
- setf sml
- endif
-endfunc
-
-" This function checks the first 100 lines of files matching "*.sil" to
-" resolve detection between Swift Intermediate Language and SILE.
-func dist#ft#FTsil()
- for lnum in range(1, [line('$'), 100]->min())
- let line = getline(lnum)
- if line =~ '^\s*[\\%]'
- setf sile
- return
- elseif line =~ '^\s*\S'
- setf sil
- return
- endif
- endfor
- " no clue, default to "sil"
- setf sil
-endfunc
-
-func dist#ft#FTsys()
- if exists("g:filetype_sys")
- exe "setf " .. g:filetype_sys
- elseif IsRapid()
- setf rapid
- else
- setf bat
- endif
-endfunc
-
-" Choose context, plaintex, or tex (LaTeX) based on these rules:
-" 1. Check the first line of the file for "%&<format>".
-" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
-" 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc.
-func dist#ft#FTtex()
- let firstline = getline(1)
- if firstline =~ '^%&\s*\a\+'
- let format = tolower(matchstr(firstline, '\a\+'))
- let format = substitute(format, 'pdf', '', '')
- if format == 'tex'
- let format = 'latex'
- elseif format == 'plaintex'
- let format = 'plain'
- endif
- elseif expand('%') =~ 'tex/context/.*/.*.tex'
- let format = 'context'
- else
- " Default value, may be changed later:
- let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
- " Save position, go to the top of the file, find first non-comment line.
- let save_cursor = getpos('.')
- call cursor(1,1)
- let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
- if firstNC > 0
- " Check the next thousand lines for a LaTeX or ConTeXt keyword.
- let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
- let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
- let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
- \ 'cnp', firstNC + 1000)
- if kwline == 1 " lpat matched
- let format = 'latex'
- elseif kwline == 2 " cpat matched
- let format = 'context'
- endif " If neither matched, keep default set above.
- " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000)
- " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000)
- " if cline > 0
- " let format = 'context'
- " endif
- " if lline > 0 && (cline == 0 || cline > lline)
- " let format = 'tex'
- " endif
- endif " firstNC
- call setpos('.', save_cursor)
- endif " firstline =~ '^%&\s*\a\+'
-
- " Translation from formats to file types. TODO: add AMSTeX, RevTex, others?
- if format == 'plain'
- setf plaintex
- elseif format == 'context'
- setf context
- else " probably LaTeX
- setf tex
- endif
- return
-endfunc
-
-func dist#ft#FTxml()
- let n = 1
- while n < 100 && n <= line("$")
- let line = getline(n)
- " DocBook 4 or DocBook 5.
- let is_docbook4 = line =~ '<!DOCTYPE.*DocBook'
- let is_docbook5 = line =~ ' xmlns="http://docbook.org/ns/docbook"'
- if is_docbook4 || is_docbook5
- let b:docbk_type = "xml"
- if is_docbook5
- let b:docbk_ver = 5
- else
- let b:docbk_ver = 4
- endif
- setf docbk
- return
- endif
- if line =~ 'xmlns:xbl="http://www.mozilla.org/xbl"'
- setf xbl
- return
- endif
- let n += 1
- endwhile
- setf xml
-endfunc
-
-func dist#ft#FTy()
- let n = 1
- while n < 100 && n <= line("$")
- let line = getline(n)
- if line =~ '^\s*%'
- setf yacc
- return
- endif
- if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include'
- setf racc
- return
- endif
- let n = n + 1
- endwhile
- setf yacc
-endfunc
-
-func dist#ft#Redif()
- let lnum = 1
- while lnum <= 5 && lnum < line('$')
- if getline(lnum) =~ "^\ctemplate-type:"
- setf redif
- return
- endif
- let lnum = lnum + 1
- endwhile
-endfunc
-
-" This function is called for all files under */debian/patches/*, make sure not
-" to non-dep3patch files, such as README and other text files.
-func dist#ft#Dep3patch()
- if expand('%:t') ==# 'series'
- return
- endif
-
- for ln in getline(1, 100)
- if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
- setf dep3patch
- return
- elseif ln =~# '^---'
- " end of headers found. stop processing
- return
- endif
- endfor
-endfunc
-
-" This function checks the first 15 lines for appearance of 'FoamFile'
-" and then 'object' in a following line.
-" In that case, it's probably an OpenFOAM file
-func dist#ft#FTfoam()
- let ffile = 0
- let lnum = 1
- while lnum <= 15
- if getline(lnum) =~# '^FoamFile'
- let ffile = 1
- elseif ffile == 1 && getline(lnum) =~# '^\s*object'
- setf foam
- return
- endif
- let lnum = lnum + 1
- endwhile
-endfunc
-
-" Determine if a *.tf file is TF mud client or terraform
-func dist#ft#FTtf()
- let numberOfLines = line('$')
- for i in range(1, numberOfLines)
- let currentLine = trim(getline(i))
- let firstCharacter = currentLine[0]
- if firstCharacter !=? ";" && firstCharacter !=? "/" && firstCharacter !=? ""
- setf terraform
- return
- endif
- endfor
- setf tf
-endfunc
-
-let s:ft_krl_header = '\&\w+'
-" Determine if a *.src file is Kuka Robot Language
-func dist#ft#FTsrc()
- let ft_krl_def_or_deffct = '%(global\s+)?def%(fct)?>'
- if exists("g:filetype_src")
- exe "setf " .. g:filetype_src
- elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_def_or_deffct .. ')'
- setf krl
- endif
-endfunc
-
-" Determine if a *.dat file is Kuka Robot Language
-func dist#ft#FTdat()
- let ft_krl_defdat = 'defdat>'
- if exists("g:filetype_dat")
- exe "setf " .. g:filetype_dat
- elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. s:ft_krl_header .. '|' .. ft_krl_defdat .. ')'
- setf krl
- endif
-endfunc
-
-" Restore 'cpoptions'
-let &cpo = s:cpo_save
-unlet s:cpo_save
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index ef0282848f..24d2cfc460 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1751,8 +1751,10 @@ fun! s:NetrwOptionsRestore(vt)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
if !exists("{a:vt}netrw_optionsave")
" call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("<slnum>"))
-" call Decho("..doing filetype detect anyway")
- filetype detect
+ if !isdirectory(expand('%'))
+" call Decho("..doing filetype detect anyway")
+ filetype detect
+ endif
" call Decho("..settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
" call Decho("..ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
" call Dret("s:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist")
@@ -1859,9 +1861,11 @@ fun! s:NetrwOptionsRestore(vt)
" were having their filetype detect-generated settings overwritten by
" NetrwOptionRestore.
if &ft != "netrw"
-" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
- filetype detect
-" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
+ if !isdirectory(expand('%'))
+" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
+ filetype detect
+" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("<slnum>"))
+ endif
endif
" call Decho("(s:NetrwOptionsRestore) lines=".&lines)
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index ac54a6b6ca..9952ef6415 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -175,15 +175,13 @@ This means that the contents of compressed files are not inspected.
*new-filetype*
If a file type that you want to use is not detected yet, there are a few ways
-to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.lua
-or $VIMRUNTIME/filetype.vim files. They will be overwritten when installing a
-new version of Nvim. The following explains the legacy Vim mechanism (enabled
-if |g:do_legacy_filetype| is set). For Nvim's default mechanism, see
-|vim.filetype.add()|.
+to add it. The recommended way is to use |vim.filetype.add()| to add it to
+Nvim's builtin filetype detection mechanism. If you want to handle the
+detection manually, proceed as follows:
A. If you want to overrule all default file type checks.
This works by writing one file for each filetype. The disadvantage is that
- there can be many files. The advantage is that you can simply drop this
+ there can be many files. The advantage is that you can simply drop this
file in the right directory to make it work.
*ftdetect*
1. Create your user runtime directory. You would normally use the first
@@ -273,28 +271,14 @@ D. If your filetype can only be detected by inspecting the contents of the
means that your rules override the default rules in
$VIMRUNTIME/scripts.vim.
- *remove-filetype*
-If a file type is detected that is wrong for you, install a filetype.lua,
-filetype.vim or scripts.vim to catch it (see above). You can set 'filetype' to
-a non-existing name to avoid that it will be set later anyway: >
- :set filetype=ignored
-
-If you are setting up a system with many users, and you don't want each user
-to add/remove the same filetypes, consider writing the filetype.vim and
-scripts.vim files in a runtime directory that is used for everybody. Check
-the 'runtimepath' for a directory to use. If there isn't one, set
-'runtimepath' in the |system-vimrc|. Be careful to keep the default
-directories!
-
- *g:do_legacy_filetype*
-To disable Nvim's default filetype detection and revert to Vim's legacy
-filetype detection, add the following to your |init.vim|: >
- let g:do_legacy_filetype = 1
-< *g:did_load_filetypes*
+ *remove-filetype*
+If a file type is detected that is wrong for you, you can set 'filetype' to
+a non-existing name such as `ignored` to avoid that it will be set later anyway.
+
+ *g:did_load_filetypes*
The builtin filetype detection provided by Nvim can be disabled by setting
-the `did_load_filetypes` global variable. If this variable exists, neither
-the default `$VIMRUNTIME/filetype.lua` nor the legacy `$VIMRUNTIME/filetype.vim`
-will run.
+the `did_load_filetypes` global variable. If this variable exists, the default
+`$VIMRUNTIME/filetype.lua` will not run.
*plugin-details*
The "plugin" directory can be in any of the directories in the 'runtimepath'
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 21bee24171..88b1aa4055 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -179,6 +179,7 @@ Versions ~
|deprecated.txt| Deprecated items that have been or will be removed
Other ~
+|news.txt| News and notable changes in the latest release
|terminal_emulator.txt| Terminal buffers
|term.txt| Terminal UI
|ui.txt| Nvim UI protocol
@@ -187,6 +188,7 @@ Other ~
|job_control.txt| Spawn and control multiple processes
|luaref.txt| Lua reference manual
|luvref.txt| Luv (|vim.loop|) reference manual
+|support.txt| Supported platforms
*standard-plugin-list*
Standard plugins ~
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 5473c7566c..2b86300e7f 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -978,9 +978,12 @@ indentation: >
PYTHON *ft-python-indent*
-The amount of indent can be set for the following situations. The examples
-given are the defaults. Note that the dictionary values are set to an
-expression, so that you can change the value of 'shiftwidth' later.
+The amount of indent can be set with the `g:python_indent` |Dictionary|, which
+needs to be created before adding the items: >
+ let g:python_indent = {}
+The examples given are the defaults. Note that the dictionary values are set
+to an expression, so that you can change the value of 'shiftwidth' later
+without having to update these values.
Indent after an open paren: >
let g:python_indent.open_paren = 'shiftwidth() * 2'
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 7330453778..ce16c208cd 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2045,9 +2045,6 @@ add({filetypes}) *vim.filetype.add()*
See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
- Note that Lua filetype detection is disabled when |g:do_legacy_filetype|
- is set.
-
Example: >
vim.filetype.add({
@@ -2084,7 +2081,7 @@ add({filetypes}) *vim.filetype.add()*
})
<
- To add a fallback match on contents (see |new-filetype-scripts|), use >
+ To add a fallback match on contents, use >
vim.filetype.add {
pattern = {
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 41d47f7a90..1dc9adcab1 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -13,7 +13,7 @@ BREAKING CHANGES *news-breaking*
The following changes may require adaptations in user config or plugins.
-Cscope is now removed (see |cscope| and |nvim-features-removed|):
+• Cscope is now removed (see |cscope| and |nvim-features-removed|):
- Commands removed:
- `:cscope`
- `:lcscope`
@@ -30,9 +30,9 @@ Cscope is now removed (see |cscope| and |nvim-features-removed|):
- Eval functions removed:
- `cscope_connection()`
-Note: support for |ctags| remains with no plans to remove.
+ Note: support for |ctags| remains with no plans to remove.
-See https://github.com/neovim/neovim/pull/20545 for more information.
+ See https://github.com/neovim/neovim/pull/20545 for more information.
==============================================================================
NEW FEATURES *news-features*
@@ -49,6 +49,11 @@ REMOVED FEATURES *news-removed*
The following deprecated functions or APIs were removed.
+• `filetype.vim` is removed in favor of |lua-filetype|
+ (Note that filetype logic and tests still align with Vim, so additions or
+ changes need to be contributed there first.)
+ See https://github.com/neovim/neovim/pull/20674.
+
==============================================================================
DEPRECATIONS *news-deprecations*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a846f49781..5a828ba249 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3352,7 +3352,7 @@ A jump table for the options with a short description can be found at |Q_op|.
in Insert mode as specified with the 'indentkeys' option.
When this option is not empty, it overrules the 'cindent' and
'smartindent' indenting. When 'lisp' is set, this option is
- overridden by the Lisp indentation algorithm.
+ is only used when 'lispoptions' contains "expr:1".
When 'paste' is set this option is not used for indenting.
The expression is evaluated with |v:lnum| set to the line number for
which the indent is to be computed. The cursor is also in this line
@@ -3719,6 +3719,17 @@ A jump table for the options with a short description can be found at |Q_op|.
calling an external program if 'equalprg' is empty.
This option is not used when 'paste' is set.
+ *'lispoptions'* *'lop'*
+'lispoptions' 'lop' string (default "")
+ local to buffer
+ Comma-separated list of items that influence the Lisp indenting when
+ enabled with the |'lisp'| option. Currently only one item is
+ supported:
+ expr:1 use 'indentexpr' for Lisp indenting when it is set
+ expr:0 do not use 'indentexpr' for Lisp indenting (default)
+ Note that when using 'indentexpr' the `=` operator indents all the
+ lines, otherwise the first line is not indented (Vi-compatible).
+
*'lispwords'* *'lw'*
'lispwords' 'lw' string (default is very long)
global or local to buffer |global-local|
@@ -4901,8 +4912,7 @@ A jump table for the options with a short description can be found at |Q_op|.
$XDG_CONFIG_HOME/nvim/after")
global
List of directories to be searched for these runtime files:
- filetype.vim filetypes by file name |new-filetype|
- scripts.vim filetypes by file contents |new-filetype-scripts|
+ filetype.lua filetypes |new-filetype|
autoload/ automatically loaded scripts |autoload-functions|
colors/ color scheme files |:colorscheme|
compiler/ compiler files |:compiler|
@@ -5938,7 +5948,7 @@ A jump table for the options with a short description can be found at |Q_op|.
For the "screen" and "topline" values, the cursor position will be
changed when necessary. In this case, the jumplist will be populated
with the previous cursor position. For "screen", the text cannot always
- be kept on the same screen line when 'wrap' is enabled.
+ be kept on the same screen line when 'wrap' is enabled.
*'splitright'* *'spr'* *'nosplitright'* *'nospr'*
'splitright' 'spr' boolean (default off)
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index f1261b18ff..f1294a18ba 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -772,6 +772,7 @@ Short explanation of each option: *option-list*
'lines' number of lines in the display
'linespace' 'lsp' number of pixel lines to use between characters
'lisp' automatic indenting for Lisp
+'lispoptions' 'lop' changes how Lisp indenting is done
'lispwords' 'lw' words that change how lisp indenting works
'list' show <Tab> and <EOL>
'listchars' 'lcs' characters for displaying in list mode
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 21945dc499..6a1b8b05a7 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -289,7 +289,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
how this can be useful.
This is normally done automatically during startup,
- after loading your .vimrc file. With this command it
+ after loading your |vimrc| file. With this command it
can be done earlier.
Packages will be loaded only once. Using
@@ -540,6 +540,11 @@ You would now have these files under ~/.local/share/nvim/site:
On startup after processing your |config|, Nvim scans all directories in
'packpath' for plugins in "pack/*/start/*", then loads the plugins.
+To allow for calling into package functionality while parsing your |vimrc|,
+|:colorscheme| and |autoload| will both automatically search under 'packpath'
+as well in addition to 'runtimepath'. See the documentation for each for
+details.
+
In the example Nvim will find "pack/foo/start/foobar/plugin/foo.vim" and load
it.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index baa60f431f..e45df9eb73 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -458,7 +458,7 @@ accordingly, proceeding as follows:
7. Enable filetype detection.
This does the same as the command: >
- :runtime! filetype.lua filetype.vim
+ :runtime! filetype.lua
< Skipped if ":filetype off" was called or if the "-u NONE" command line
argument was given.
diff --git a/runtime/doc/support.txt b/runtime/doc/support.txt
new file mode 100644
index 0000000000..82e20c7b9f
--- /dev/null
+++ b/runtime/doc/support.txt
@@ -0,0 +1,52 @@
+*support.txt* Nvim
+
+
+ NVIM REFERENCE MANUAL
+
+
+Support
+
+ Type |gO| to see the table of contents.
+
+==============================================================================
+Supported platforms *supported-platforms*
+
+`System` `Tier` `Versions` `Tested versions`
+Linux 1 >= 2.6.32, glibc >= 2.12 Ubuntu 20.04
+macOS (Intel) 1 >= 10.15 macOS 11
+Windows 64-bit 1 >= 8 Windows Server 2019
+FreeBSD 1 >= 10 FreeBSD 13
+macOS (M1) 2 >= 10.15
+OpenBSD 2 >= 7
+MinGW 2 MinGW-w64
+
+Support types ~
+
+* Tier 1: Officially supported and tested with CI. Any contributed patch
+ MUST NOT break such systems.
+
+* Tier 2: Officially supported, but not necessarily tested with CI. These
+ systems are maintained to the best of our ability, without being a top
+ priority.
+
+* Tier 3: Not tested and no guarantees, but may work.
+
+Adding support for a new platform ~
+
+IMPORTANT: Before attempting to add support for a new platform please open
+an issue about it for discussion.
+
+
+==============================================================================
+Common
+
+Some common notes when adding support for new platforms:
+
+Cmake is the only supported build system. The platform must be buildable with cmake.
+
+All functionality related to the new platform must be implemented in its own
+file inside `src/nvim/os` unless it's already done in a common file, in which
+case adding an `#ifdef` is fine.
+
+
+ vim:tw=78:ts=8:et:ft=help:norl:
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index f9ca919ddb..48301f3083 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -2986,16 +2986,25 @@ satisfied with it for my own projects.
SED *sed.vim* *ft-sed-syntax*
To make tabs stand out from regular blanks (accomplished by using Todo
-highlighting on the tabs), define "highlight_sedtabs" by putting >
-
- :let highlight_sedtabs = 1
+highlighting on the tabs), define "g:sed_highlight_tabs" by putting >
+ :let g:sed_highlight_tabs = 1
+<
in the vimrc file. (This special highlighting only applies for tabs
inside search patterns, replacement texts, addresses or text included
by an Append/Change/Insert command.) If you enable this option, it is
also a good idea to set the tab width to one character; by doing that,
you can easily count the number of tabs in a string.
+GNU sed allows comments after text on the same line. BSD sed only allows
+comments where "#" is the first character of the line. To enforce BSD-style
+comments, i.e. mark end-of-line comments as errors, use: >
+
+ :let g:sed_dialect = "bsd"
+<
+Note that there are other differences between GNU sed and BSD sed which are
+not (yet) affected by this setting.
+
Bugs:
The transform command (y) is treated exactly like the substitute
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index 5462fa952c..641c95b06e 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -388,6 +388,10 @@ file should then define the function like this: >
echo "Done!"
endfunction
+If the file doesn't exist, Vim will also search in 'packpath' (under "start")
+to allow calling packages' functions from your |vimrc| when the packages have
+not been added to 'runtimepath' yet (see |packages|).
+
The file name and the name used before the # in the function must match
exactly, and the defined function must have the name exactly as it will be
called.
diff --git a/runtime/filetype.lua b/runtime/filetype.lua
index ee9d5a0a75..f772785d21 100644
--- a/runtime/filetype.lua
+++ b/runtime/filetype.lua
@@ -1,5 +1,4 @@
--- Skip if legacy filetype is enabled or filetype detection is disabled
-if vim.g.do_legacy_filetype or vim.g.did_load_filetypes then
+if vim.g.did_load_filetypes then
return
end
vim.g.did_load_filetypes = 1
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
deleted file mode 100644
index 8dfecfbdcc..0000000000
--- a/runtime/filetype.vim
+++ /dev/null
@@ -1,2676 +0,0 @@
-" Vim support file to detect file types
-"
-" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Sep 27
-
-" Only run this if enabled
-if !exists("do_legacy_filetype")
- finish
-endif
-
-" Listen very carefully, I will say this only once
-if exists("did_load_filetypes")
- finish
-endif
-let did_load_filetypes = 1
-
-" Line continuation is used here, remove 'C' from 'cpoptions'
-let s:cpo_save = &cpo
-set cpo&vim
-
-augroup filetypedetect
-
-" Ignored extensions
-if exists("*fnameescape")
-au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew,?\+.pacsave,?\+.pacnew
- \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
-au BufNewFile,BufRead *~
- \ let s:name = expand("<afile>") |
- \ let s:short = substitute(s:name, '\~$', '', '') |
- \ if s:name != s:short && s:short != "" |
- \ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
- \ endif |
- \ unlet! s:name s:short
-au BufNewFile,BufRead ?\+.in
- \ if expand("<afile>:t") != "configure.in" |
- \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) |
- \ endif
-elseif &verbose > 0
- echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()"
-endif
-
-" Pattern used to match file names which should not be inspected.
-" Currently finds compressed files.
-if !exists("g:ft_ignore_pat")
- let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
-endif
-
-" Function used for patterns that end in a star: don't set the filetype if the
-" file name matches ft_ignore_pat.
-" When using this, the entry should probably be further down below with the
-" other StarSetf() calls.
-func s:StarSetf(ft)
- if expand("<amatch>") !~ g:ft_ignore_pat
- exe 'setf ' . a:ft
- endif
-endfunc
-
-" Vim help file
-au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help
-
-" Abaqus or Trasys
-au BufNewFile,BufRead *.inp call dist#ft#Check_inp()
-
-" 8th (Firth-derivative)
-au BufNewFile,BufRead *.8th setf 8th
-
-" A-A-P recipe
-au BufNewFile,BufRead *.aap setf aap
-
-" A2ps printing utility
-au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps
-
-" ABAB/4
-au BufNewFile,BufRead *.abap setf abap
-
-" ABC music notation
-au BufNewFile,BufRead *.abc setf abc
-
-" ABEL
-au BufNewFile,BufRead *.abl setf abel
-
-" AceDB
-au BufNewFile,BufRead *.wrm setf acedb
-
-" Ada (83, 9X, 95)
-au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada
-au BufNewFile,BufRead *.gpr setf ada
-
-" AHDL
-au BufNewFile,BufRead *.tdf setf ahdl
-
-" AIDL
-au BufNewFile,BufRead *.aidl setf aidl
-
-" AMPL
-au BufNewFile,BufRead *.run setf ampl
-
-" Ant
-au BufNewFile,BufRead build.xml setf ant
-
-" Arduino
-au BufNewFile,BufRead *.ino,*.pde setf arduino
-
-" Apache config file
-au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf setf apache
-au BufNewFile,BufRead */etc/apache2/sites-*/*.com setf apache
-
-" XA65 MOS6510 cross assembler
-au BufNewFile,BufRead *.a65 setf a65
-
-" Applescript
-au BufNewFile,BufRead *.scpt setf applescript
-
-" Applix ELF
-au BufNewFile,BufRead *.am
- \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
-
-" ALSA configuration
-au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf
-
-" Arc Macro Language
-au BufNewFile,BufRead *.aml setf aml
-
-" APT config file
-au BufNewFile,BufRead apt.conf setf aptconf
-au BufNewFile,BufRead */.aptitude/config setf aptconf
-" more generic pattern far down
-
-" Arch Inventory file
-au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
-
-" ART*Enterprise (formerly ART-IM)
-au BufNewFile,BufRead *.art setf art
-
-" AsciiDoc
-au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc
-
-" ASN.1
-au BufNewFile,BufRead *.asn,*.asn1 setf asn
-
-" Active Server Pages (with Visual Basic Script)
-au BufNewFile,BufRead *.asa
- \ if exists("g:filetype_asa") |
- \ exe "setf " . g:filetype_asa |
- \ else |
- \ setf aspvbs |
- \ endif
-
-" Active Server Pages (with Perl or Visual Basic Script)
-au BufNewFile,BufRead *.asp
- \ if exists("g:filetype_asp") |
- \ exe "setf " . g:filetype_asp |
- \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
- \ setf aspperl |
- \ else |
- \ setf aspvbs |
- \ endif
-
-" Grub (must be before pattern *.lst)
-au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub
-
-" Maxima, see:
-" https://maxima.sourceforge.io/docs/manual/maxima_71.html#file_005ftype_005fmaxima
-" Must be before the pattern *.mac.
-" *.dem omitted - also used by gnuplot demos
-" *.mc omitted - used by dist#ft#McSetf()
-au BufNewFile,BufRead *.demo,*.dm{1,2,3,t},*.wxm,maxima-init.mac setf maxima
-
-" Assembly (all kinds)
-" *.lst is not pure assembly, it has two extra columns (address, byte codes)
-au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call dist#ft#FTasm()
-
-" Assembly - Macro (VAX)
-au BufNewFile,BufRead *.mar setf vmasm
-
-" Astro
-au BufNewFile,BufRead *.astro setf astro
-
-" Atlas
-au BufNewFile,BufRead *.atl,*.as setf atlas
-
-" Atom is based on XML
-au BufNewFile,BufRead *.atom setf xml
-
-" Autoit v3
-au BufNewFile,BufRead *.au3 setf autoit
-
-" Autohotkey
-au BufNewFile,BufRead *.ahk setf autohotkey
-
-" Automake
-au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake
-
-" Autotest .at files are actually m4
-au BufNewFile,BufRead *.at setf m4
-
-" Avenue
-au BufNewFile,BufRead *.ave setf ave
-
-" Awk
-au BufNewFile,BufRead *.awk,*.gawk setf awk
-
-" B
-au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
-
-" BASIC or Visual Basic
-au BufNewFile,BufRead *.bas call dist#ft#FTbas()
-au BufNewFile,BufRead *.bi,*.bm call dist#ft#FTbas()
-
-" Visual Basic Script (close to Visual Basic) or Visual Basic .NET
-au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb
-
-" IBasic file (similar to QBasic)
-au BufNewFile,BufRead *.iba,*.ibi setf ibasic
-
-" FreeBasic file (similar to QBasic)
-au BufNewFile,BufRead *.fb setf freebasic
-
-" Batch file for MSDOS. See dist#ft#FTsys for *.sys
-au BufNewFile,BufRead *.bat setf dosbatch
-" *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd.
-au BufNewFile,BufRead *.cmd
- \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
-" ABB RAPID or Batch file for MSDOS.
-au BufNewFile,BufRead *.sys\c call dist#ft#FTsys()
-
-" Batch file for 4DOS
-au BufNewFile,BufRead *.btm call dist#ft#FTbtm()
-
-" BC calculator
-au BufNewFile,BufRead *.bc setf bc
-
-" BDF font
-au BufNewFile,BufRead *.bdf setf bdf
-
-" Beancount
-au BufNewFile,BufRead *.beancount setf beancount
-
-" BibTeX bibliography database file
-au BufNewFile,BufRead *.bib setf bib
-
-" BibTeX Bibliography Style
-au BufNewFile,BufRead *.bst setf bst
-
-" Bicep
-au BufNewFile,BufRead *.bicep setf bicep
-
-" BIND configuration
-" sudoedit uses namedXXXX.conf
-au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key setf named
-
-" BIND zone
-au BufNewFile,BufRead named.root setf bindzone
-au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('')
-
-" Blank
-au BufNewFile,BufRead *.bl setf blank
-
-" Bitbake
-au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake
-
-" Blkid cache file
-au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
-
-" BSDL
-au BufNewFile,BufRead *.bsd,*.bsdl setf bsdl
-
-" Bazel (http://bazel.io)
-autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACE setf bzl
-if has("fname_case")
- " There is another check for BUILD further below.
- autocmd BufRead,BufNewFile *.BUILD,BUILD setf bzl
-endif
-
-" C or lpc
-au BufNewFile,BufRead *.c call dist#ft#FTlpc()
-au BufNewFile,BufRead *.lpc,*.ulpc setf lpc
-
-" Calendar
-au BufNewFile,BufRead calendar setf calendar
-
-" C#
-au BufNewFile,BufRead *.cs,*.csx setf cs
-
-" CSDL
-au BufNewFile,BufRead *.csdl setf csdl
-
-" Cabal
-au BufNewFile,BufRead *.cabal setf cabal
-
-" Cdrdao TOC
-au BufNewFile,BufRead *.toc setf cdrtoc
-
-" Cdrdao config
-au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf
-
-" Cfengine
-au BufNewFile,BufRead cfengine.conf setf cfengine
-
-" ChaiScript
-au BufRead,BufNewFile *.chai setf chaiscript
-
-" Chatito
-au BufNewFile,BufRead *.chatito setf chatito
-
-" Comshare Dimension Definition Language
-au BufNewFile,BufRead *.cdl setf cdl
-
-" Conary Recipe
-au BufNewFile,BufRead *.recipe setf conaryrecipe
-
-" Controllable Regex Mutilator
-au BufNewFile,BufRead *.crm setf crm
-
-" Cyn++
-au BufNewFile,BufRead *.cyn setf cynpp
-
-" Cynlib
-" .cc and .cpp files can be C++ or Cynlib.
-au BufNewFile,BufRead *.cc
- \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif
-au BufNewFile,BufRead *.cpp
- \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
-
-" C++
-au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp
-if has("fname_case")
- au BufNewFile,BufRead *.C,*.H setf cpp
-endif
-
-" .h files can be C, Ch C++, ObjC or ObjC++.
-" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is
-" detected automatically.
-au BufNewFile,BufRead *.h call dist#ft#FTheader()
-
-" Ch (CHscript)
-au BufNewFile,BufRead *.chf setf ch
-
-" TLH files are C++ headers generated by Visual C++'s #import from typelibs
-au BufNewFile,BufRead *.tlh setf cpp
-
-" Cascading Style Sheets
-au BufNewFile,BufRead *.css setf css
-
-" Century Term Command Scripts (*.cmd too)
-au BufNewFile,BufRead *.con setf cterm
-
-" Changelog
-au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch,*/debian/changelog
- \ setf debchangelog
-
-au BufNewFile,BufRead [cC]hange[lL]og
- \ if getline(1) =~ '; urgency='
- \| setf debchangelog
- \| else
- \| setf changelog
- \| endif
-
-au BufNewFile,BufRead NEWS
- \ if getline(1) =~ '; urgency='
- \| setf debchangelog
- \| endif
-
-" CHILL
-au BufNewFile,BufRead *..ch setf chill
-
-" Changes for WEB and CWEB or CHILL
-au BufNewFile,BufRead *.ch call dist#ft#FTchange()
-
-" ChordPro
-au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro
-
-" Clang-tidy
-au BufNewFile,BufRead .clang-tidy setf yaml
-
-" Clean
-au BufNewFile,BufRead *.dcl,*.icl setf clean
-
-" Clever
-au BufNewFile,BufRead *.eni setf cl
-
-" Clever or dtd
-au BufNewFile,BufRead *.ent call dist#ft#FTent()
-
-" Clipper, FoxPro, ABB RAPID or eviews
-au BufNewFile,BufRead *.prg\c call dist#ft#FTprg()
-
-" Clojure
-au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure
-
-" Cmake
-au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake
-
-" Cmusrc
-au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc
-au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc
-
-" Cobol
-au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol
-" cobol or zope form controller python script? (heuristic)
-au BufNewFile,BufRead *.cpy
- \ if getline(1) =~ '^##' |
- \ setf python |
- \ else |
- \ setf cobol |
- \ endif
-
-" Coco/R
-au BufNewFile,BufRead *.atg setf coco
-
-" Cold Fusion
-au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
-
-" Configure scripts
-au BufNewFile,BufRead configure.in,configure.ac setf config
-
-" Cooklang
-au BufNewFile,BufRead *.cook setf cook
-
-" CSV Files
-au BufNewFile,BufRead *.csv setf csv
-
-" CUDA Compute Unified Device Architecture
-au BufNewFile,BufRead *.cu,*.cuh setf cuda
-
-" Dockerfile; Podman uses the same syntax with name Containerfile
-" Also see Dockerfile.* below.
-au BufNewFile,BufRead Containerfile,Dockerfile,dockerfile,*.[dD]ockerfile setf dockerfile
-
-" WildPackets EtherPeek Decoder
-au BufNewFile,BufRead *.dcd setf dcd
-
-" Enlightenment configuration files
-au BufNewFile,BufRead *enlightenment/*.cfg setf c
-
-" Eterm
-au BufNewFile,BufRead *Eterm/*.cfg setf eterm
-
-" Elixir or Euphoria
-au BufNewFile,BufRead *.ex call dist#ft#ExCheck()
-
-" Elixir
-au BufRead,BufNewFile mix.lock,*.exs setf elixir
-au BufRead,BufNewFile *.eex,*.leex setf eelixir
-
-" Elvish
-au BufRead,BufNewFile *.elv setf elvish
-
-" Euphoria 3 or 4
-au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck()
-if has("fname_case")
- au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck()
-endif
-
-" Lynx config files
-au BufNewFile,BufRead lynx.cfg setf lynx
-
-" LyRiCs
-au BufNewFile,BufRead *.lrc setf lyrics
-
-" Modula-3 configuration language (must be before *.cfg and *makefile)
-au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
-au BufNewFile,BufRead m3makefile,m3overrides setf m3build
-
-" Quake
-au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
-au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
-
-" Quake C
-au BufNewFile,BufRead *.qc setf c
-
-" Configure files
-au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg()
-
-" Cucumber
-au BufNewFile,BufRead *.feature setf cucumber
-
-" Communicating Sequential Processes
-au BufNewFile,BufRead *.csp,*.fdr setf csp
-
-" CUPL logic description and simulation
-au BufNewFile,BufRead *.pld setf cupl
-au BufNewFile,BufRead *.si setf cuplsim
-
-" Dart
-au BufRead,BufNewfile *.dart,*.drt setf dart
-
-" Debian Control
-au BufNewFile,BufRead */debian/control setf debcontrol
-au BufNewFile,BufRead control
- \ if getline(1) =~ '^Source:'
- \| setf debcontrol
- \| endif
-
-" Debian Copyright
-au BufNewFile,BufRead */debian/copyright setf debcopyright
-au BufNewFile,BufRead copyright
- \ if getline(1) =~ '^Format:'
- \| setf debcopyright
- \| endif
-
-" Debian Sources.list
-au BufNewFile,BufRead */etc/apt/sources.list setf debsources
-au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources
-
-" Deny hosts
-au BufNewFile,BufRead denyhosts.conf setf denyhosts
-
-" dnsmasq(8) configuration files
-au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq
-
-" ROCKLinux package description
-au BufNewFile,BufRead *.desc setf desc
-
-" the D language or dtrace
-au BufNewFile,BufRead */dtrace/*.d setf dtrace
-au BufNewFile,BufRead *.d call dist#ft#DtraceCheck()
-
-" Desktop files
-au BufNewFile,BufRead *.desktop,*.directory setf desktop
-
-" Dict config
-au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
-
-" Dictd config
-au BufNewFile,BufRead dictd*.conf setf dictdconf
-
-" DEP3 formatted patch files
-au BufNewFile,BufRead */debian/patches/* call dist#ft#Dep3patch()
-
-" Diff files
-au BufNewFile,BufRead *.diff,*.rej setf diff
-au BufNewFile,BufRead *.patch
- \ if getline(1) =~# '^From [0-9a-f]\{40,\} Mon Sep 17 00:00:00 2001$' |
- \ setf gitsendemail |
- \ else |
- \ setf diff |
- \ endif
-
-" Dircolors
-au BufNewFile,BufRead .dir_colors,.dircolors,*/etc/DIR_COLORS setf dircolors
-
-" Diva (with Skill) or InstallShield
-au BufNewFile,BufRead *.rul
- \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' |
- \ setf ishd |
- \ else |
- \ setf diva |
- \ endif
-
-" DCL (Digital Command Language - vms) or DNS zone file
-au BufNewFile,BufRead *.com call dist#ft#BindzoneCheck('dcl')
-
-" DOT
-au BufNewFile,BufRead *.dot,*.gv setf dot
-
-" Dune
-au BufNewFile,BufRead jbuild,dune,dune-project,dune-workspace setf dune
-
-" Dylan - lid files
-au BufNewFile,BufRead *.lid setf dylanlid
-
-" Dylan - intr files (melange)
-au BufNewFile,BufRead *.intr setf dylanintr
-
-" Dylan
-au BufNewFile,BufRead *.dylan setf dylan
-
-" Microsoft Module Definition
-au BufNewFile,BufRead *.def setf def
-
-" Dracula
-au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula
-
-" Datascript
-au BufNewFile,BufRead *.ds setf datascript
-
-" dsl: DSSSL or Structurizr
-au BufNewFile,BufRead *.dsl
- \ if getline(1) =~ '^\s*<\!' |
- \ setf dsl |
- \ else |
- \ setf structurizr |
- \ endif
-
-" DTD (Document Type Definition for XML)
-au BufNewFile,BufRead *.dtd setf dtd
-
-" DTS/DSTI (device tree files)
-au BufNewFile,BufRead *.dts,*.dtsi setf dts
-
-" EDIF (*.edf,*.edif,*.edn,*.edo) or edn
-au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif
-au BufNewFile,BufRead *.edn
- \ if getline(1) =~ '^\s*(\s*edif\>' |
- \ setf edif |
- \ else |
- \ setf clojure |
- \ endif
-
-" EditorConfig (close enough to dosini)
-au BufNewFile,BufRead .editorconfig setf dosini
-
-" Embedix Component Description
-au BufNewFile,BufRead *.ecd setf ecd
-
-" Eiffel or Specman or Euphoria
-au BufNewFile,BufRead *.e,*.E call dist#ft#FTe()
-
-" Elinks configuration
-au BufNewFile,BufRead elinks.conf setf elinks
-
-" ERicsson LANGuage; Yaws is erlang too
-au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang
-
-" Elm
-au BufNewFile,BufRead *.elm setf elm
-
-" Elm Filter Rules file
-au BufNewFile,BufRead filter-rules setf elmfilt
-
-" ESMTP rc file
-au BufNewFile,BufRead *esmtprc setf esmtprc
-
-" ESQL-C
-au BufNewFile,BufRead *.ec,*.EC setf esqlc
-
-" Esterel
-au BufNewFile,BufRead *.strl setf esterel
-
-" Essbase script
-au BufNewFile,BufRead *.csc setf csc
-
-" Exim
-au BufNewFile,BufRead exim.conf setf exim
-
-" Expect
-au BufNewFile,BufRead *.exp setf expect
-
-" Exports
-au BufNewFile,BufRead exports setf exports
-
-" Falcon
-au BufNewFile,BufRead *.fal setf falcon
-
-" Fantom
-au BufNewFile,BufRead *.fan,*.fwt setf fan
-
-" Factor
-au BufNewFile,BufRead *.factor setf factor
-
-" Fennel
-autocmd BufRead,BufNewFile *.fnl setf fennel
-
-" Fetchmail RC file
-au BufNewFile,BufRead .fetchmailrc setf fetchmail
-
-" Fish shell
-au BufNewFile,BufRead *.fish setf fish
-
-" FlexWiki - disabled, because it has side effects when a .wiki file
-" is not actually FlexWiki
-"au BufNewFile,BufRead *.wiki setf flexwiki
-
-" Focus Executable
-au BufNewFile,BufRead *.fex,*.focexec setf focexec
-
-" Focus Master file (but not for auto.master)
-au BufNewFile,BufRead auto.master setf conf
-au BufNewFile,BufRead *.mas,*.master setf master
-
-" Forth
-au BufNewFile,BufRead *.ft,*.fth setf forth
-
-" Reva Forth
-au BufNewFile,BufRead *.frt setf reva
-
-" Fortran
-if has("fname_case")
- au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95,*.F03,*.F08 setf fortran
-endif
-au BufNewFile,BufRead *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95,*.f03,*.f08 setf fortran
-
-" Framescript
-au BufNewFile,BufRead *.fsl setf framescript
-
-" FStab
-au BufNewFile,BufRead fstab,mtab setf fstab
-
-" Fusion
-au BufRead,BufNewFile *.fusion setf fusion
-
-" F# or Forth
-au BufNewFile,BufRead *.fs call dist#ft#FTfs()
-
-" F#
-au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
-
-" GDB command files
-au BufNewFile,BufRead .gdbinit,gdbinit,.gdbearlyinit,gdbearlyinit,*.gdb setf gdb
-
-" GDMO
-au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
-
-" GDscript
-au BufNewFile,BufRead *.gd setf gdscript
-
-" Godot resource
-au BufRead,BufNewFile *.tscn,*.tres setf gdresource
-
-" Godot shader
-au BufRead,BufNewFile *.gdshader,*.shader setf gdshader
-
-" Gedcom
-au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
-
-" Gemtext
-au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
-
-" Gift (Moodle)
-autocmd BufRead,BufNewFile *.gift setf gift
-
-" Git
-au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
-au BufNewFile,BufRead NOTES_EDITMSG,EDIT_DESCRIPTION setf gitcommit
-au BufNewFile,BufRead *.git/config,.gitconfig,*/etc/gitconfig setf gitconfig
-au BufNewFile,BufRead */.config/git/config setf gitconfig
-au BufNewFile,BufRead *.git/config.worktree setf gitconfig
-au BufNewFile,BufRead *.git/worktrees/*/config.worktree setf gitconfig
-au BufNewFile,BufRead .gitmodules,*.git/modules/*/config setf gitconfig
-if !empty($XDG_CONFIG_HOME)
- au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig
- au BufNewFile,BufRead $XDG_CONFIG_HOME/git/attributes setf gitattributes
- au BufNewFile,BufRead $XDG_CONFIG_HOME/git/ignore setf gitignore
-endif
-au BufNewFile,BufRead .gitattributes,*.git/info/attributes setf gitattributes
-au BufNewFile,BufRead */.config/git/attributes setf gitattributes
-au BufNewFile,BufRead */etc/gitattributes setf gitattributes
-au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore
-au BufNewFile,BufRead */.config/git/ignore setf gitignore
-au BufNewFile,BufRead git-rebase-todo setf gitrebase
-au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail
-au BufNewFile,BufRead *.git/*
- \ if getline(1) =~# '^\x\{40,\}\>\|^ref: ' |
- \ setf git |
- \ endif
-
-" Gkrellmrc
-au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
-
-" Gleam
-au BufNewFile,BufRead *.gleam setf gleam
-
-" GLSL
-au BufNewFile,BufRead *.glsl setf glsl
-
-" GP scripts (2.0 and onward)
-au BufNewFile,BufRead *.gp,.gprc setf gp
-
-" GPG
-au BufNewFile,BufRead */.gnupg/options setf gpg
-au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
-au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg
-if !empty($GNUPGHOME)
- au BufNewFile,BufRead $GNUPGHOME/options setf gpg
- au BufNewFile,BufRead $GNUPGHOME/gpg.conf setf gpg
-endif
-
-" gnash(1) configuration files
-au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
-
-" Gitolite
-au BufNewFile,BufRead gitolite.conf setf gitolite
-au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl
-
-" Glimmer-flavored TypeScript and JavaScript
-au BufNewFile,BufRead *.gts setf typescript.glimmer
-au BufNewFile,BufRead *.gjs setf javascript.glimmer
-
-" Gnuplot scripts
-au BufNewFile,BufRead *.gpi,.gnuplot setf gnuplot
-
-" Go (Google)
-au BufNewFile,BufRead *.go setf go
-au BufNewFile,BufRead Gopkg.lock setf toml
-au BufRead,BufNewFile go.work setf gowork
-
-" GrADS scripts
-au BufNewFile,BufRead *.gs setf grads
-
-" GraphQL
-au BufNewFile,BufRead *.graphql,*.graphqls,*.gql setf graphql
-
-" Gretl
-au BufNewFile,BufRead *.gretl setf gretl
-
-" Groovy
-au BufNewFile,BufRead *.gradle,*.groovy setf groovy
-
-" GNU Server Pages
-au BufNewFile,BufRead *.gsp setf gsp
-
-" Group file
-au BufNewFile,BufRead */etc/group,*/etc/group-,*/etc/group.edit,*/etc/gshadow,*/etc/gshadow-,*/etc/gshadow.edit,*/var/backups/group.bak,*/var/backups/gshadow.bak setf group
-
-" GTK RC
-au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
-
-" GYP
-au BufNewFile,BufRead *.gyp,*.gypi setf gyp
-
-" Hack
-au BufRead,BufNewFile *.hack,*.hackpartial setf hack
-
-" Haml
-au BufNewFile,BufRead *.haml setf haml
-
-" Hamster Classic | Playground files
-au BufNewFile,BufRead *.hsm setf hamster
-
-" Handlebars
-au BufNewFile,BufRead *.hbs setf handlebars
-
-" Hare
-au BufNewFile,BufRead *.ha setf hare
-
-" Haskell
-au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot,*.hsig setf haskell
-au BufNewFile,BufRead *.lhs setf lhaskell
-au BufNewFile,BufRead *.chs setf chaskell
-au BufNewFile,BufRead cabal.project setf cabalproject
-au BufNewFile,BufRead $HOME/.cabal/config setf cabalconfig
-au BufNewFile,BufRead cabal.config setf cabalconfig
-
-" Haste
-au BufNewFile,BufRead *.ht setf haste
-au BufNewFile,BufRead *.htpp setf hastepreproc
-
-" HCL
-au BufRead,BufNewFile *.hcl setf hcl
-
-" Hercules
-au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules
-
-" HEEx
-au BufRead,BufNewFile *.heex setf heex
-
-" HEX (Intel)
-au BufNewFile,BufRead *.hex,*.h32 setf hex
-
-" Hjson
-au BufNewFile,BufRead *.hjson setf hjson
-
-" HLS Playlist (or another form of playlist)
-au BufNewFile,BufRead *.m3u,*.m3u8 setf hlsplaylist
-
-" Hollywood
-au BufRead,BufNewFile *.hws setf hollywood
-
-" Hoon
-au BufRead,BufNewFile *.hoon setf hoon
-
-" Tilde (must be before HTML)
-au BufNewFile,BufRead *.t.html setf tilde
-
-" HTML (.shtml and .stm for server side)
-au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml()
-au BufNewFile,BufRead *.cshtml setf html
-
-" HTML with Ruby - eRuby
-au BufNewFile,BufRead *.erb,*.rhtml setf eruby
-
-" HTML with M4
-au BufNewFile,BufRead *.html.m4 setf htmlm4
-
-" Some template. Used to be HTML Cheetah.
-au BufNewFile,BufRead *.tmpl setf template
-
-" Host config
-au BufNewFile,BufRead */etc/host.conf setf hostconf
-
-" Hosts access
-au BufNewFile,BufRead */etc/hosts.allow,*/etc/hosts.deny setf hostsaccess
-
-" Hyper Builder
-au BufNewFile,BufRead *.hb setf hb
-
-" Httest
-au BufNewFile,BufRead *.htt,*.htb setf httest
-
-" i3
-au BufNewFile,BufRead */i3/config setf i3config
-au BufNewFile,BufRead */.i3/config setf i3config
-
-" sway
-au BufNewFile,BufRead */sway/config setf swayconfig
-au BufNewFile,BufRead */.sway/config setf swayconfig
-
-" Icon
-au BufNewFile,BufRead *.icn setf icon
-
-" IDL (Interface Description Language)
-au BufNewFile,BufRead *.idl call dist#ft#FTidl()
-
-" Microsoft IDL (Interface Description Language) Also *.idl
-" MOF = WMI (Windows Management Instrumentation) Managed Object Format
-au BufNewFile,BufRead *.odl,*.mof setf msidl
-
-" Icewm menu
-au BufNewFile,BufRead */.icewm/menu setf icemenu
-
-" Indent profile (must come before IDL *.pro!)
-au BufNewFile,BufRead .indent.pro setf indent
-au BufNewFile,BufRead indent.pro call dist#ft#ProtoCheck('indent')
-
-" IDL (Interactive Data Language)
-au BufNewFile,BufRead *.pro call dist#ft#ProtoCheck('idlang')
-
-" Indent RC
-au BufNewFile,BufRead indentrc setf indent
-
-" Inform
-au BufNewFile,BufRead *.inf,*.INF setf inform
-
-" Initng
-au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
-
-" Innovation Data Processing
-au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
-au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
-au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
-au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
-au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
-
-" Ipfilter
-au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter
-
-" Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
-au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
-
-" .INI file for MSDOS
-au BufNewFile,BufRead *.ini setf dosini
-
-" SysV Inittab
-au BufNewFile,BufRead inittab setf inittab
-
-" Inno Setup
-au BufNewFile,BufRead *.iss setf iss
-
-" J
-au BufNewFile,BufRead *.ijs setf j
-
-" JAL
-au BufNewFile,BufRead *.jal,*.JAL setf jal
-
-" Jam
-au BufNewFile,BufRead *.jpl,*.jpr setf jam
-
-" Java
-au BufNewFile,BufRead *.java,*.jav setf java
-
-" JavaCC
-au BufNewFile,BufRead *.jj,*.jjt setf javacc
-
-" JavaScript, ECMAScript, ES module script, CommonJS script
-au BufNewFile,BufRead *.js,*.jsm,*.javascript,*.es,*.mjs,*.cjs setf javascript
-
-" JavaScript with React
-au BufNewFile,BufRead *.jsx setf javascriptreact
-
-" Java Server Pages
-au BufNewFile,BufRead *.jsp setf jsp
-
-" Java Properties resource file (note: doesn't catch font.properties.pl)
-au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_?? setf jproperties
-
-" Jess
-au BufNewFile,BufRead *.clp setf jess
-
-" Jgraph
-au BufNewFile,BufRead *.jgr setf jgraph
-
-" Jovial
-au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
-
-" JSON
-au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
-
-" JSON5
-au BufNewFile,BufRead *.json5 setf json5
-
-" JSON Patch (RFC 6902)
-au BufNewFile,BufRead *.json-patch setf json
-
-" Jupyter Notebook is also json
-au BufNewFile,BufRead *.ipynb setf json
-
-" Other files that look like json
-au BufNewFile,BufRead .babelrc,.eslintrc,.prettierrc,.firebaserc setf json
-
-" JSONC
-au BufNewFile,BufRead *.jsonc setf jsonc
-
-" Jsonnet
-au BufNewFile,BufRead *.jsonnet,*.libjsonnet setf jsonnet
-
-" Julia
-au BufNewFile,BufRead *.jl setf julia
-
-" Kixtart
-au BufNewFile,BufRead *.kix setf kix
-
-" Kuka Robot Language
-au BufNewFile,BufRead *.src\c call dist#ft#FTsrc()
-au BufNewFile,BufRead *.dat\c call dist#ft#FTdat()
-au BufNewFile,BufRead *.sub\c setf krl
-
-" Kimwitu[++]
-au BufNewFile,BufRead *.k setf kwt
-
-" Kivy
-au BufNewFile,BufRead *.kv setf kivy
-
-" Kotlin
-au BufNewFile,BufRead *.kt,*.ktm,*.kts setf kotlin
-
-" KDE script
-au BufNewFile,BufRead *.ks setf kscript
-
-" Kconfig
-au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig
-
-" Lace (ISE)
-au BufNewFile,BufRead *.ace,*.ACE setf lace
-
-" Latexmkrc
-au BufNewFile,BufRead .latexmkrc,latexmkrc setf perl
-
-" Latte
-au BufNewFile,BufRead *.latte,*.lte setf latte
-
-" Limits
-au BufNewFile,BufRead */etc/limits,*/etc/*limits.conf,*/etc/*limits.d/*.conf setf limits
-
-" LambdaProlog or SML (see dist#ft#FTmod for *.mod)
-au BufNewFile,BufRead *.sig call dist#ft#FTsig()
-
-" LDAP LDIF
-au BufNewFile,BufRead *.ldif setf ldif
-
-" Ld loader
-au BufNewFile,BufRead *.ld setf ld
-
-" Ledger
-au BufRead,BufNewFile *.ldg,*.ledger,*.journal setf ledger
-
-" Less
-au BufNewFile,BufRead *.less setf less
-
-" Lex
-au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++ setf lex
-
-" Libao
-au BufNewFile,BufRead */etc/libao.conf,*/.libao setf libao
-
-" Libsensors
-au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors
-
-" LFTP
-au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
-
-" Lifelines (or Lex for C++!)
-au BufNewFile,BufRead *.ll setf lifelines
-
-" Lilo: Linux loader
-au BufNewFile,BufRead lilo.conf setf lilo
-
-" Lilypond
-au BufNewFile,BufRead *.ly,*.ily setf lilypond
-
-" Lisp (*.el = ELisp, *.cl = Common Lisp)
-" *.jl was removed, it's also used for Julia, better skip than guess wrong.
-if has("fname_case")
- au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,*.L,.emacs,.sawfishrc setf lisp
-else
- au BufNewFile,BufRead *.lsp,*.lisp,*.asd,*.el,*.cl,.emacs,.sawfishrc setf lisp
-endif
-
-" SBCL implementation of Common Lisp
-au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
-
-" Liquid
-au BufNewFile,BufRead *.liquid setf liquid
-
-" Lite
-au BufNewFile,BufRead *.lite,*.lt setf lite
-
-" LiteStep RC files
-au BufNewFile,BufRead */LiteStep/*/*.rc setf litestep
-
-" Login access
-au BufNewFile,BufRead */etc/login.access setf loginaccess
-
-" Login defs
-au BufNewFile,BufRead */etc/login.defs setf logindefs
-
-" Logtalk
-au BufNewFile,BufRead *.lgt setf logtalk
-
-" LOTOS
-au BufNewFile,BufRead *.lot,*.lotos setf lotos
-
-" Lout (also: *.lt)
-au BufNewFile,BufRead *.lou,*.lout setf lout
-
-" Lua
-au BufNewFile,BufRead *.lua setf lua
-
-" Luacheck
-au BufNewFile,BufRead .luacheckrc setf lua
-
-" Luarocks
-au BufNewFile,BufRead *.rockspec setf lua
-
-" Linden Scripting Language (Second Life)
-au BufNewFile,BufRead *.lsl setf lsl
-
-" Lynx style file (or LotusScript!)
-au BufNewFile,BufRead *.lss setf lss
-
-" M4
-au BufNewFile,BufRead *.m4
- \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif
-
-" MaGic Point
-au BufNewFile,BufRead *.mgp setf mgp
-
-" Mail (for Elm, trn, mutt, muttng, rn, slrn, neomutt)
-au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
-
-" Mail aliases
-au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases setf mailaliases
-
-" Mailcap configuration file
-au BufNewFile,BufRead .mailcap,mailcap setf mailcap
-
-" Makefile
-au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
-
-" MakeIndex
-au BufNewFile,BufRead *.ist,*.mst setf ist
-
-" Mallard
-au BufNewFile,BufRead *.page setf mallard
-
-" Manpage
-au BufNewFile,BufRead *.man setf nroff
-
-" Man config
-au BufNewFile,BufRead */etc/man.conf,man.config setf manconf
-
-" Maple V
-au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
-
-" Map (UMN mapserver config file)
-au BufNewFile,BufRead *.map setf map
-
-" Markdown
-au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
-
-" Mason
-au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
-
-" Mathematica, Matlab, Murphi, Objective C or Octave
-au BufNewFile,BufRead *.m call dist#ft#FTm()
-
-" Mathematica notebook
-au BufNewFile,BufRead *.nb setf mma
-
-" Maya Extension Language
-au BufNewFile,BufRead *.mel setf mel
-
-" Mercurial (hg) commit file
-au BufNewFile,BufRead hg-editor-*.txt setf hgcommit
-
-" Mercurial config (looks like generic config file)
-au BufNewFile,BufRead *.hgrc,*hgrc setf cfg
-
-" Meson Build system config
-au BufNewFile,BufRead meson.build,meson_options.txt setf meson
-au BufNewFile,BufRead *.wrap setf dosini
-
-" Messages (logs mostly)
-au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages
-
-" Metafont
-au BufNewFile,BufRead *.mf setf mf
-
-" MetaPost
-au BufNewFile,BufRead *.mp setf mp
-au BufNewFile,BufRead *.mpxl,*.mpiv,*.mpvi let b:mp_metafun = 1 | setf mp
-
-" MGL
-au BufNewFile,BufRead *.mgl setf mgl
-
-" MIX - Knuth assembly
-au BufNewFile,BufRead *.mix,*.mixal setf mix
-
-" MMIX or VMS makefile
-au BufNewFile,BufRead *.mms call dist#ft#FTmms()
-
-" Symbian meta-makefile definition (MMP)
-au BufNewFile,BufRead *.mmp setf mmp
-
-" ABB Rapid, Modula-2, Modsim III or LambdaProlog
-au BufNewFile,BufRead *.mod\c call dist#ft#FTmod()
-
-" Modula-2 (.md removed in favor of Markdown, see dist#ft#FTmod for *.MOD)
-au BufNewFile,BufRead *.m2,*.DEF,*.mi setf modula2
-
-" Modula-3 (.m3, .i3, .mg, .ig)
-au BufNewFile,BufRead *.[mi][3g] setf modula3
-
-" Monk
-au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
-
-" MOO
-au BufNewFile,BufRead *.moo setf moo
-
-" Moonscript
-au BufNewFile,BufRead *.moon setf moonscript
-
-" Modconf
-au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
-
-" MPD is based on XML
-au BufNewFile,BufRead *.mpd setf xml
-
-" Mplayer config
-au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf
-
-" Motorola S record
-au BufNewFile,BufRead *.s19,*.s28,*.s37,*.mot,*.srec setf srec
-
-" Mrxvtrc
-au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc
-
-" Msql
-au BufNewFile,BufRead *.msql setf msql
-
-" Mysql
-au BufNewFile,BufRead *.mysql setf mysql
-
-" Tcl Shell RC file
-au BufNewFile,BufRead tclsh.rc setf tcl
-
-" M$ Resource files
-" /etc/Muttrc.d/file.rc is muttrc
-au BufNewFile,BufRead *.rc,*.rch
- \ if expand("<afile>") !~ "/etc/Muttrc.d/" |
- \ setf rc |
- \ endif
-
-" MuPAD source
-au BufRead,BufNewFile *.mu setf mupad
-
-" Mush
-au BufNewFile,BufRead *.mush setf mush
-
-" Mutt setup file (also for Muttng)
-au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
-
-" N1QL
-au BufRead,BufNewfile *.n1ql,*.nql setf n1ql
-
-" Nano
-au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc
-
-" Nastran input/DMAP
-"au BufNewFile,BufRead *.dat setf nastran
-
-" Natural
-au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural
-
-" Noemutt setup file
-au BufNewFile,BufRead Neomuttrc setf neomuttrc
-
-" Netrc
-au BufNewFile,BufRead .netrc setf netrc
-
-" Nginx
-au BufNewFile,BufRead *.nginx,nginx*.conf,*nginx.conf,*/etc/nginx/*,*/usr/local/nginx/conf/*,*/nginx/*.conf setf nginx
-
-" Nim file
-au BufNewFile,BufRead *.nim,*.nims,*.nimble setf nim
-
-" Ninja file
-au BufNewFile,BufRead *.ninja setf ninja
-
-" Nix
-au BufRead,BufNewFile *.nix setf nix
-
-" NPM RC file
-au BufNewFile,BufRead npmrc,.npmrc setf dosini
-
-" Novell netware batch files
-au BufNewFile,BufRead *.ncf setf ncf
-
-" Nroff/Troff (*.ms and *.t are checked below)
-au BufNewFile,BufRead *.me
- \ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" |
- \ setf nroff |
- \ endif
-au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff
-au BufNewFile,BufRead *.[1-9] call dist#ft#FTnroff()
-
-" Nroff or Objective C++
-au BufNewFile,BufRead *.mm call dist#ft#FTmm()
-
-" Not Quite C
-au BufNewFile,BufRead *.nqc setf nqc
-
-" NSE - Nmap Script Engine - uses Lua syntax
-au BufNewFile,BufRead *.nse setf lua
-
-" NSIS
-au BufNewFile,BufRead *.nsi,*.nsh setf nsis
-
-" OCaml
-au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo setf ocaml
-
-" Occam
-au BufNewFile,BufRead *.occ setf occam
-
-" Octave
-au BufNewFile,BufRead octave.conf,.octaverc,octaverc setf octave
-
-" Omnimark
-au BufNewFile,BufRead *.xom,*.xin setf omnimark
-
-" OPAM
-au BufNewFile,BufRead opam,*.opam,*.opam.template setf opam
-
-" OpenFOAM
-au BufNewFile,BufRead [a-zA-Z0-9]*Dict\(.*\)\=,[a-zA-Z]*Properties\(.*\)\=,*Transport\(.*\),fvSchemes,fvSolution,fvConstrains,fvModels,*/constant/g,*/0\(\.orig\)\=/* call dist#ft#FTfoam()
-
-" OpenROAD
-au BufNewFile,BufRead *.or setf openroad
-
-" OPL
-au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
-
-" OpenSCAD
-au BufNewFile,BufRead *.scad setf openscad
-
-" Oracle config file
-au BufNewFile,BufRead *.ora setf ora
-
-" Org
-au BufNewFile,BufRead *.org,*.org_archive setf org
-
-" Packet filter conf
-au BufNewFile,BufRead pf.conf setf pf
-
-" ini style config files, using # comments
-au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini
-
-" Pacman hooks
-au BufNewFile,BufRead *.hook
- \ if getline(1) == '[Trigger]' |
- \ setf conf |
- \ endif
-
-" Pam conf
-au BufNewFile,BufRead */etc/pam.conf setf pamconf
-
-" Pam environment
-au BufNewFile,BufRead pam_env.conf,.pam_environment setf pamenv
-
-" PApp
-au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
-
-" Password file
-au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd
-
-" Pascal (also *.p, *.pp, *.inc)
-au BufNewFile,BufRead *.pas setf pascal
-
-" Pascal or Puppet manifest
-au BufNewFile,BufRead *.pp call dist#ft#FTpp()
-
-" Delphi or Lazarus program file
-au BufNewFile,BufRead *.dpr,*.lpr setf pascal
-
-" Free Pascal makefile definition file
-au BufNewFile,BufRead *.fpc setf fpcmake
-
-" Path of Exile item filter
-au BufNewFile,BufRead *.filter setf poefilter
-
-" PDF
-au BufNewFile,BufRead *.pdf setf pdf
-
-" PCMK - HAE - crm configure edit
-au BufNewFile,BufRead *.pcmk setf pcmk
-
-" Perl
-if has("fname_case")
- au BufNewFile,BufRead *.pl,*.PL call dist#ft#FTpl()
-else
- au BufNewFile,BufRead *.pl call dist#ft#FTpl()
-endif
-au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
-
-" Perl, XPM or XPM2
-au BufNewFile,BufRead *.pm
- \ if getline(1) =~ "XPM2" |
- \ setf xpm2 |
- \ elseif getline(1) =~ "XPM" |
- \ setf xpm |
- \ else |
- \ setf perl |
- \ endif
-
-" Perl POD
-au BufNewFile,BufRead *.pod setf pod
-
-" Php, php3, php4, etc.
-" Also Phtml (was used for PHP 2 in the past).
-" Also .ctp for Cake template file.
-" Also .phpt for php tests.
-" Also .theme for Drupal theme files.
-au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp,*.phpt,*.theme setf php
-
-" PHP config
-au BufNewFile,BufRead php.ini-* setf dosini
-
-" Pike and Cmod
-au BufNewFile,BufRead *.pike,*.pmod setf pike
-au BufNewFile,BufRead *.cmod setf cmod
-
-" Pinfo config
-au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo
-
-" Palm Resource compiler
-au BufNewFile,BufRead *.rcp setf pilrc
-
-" Pine config
-au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine
-
-" Pipenv Pipfiles
-au BufNewFile,BufRead Pipfile setf toml
-au BufNewFile,BufRead Pipfile.lock setf json
-
-" PL/1, PL/I
-au BufNewFile,BufRead *.pli,*.pl1 setf pli
-
-" PL/M (also: *.inp)
-au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm
-
-" PL/SQL
-au BufNewFile,BufRead *.pls,*.plsql setf plsql
-
-" PLP
-au BufNewFile,BufRead *.plp setf plp
-
-" PO and PO template (GNU gettext)
-au BufNewFile,BufRead *.po,*.pot setf po
-
-" Postfix main config
-au BufNewFile,BufRead main.cf setf pfmain
-
-" PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
-au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr
-
-" PostScript Printer Description
-au BufNewFile,BufRead *.ppd setf ppd
-
-" Povray
-au BufNewFile,BufRead *.pov setf pov
-
-" Povray configuration
-au BufNewFile,BufRead .povrayrc setf povini
-
-" Povray, Pascal, PHP or assembly
-au BufNewFile,BufRead *.inc call dist#ft#FTinc()
-
-" PowerShell
-au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc setf ps1
-au BufNewFile,BufRead *.ps1xml setf ps1xml
-au BufNewFile,BufRead *.cdxml,*.psc1 setf xml
-
-" Printcap and Termcap
-au BufNewFile,BufRead *printcap
- \ let b:ptcap_type = "print" | setf ptcap
-au BufNewFile,BufRead *termcap
- \ let b:ptcap_type = "term" | setf ptcap
-
-" Prisma
-au BufRead,BufNewFile *.prisma setf prisma
-
-" PCCTS / ANTLR
-"au BufNewFile,BufRead *.g setf antlr
-au BufNewFile,BufRead *.g setf pccts
-
-" PPWizard
-au BufNewFile,BufRead *.it,*.ih setf ppwiz
-
-" Pug
-au BufRead,BufNewFile *.pug setf pug
-
-" Puppet
-au BufNewFile,BufRead Puppetfile setf ruby
-
-" Embedded Puppet
-au BufNewFile,BufRead *.epp setf epuppet
-
-" Obj 3D file format
-" TODO: is there a way to avoid MS-Windows Object files?
-au BufNewFile,BufRead *.obj setf obj
-
-" Oracle Pro*C/C++
-au BufNewFile,BufRead *.pc setf proc
-
-" Privoxy actions file
-au BufNewFile,BufRead *.action setf privoxy
-
-" Procmail
-au BufNewFile,BufRead .procmail,.procmailrc setf procmail
-
-" Progress or CWEB
-au BufNewFile,BufRead *.w call dist#ft#FTprogress_cweb()
-
-" Progress or assembly
-au BufNewFile,BufRead *.i call dist#ft#FTprogress_asm()
-
-" Progress or Pascal
-au BufNewFile,BufRead *.p call dist#ft#FTprogress_pascal()
-
-" Software Distributor Product Specification File (POSIX 1387.2-1995)
-au BufNewFile,BufRead *.psf setf psf
-au BufNewFile,BufRead INDEX,INFO
- \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
- \ setf psf |
- \ endif
-
-" Prolog
-au BufNewFile,BufRead *.pdb setf prolog
-
-" Promela
-au BufNewFile,BufRead *.pml setf promela
-
-" Property Specification Language (PSL)
-au BufNewFile,BufRead *.psl setf psl
-
-" Google protocol buffers
-au BufNewFile,BufRead *.proto setf proto
-au BufNewFile,BufRead *.pbtxt setf pbtxt
-
-" Poke
-au BufNewFile,BufRead *.pk setf poke
-
-" Protocols
-au BufNewFile,BufRead */etc/protocols setf protocols
-
-" Pyret
-au BufNewFile,BufRead *.arr setf pyret
-
-" Pyrex
-au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
-
-" Python, Python Shell Startup and Python Stub Files
-" Quixote (Python-based web framework)
-au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc setf python
-au BufNewFile,BufRead *.ptl,*.pyi,SConstruct setf python
-
-" QL
-au BufRead,BufNewFile *.ql,*.qll setf ql
-
-" Quarto
-au BufRead,BufNewFile *.qmd setf quarto
-
-" Radiance
-au BufNewFile,BufRead *.rad,*.mat setf radiance
-
-" Raku (formerly Perl6)
-au BufNewFile,BufRead *.pm6,*.p6,*.t6,*.pod6,*.raku,*.rakumod,*.rakudoc,*.rakutest setf raku
-
-" Ratpoison config/command files
-au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison
-
-" RCS file
-au BufNewFile,BufRead *\,v setf rcs
-
-" Readline
-au BufNewFile,BufRead .inputrc,inputrc setf readline
-
-" Registry for MS-Windows
-au BufNewFile,BufRead *.reg
- \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
-
-" Renderman Interface Bytestream
-au BufNewFile,BufRead *.rib setf rib
-
-" Rego Policy Language
-au BufNewFile,BufRead *.rego setf rego
-
-" Rexx
-au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx
-
-" R Help file
-if has("fname_case")
- au BufNewFile,BufRead *.rd,*.Rd setf rhelp
-else
- au BufNewFile,BufRead *.rd setf rhelp
-endif
-
-" R noweb file
-if has("fname_case")
- au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb
-else
- au BufNewFile,BufRead *.rnw,*.snw setf rnoweb
-endif
-
-" R Markdown file
-if has("fname_case")
- au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd setf rmd
-else
- au BufNewFile,BufRead *.rmd,*.smd setf rmd
-endif
-
-" R profile file
-au BufNewFile,BufRead .Rprofile,Rprofile,Rprofile.site setf r
-
-" RSS looks like XML
-au BufNewFile,BufRead *.rss setf xml
-
-" R reStructuredText file
-if has("fname_case")
- au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst
-else
- au BufNewFile,BufRead *.rrst,*.srst setf rrst
-endif
-
-" Rexx, Rebol or R
-au BufNewFile,BufRead *.r,*.R call dist#ft#FTr()
-
-" Remind
-au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
-
-" ReScript
-au BufNewFile,BufRead *.res,*.resi setf rescript
-
-" Resolv.conf
-au BufNewFile,BufRead resolv.conf setf resolv
-
-" Relax NG Compact
-au BufNewFile,BufRead *.rnc setf rnc
-
-" Relax NG XML
-au BufNewFile,BufRead *.rng setf rng
-
-" RPL/2
-au BufNewFile,BufRead *.rpl setf rpl
-
-" Robot Framework
-au BufNewFile,BufRead *.robot,*.resource setf robot
-
-" Robots.txt
-au BufNewFile,BufRead robots.txt setf robots
-
-" Rpcgen
-au BufNewFile,BufRead *.x setf rpcgen
-
-" MikroTik RouterOS script
-au BufRead,BufNewFile *.rsc setf routeros
-
-" reStructuredText Documentation Format
-au BufNewFile,BufRead *.rst setf rst
-
-" RTF
-au BufNewFile,BufRead *.rtf setf rtf
-
-" Interactive Ruby shell
-au BufNewFile,BufRead .irbrc,irbrc setf ruby
-
-" Ruby
-au BufNewFile,BufRead *.rb,*.rbw setf ruby
-
-" RubyGems
-au BufNewFile,BufRead *.gemspec setf ruby
-
-" RBS (Ruby Signature)
-au BufNewFile,BufRead *.rbs setf rbs
-
-" Rackup
-au BufNewFile,BufRead *.ru setf ruby
-
-" Bundler
-au BufNewFile,BufRead Gemfile setf ruby
-
-" Ruby on Rails
-au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
-
-" Rantfile and Rakefile is like Ruby
-au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
-
-" Rust
-au BufNewFile,BufRead *.rs setf rust
-au BufNewFile,BufRead Cargo.lock,*/.cargo/config,*/.cargo/credentials setf toml
-
-" S-lang (or shader language, or SmallLisp)
-au BufNewFile,BufRead *.sl setf slang
-
-" Samba config
-au BufNewFile,BufRead smb.conf setf samba
-
-" SAS script
-au BufNewFile,BufRead *.sas setf sas
-
-" Sass
-au BufNewFile,BufRead *.sass setf sass
-
-" Sather
-au BufNewFile,BufRead *.sa setf sather
-
-" Scala
-au BufNewFile,BufRead *.scala setf scala
-
-" SBT - Scala Build Tool
-au BufNewFile,BufRead *.sbt setf sbt
-
-" SuperCollider
-au BufNewFile,BufRead *.sc call dist#ft#FTsc()
-
-au BufNewFile,BufRead *.quark setf supercollider
-
-" scdoc
-au BufNewFile,BufRead *.scd call dist#ft#FTscd()
-
-" Scilab
-au BufNewFile,BufRead *.sci,*.sce setf scilab
-
-
-" SCSS
-au BufNewFile,BufRead *.scss setf scss
-
-" SD: Streaming Descriptors
-au BufNewFile,BufRead *.sd setf sd
-
-" SDL
-au BufNewFile,BufRead *.sdl,*.pr setf sdl
-
-" sed
-au BufNewFile,BufRead *.sed setf sed
-
-" SubRip
-au BufNewFile,BufRead *.srt setf srt
-
-" SubStation Alpha
-au BufNewFile,BufRead *.ass,*.ssa setf ssa
-
-" svelte
-au BufNewFile,BufRead *.svelte setf svelte
-
-" Sieve (RFC 3028, 5228)
-au BufNewFile,BufRead *.siv,*.sieve setf sieve
-
-" Sendmail
-au BufNewFile,BufRead sendmail.cf setf sm
-
-" Sendmail .mc files are actually m4. Could also be MS Message text file or
-" Maxima.
-au BufNewFile,BufRead *.mc call dist#ft#McSetf()
-
-" Services
-au BufNewFile,BufRead */etc/services setf services
-
-" Service Location config
-au BufNewFile,BufRead */etc/slp.conf setf slpconf
-
-" Service Location registration
-au BufNewFile,BufRead */etc/slp.reg setf slpreg
-
-" Service Location SPI
-au BufNewFile,BufRead */etc/slp.spi setf slpspi
-
-" Setserial config
-au BufNewFile,BufRead */etc/serial.conf setf setserial
-
-" SGML
-au BufNewFile,BufRead *.sgm,*.sgml
- \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
- \ setf sgmllnx |
- \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
- \ let b:docbk_type = "sgml" |
- \ let b:docbk_ver = 4 |
- \ setf docbk |
- \ else |
- \ setf sgml |
- \ endif
-
-" SGMLDECL
-au BufNewFile,BufRead *.decl,*.dcl,*.dec
- \ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
- \ setf sgmldecl |
- \ endif
-
-" SGML catalog file
-au BufNewFile,BufRead catalog setf catalog
-
-" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
-" Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
-" bash scripts.
-" NOTE: Patterns ending in a star are further down, these have lower priority.
-au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
-au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
-au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
-
-" Shell script (Arch Linux) or PHP file (Drupal)
-au BufNewFile,BufRead *.install
- \ if getline(1) =~ '<?php' |
- \ setf php |
- \ else |
- \ call dist#ft#SetFileTypeSH("bash") |
- \ endif
-
-" tcsh scripts (patterns ending in a star further below)
-au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFileTypeShell("tcsh")
-
-" csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
-" (patterns ending in a start further below)
-au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH()
-
-" Zig
-au BufNewFile,BufRead *.zig setf zig
-
-" Z-Shell script (patterns ending in a star further below)
-au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh
-au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
-au BufNewFile,BufRead *.zsh setf zsh
-
-" Scheme
-au BufNewFile,BufRead *.scm,*.ss,*.sld,*.rkt,*.rktd,*.rktl setf scheme
-
-" Screen RC
-au BufNewFile,BufRead .screenrc,screenrc setf screen
-
-" Sexplib
-au BufNewFile,BufRead *.sexp setf sexplib
-
-" Simula
-au BufNewFile,BufRead *.sim setf simula
-
-" SINDA
-au BufNewFile,BufRead *.sin,*.s85 setf sinda
-
-" SiSU
-au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu
-au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
-
-" SKILL
-au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
-
-" SLRN
-au BufNewFile,BufRead .slrnrc setf slrnrc
-au BufNewFile,BufRead *.score setf slrnsc
-
-" Smalltalk
-au BufNewFile,BufRead *.st setf st
-
-" Smalltalk (and Rexx, TeX, and Visual Basic)
-au BufNewFile,BufRead *.cls call dist#ft#FTcls()
-
-" Smarty templates
-au BufNewFile,BufRead *.tpl setf smarty
-
-" SMIL or XML
-au BufNewFile,BufRead *.smil
- \ if getline(1) =~ '<?\s*xml.*?>' |
- \ setf xml |
- \ else |
- \ setf smil |
- \ endif
-
-" SMIL or SNMP MIB file
-au BufNewFile,BufRead *.smi
- \ if getline(1) =~ '\<smil\>' |
- \ setf smil |
- \ else |
- \ setf mib |
- \ endif
-
-" SMITH
-au BufNewFile,BufRead *.smt,*.smith setf smith
-
-" Snobol4 and spitbol
-au BufNewFile,BufRead *.sno,*.spt setf snobol4
-
-" SNMP MIB files
-au BufNewFile,BufRead *.mib,*.my setf mib
-
-" Snort Configuration
-au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog
-au BufNewFile,BufRead *.rules call dist#ft#FTRules()
-
-" Solidity
-au BufRead,BufNewFile *.sol setf solidity
-
-" SPARQL queries
-au BufNewFile,BufRead *.rq,*.sparql setf sparql
-
-" Spec (Linux RPM)
-au BufNewFile,BufRead *.spec setf spec
-
-" Speedup (AspenTech plant simulator)
-au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup
-
-" Slice
-au BufNewFile,BufRead *.ice setf slice
-
-" Microsoft Visual Studio Solution
-au BufNewFile,BufRead *.sln setf solution
-au BufNewFile,BufRead *.slnf setf json
-
-" Spice
-au BufNewFile,BufRead *.sp,*.spice setf spice
-
-" Spyce
-au BufNewFile,BufRead *.spy,*.spi setf spyce
-
-" Squid
-au BufNewFile,BufRead squid.conf setf squid
-
-" SQL for Oracle Designer
-au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql
-
-" SQL
-au BufNewFile,BufRead *.sql call dist#ft#SQL()
-
-" SQLJ
-au BufNewFile,BufRead *.sqlj setf sqlj
-
-" SQR
-au BufNewFile,BufRead *.sqr,*.sqi setf sqr
-
-" Squirrel
-au BufNewFile,BufRead *.nut setf squirrel
-
-" OpenSSH configuration
-au BufNewFile,BufRead ssh_config,*/.ssh/config,*/.ssh/*.conf setf sshconfig
-au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf setf sshconfig
-
-" OpenSSH server configuration
-au BufNewFile,BufRead sshd_config setf sshdconfig
-au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf setf sshdconfig
-
-" Stata
-au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
-" Also *.class, but not when it's a Java bytecode file
-au BufNewFile,BufRead *.class
- \ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
-
-" SMCL
-au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
-
-" Stored Procedures
-au BufNewFile,BufRead *.stp setf stp
-
-" Standard ML
-au BufNewFile,BufRead *.sml setf sml
-
-" Sratus VOS command macro
-au BufNewFile,BufRead *.cm setf voscm
-
-" Swift
-au BufNewFile,BufRead *.swift setf swift
-au BufNewFile,BufRead *.swift.gyb setf swiftgyb
-
-" Swift Intermediate Language or SILE
-au BufNewFile,BufRead *.sil call dist#ft#FTsil()
-
-" Sysctl
-au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl
-
-" Systemd unit files
-au BufNewFile,BufRead */systemd/*.{automount,dnssd,link,mount,netdev,network,nspawn,path,service,slice,socket,swap,target,timer} setf systemd
-" Systemd overrides
-au BufNewFile,BufRead */etc/systemd/*.conf.d/*.conf setf systemd
-au BufNewFile,BufRead */etc/systemd/system/*.d/*.conf setf systemd
-au BufNewFile,BufRead */.config/systemd/user/*.d/*.conf setf systemd
-" Systemd temp files
-au BufNewFile,BufRead */etc/systemd/system/*.d/.#* setf systemd
-au BufNewFile,BufRead */etc/systemd/system/.#* setf systemd
-au BufNewFile,BufRead */.config/systemd/user/*.d/.#* setf systemd
-au BufNewFile,BufRead */.config/systemd/user/.#* setf systemd
-
-" Synopsys Design Constraints
-au BufNewFile,BufRead *.sdc setf sdc
-
-" Sudoers
-au BufNewFile,BufRead */etc/sudoers,sudoers.tmp setf sudoers
-
-" SVG (Scalable Vector Graphics)
-au BufNewFile,BufRead *.svg setf svg
-
-" Surface
-au BufRead,BufNewFile *.sface setf surface
-
-" Tads (or Nroff or Perl test file)
-au BufNewFile,BufRead *.t
- \ if !dist#ft#FTnroff() && !dist#ft#FTperl() | setf tads | endif
-
-" Tags
-au BufNewFile,BufRead tags setf tags
-
-" TAK
-au BufNewFile,BufRead *.tak setf tak
-
-" Task
-au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata
-au BufRead,BufNewFile *.task setf taskedit
-
-" Tcl (JACL too)
-au BufNewFile,BufRead *.tcl,*.tm,*.tk,*.itcl,*.itk,*.jacl,.tclshrc,.wishrc setf tcl
-
-" Teal
-au BufRead,BufNewFile *.tl setf teal
-
-" TealInfo
-au BufNewFile,BufRead *.tli setf tli
-
-" Telix Salt
-au BufNewFile,BufRead *.slt setf tsalt
-
-" Tera Term Language or Turtle
-au BufRead,BufNewFile *.ttl
- \ if getline(1) =~ '^@\?\(prefix\|base\)' |
- \ setf turtle |
- \ else |
- \ setf teraterm |
- \ endif
-
-" Terminfo
-au BufNewFile,BufRead *.ti setf terminfo
-
-" Terraform variables
-au BufRead,BufNewFile *.tfvars setf terraform-vars
-
-" TeX
-au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
-au BufNewFile,BufRead *.tex call dist#ft#FTtex()
-
-" ConTeXt
-au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx setf context
-
-" Texinfo
-au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
-
-" TeX configuration
-au BufNewFile,BufRead texmf.cnf setf texmf
-
-" Tidy config
-au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf setf tidy
-
-" TF mud client
-au BufNewFile,BufRead .tfrc,tfrc setf tf
-
-" TF mud client or terraform
-au BufNewFile,BufRead *.tf call dist#ft#FTtf()
-
-" TLA+
-au BufNewFile,BufRead *.tla setf tla
-
-" tmux configuration
-au BufNewFile,BufRead {.,}tmux*.conf setf tmux
-
-" TOML
-au BufNewFile,BufRead *.toml setf toml
-
-" TPP - Text Presentation Program
-au BufNewFile,BufRead *.tpp setf tpp
-
-" Treetop
-au BufRead,BufNewFile *.treetop setf treetop
-
-" Trustees
-au BufNewFile,BufRead trustees.conf setf trustees
-
-" TSS - Geometry
-au BufNewFile,BufReadPost *.tssgm setf tssgm
-
-" TSS - Optics
-au BufNewFile,BufReadPost *.tssop setf tssop
-
-" TSS - Command Line (temporary)
-au BufNewFile,BufReadPost *.tsscl setf tsscl
-
-" TSV Files
-au BufNewFile,BufRead *.tsv setf tsv
-
-" Tutor mode
-au BufNewFile,BufReadPost *.tutor setf tutor
-
-" TWIG files
-au BufNewFile,BufReadPost *.twig setf twig
-
-" TypeScript or Qt translation file (which is XML)
-au BufNewFile,BufReadPost *.ts
- \ if getline(1) =~ '<?xml' |
- \ setf xml |
- \ else |
- \ setf typescript |
- \ endif
-
-" TypeScript module and common
-au BufNewFile,BufRead *.mts,*.cts setf typescript
-
-" TypeScript with React
-au BufNewFile,BufRead *.tsx setf typescriptreact
-
-" Motif UIT/UIL files
-au BufNewFile,BufRead *.uit,*.uil setf uil
-
-" Udev conf
-au BufNewFile,BufRead */etc/udev/udev.conf setf udevconf
-
-" Udev permissions
-au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
-"
-" Udev symlinks config
-au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh
-
-" UnrealScript
-au BufNewFile,BufRead *.uc setf uc
-
-" Updatedb
-au BufNewFile,BufRead */etc/updatedb.conf setf updatedb
-
-" Upstart (init(8)) config files
-au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart
-au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart
-au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart
-au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart
-au BufNewFile,BufRead */.config/upstart/*.conf setf upstart
-au BufNewFile,BufRead */.config/upstart/*.override setf upstart
-
-" Vala
-au BufNewFile,BufRead *.vala setf vala
-
-" VDF
-au BufNewFile,BufRead *.vdf setf vdf
-
-" VDM
-au BufRead,BufNewFile *.vdmpp,*.vpp setf vdmpp
-au BufRead,BufNewFile *.vdmrt setf vdmrt
-au BufRead,BufNewFile *.vdmsl,*.vdm setf vdmsl
-
-" Vera
-au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
-
-" Vagrant (uses Ruby syntax)
-au BufNewFile,BufRead Vagrantfile setf ruby
-
-" Verilog HDL
-au BufNewFile,BufRead *.v setf verilog
-
-" Verilog-AMS HDL
-au BufNewFile,BufRead *.va,*.vams setf verilogams
-
-" SystemVerilog
-au BufNewFile,BufRead *.sv,*.svh setf systemverilog
-
-" VHDL
-au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho setf vhdl
-
-" Vim script
-au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
-
-" Viminfo file
-au BufNewFile,BufRead .viminfo,_viminfo setf viminfo
-
-" Virata Config Script File or Drupal module
-au BufRead,BufNewFile *.hw,*.module,*.pkg
- \ if getline(1) =~ '<?php' |
- \ setf php |
- \ else |
- \ setf virata |
- \ endif
-
-" Visual Basic (also uses *.bas) or FORM
-au BufNewFile,BufRead *.frm call dist#ft#FTfrm()
-
-" SaxBasic is close to Visual Basic
-au BufNewFile,BufRead *.sba setf vb
-
-" Vgrindefs file
-au BufNewFile,BufRead vgrindefs setf vgrindefs
-
-" VRML V1.0c
-au BufNewFile,BufRead *.wrl setf vrml
-
-" Vroom (vim testing and executable documentation)
-au BufNewFile,BufRead *.vroom setf vroom
-
-" Vue.js Single File Component
-au BufNewFile,BufRead *.vue setf vue
-
-" WebAssembly
-au BufNewFile,BufRead *.wast,*.wat setf wast
-
-" Webmacro
-au BufNewFile,BufRead *.wm setf webmacro
-
-" Wget config
-au BufNewFile,BufRead .wgetrc,wgetrc setf wget
-
-" Wget2 config
-au BufNewFile,BufRead .wget2rc,wget2rc setf wget2
-
-" Website MetaLanguage
-au BufNewFile,BufRead *.wml setf wml
-
-" Winbatch
-au BufNewFile,BufRead *.wbt setf winbatch
-
-" WSML
-au BufNewFile,BufRead *.wsml setf wsml
-
-" WPL
-au BufNewFile,BufRead *.wpl setf xml
-
-" WvDial
-au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial
-
-" CVS RC file
-au BufNewFile,BufRead .cvsrc setf cvsrc
-
-" CVS commit file
-au BufNewFile,BufRead cvs\d\+ setf cvs
-
-" WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
-" lines in a WEB file).
-au BufNewFile,BufRead *.web
- \ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
- \ setf web |
- \ else |
- \ setf winbatch |
- \ endif
-
-" Windows Scripting Host and Windows Script Component
-au BufNewFile,BufRead *.ws[fc] setf wsh
-
-" XHTML
-au BufNewFile,BufRead *.xhtml,*.xht setf xhtml
-
-" X Pixmap (dynamically sets colors, this used to trigger on BufEnter to make
-" it work better, but that breaks setting 'filetype' manually)
-au BufNewFile,BufRead *.xpm
- \ if getline(1) =~ "XPM2" |
- \ setf xpm2 |
- \ else |
- \ setf xpm |
- \ endif
-au BufNewFile,BufRead *.xpm2 setf xpm2
-
-" XFree86 config
-au BufNewFile,BufRead XF86Config
- \ if getline(1) =~ '\<XConfigurator\>' |
- \ let b:xf86conf_xfree86_version = 3 |
- \ endif |
- \ setf xf86conf
-au BufNewFile,BufRead */xorg.conf.d/*.conf
- \ let b:xf86conf_xfree86_version = 4 |
- \ setf xf86conf
-
-" Xorg config
-au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | setf xf86conf
-
-" Xinetd conf
-au BufNewFile,BufRead */etc/xinetd.conf setf xinetd
-
-" XS Perl extension interface language
-au BufNewFile,BufRead *.xs setf xs
-
-" X resources file
-au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
-
-" Xmath
-au BufNewFile,BufRead *.msc,*.msf setf xmath
-au BufNewFile,BufRead *.ms
- \ if !dist#ft#FTnroff() | setf xmath | endif
-
-" XML specific variants: docbk and xbl
-au BufNewFile,BufRead *.xml call dist#ft#FTxml()
-
-" XMI (holding UML models) is also XML
-au BufNewFile,BufRead *.xmi setf xml
-
-" CSPROJ files are Visual Studio.NET's XML-based C# project config files
-au BufNewFile,BufRead *.csproj,*.csproj.user setf xml
-
-" FSPROJ files are Visual Studio.NET's XML-based F# project config files
-au BufNewFile,BufRead *.fsproj,*.fsproj.user setf xml
-
-" VBPROJ files are Visual Studio.NET's XML-based Visual Basic project config files
-au BufNewFile,BufRead *.vbproj,*.vbproj.user setf xml
-
-" Qt Linguist translation source and Qt User Interface Files are XML
-" However, for .ts TypeScript is more common.
-au BufNewFile,BufRead *.ui setf xml
-
-" TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
-au BufNewFile,BufRead *.tpm setf xml
-
-" Xdg menus
-au BufNewFile,BufRead */etc/xdg/menus/*.menu setf xml
-
-" ATI graphics driver configuration
-au BufNewFile,BufRead fglrxrc setf xml
-
-" Web Services Description Language (WSDL)
-au BufNewFile,BufRead *.wsdl setf xml
-
-" XLIFF (XML Localisation Interchange File Format) is also XML
-au BufNewFile,BufRead *.xlf setf xml
-au BufNewFile,BufRead *.xliff setf xml
-
-" XML User Interface Language
-au BufNewFile,BufRead *.xul setf xml
-
-" X11 xmodmap (also see below)
-au BufNewFile,BufRead *Xmodmap setf xmodmap
-
-" Xquery
-au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery
-
-" XSD
-au BufNewFile,BufRead *.xsd setf xsd
-
-" Xslt
-au BufNewFile,BufRead *.xsl,*.xslt setf xslt
-
-" Yacc
-au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
-
-" Yacc or racc
-au BufNewFile,BufRead *.y call dist#ft#FTy()
-
-" Yaml
-au BufNewFile,BufRead *.yaml,*.yml setf yaml
-
-" Raml
-au BufNewFile,BufRead *.raml setf raml
-
-" yum conf (close enough to dosini)
-au BufNewFile,BufRead */etc/yum.conf setf dosini
-
-" YANG
-au BufRead,BufNewFile *.yang setf yang
-
-" Zimbu
-au BufNewFile,BufRead *.zu setf zimbu
-" Zimbu Templates
-au BufNewFile,BufRead *.zut setf zimbutempl
-
-" Zope
-" dtml (zope dynamic template markup language), pt (zope page template),
-" cpt (zope form controller page template)
-au BufNewFile,BufRead *.dtml,*.pt,*.cpt call dist#ft#FThtml()
-" zsql (zope sql method)
-au BufNewFile,BufRead *.zsql call dist#ft#SQL()
-
-" Z80 assembler asz80
-au BufNewFile,BufRead *.z8a setf z8a
-
-augroup END
-
-
-" Source the user-specified filetype file, for backwards compatibility with
-" Vim 5.x.
-if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
- execute "source " . myfiletypefile
-endif
-
-
-" Check for "*" after loading myfiletypefile, so that scripts.vim is only used
-" when there are no matching file name extensions.
-" Don't do this for compressed files.
-augroup filetypedetect
-au BufNewFile,BufRead *
- \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
- \ | runtime! scripts.vim | endif
-au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
-
-
-" Plain text files, needs to be far down to not override others. This avoids
-" the "conf" type being used if there is a line starting with '#'.
-" But before patterns matching everything in a directory.
-au BufNewFile,BufRead *.text,README,LICENSE,COPYING,AUTHORS setf text
-
-
-" Extra checks for when no filetype has been detected now. Mostly used for
-" patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim
-" script file.
-" Most of these should call s:StarSetf() to avoid names ending in .gz and the
-" like are used.
-
-" More Apache style config files
-au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/* call s:StarSetf('apachestyle')
-au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle')
-
-" More Apache config files
-au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache')
-au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.*/*,*/etc/httpd/mods-*/*,*/etc/httpd/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
-
-" APT config file
-au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} call s:StarSetf('aptconf')
-
-" Asterisk config file
-au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk')
-au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
-
-" Bazaar version control
-au BufNewFile,BufRead bzr_log.* setf bzr
-
-" Bazel build file
-if !has("fname_case")
- au BufNewFile,BufRead *.BUILD,BUILD setf bzl
-endif
-
-" BIND zone
-au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
-
-au BufNewFile,BufRead cabal.project.* call s:StarSetf('cabalproject')
-
-" Calendar
-au BufNewFile,BufRead */.calendar/*,
- \*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
- \ call s:StarSetf('calendar')
-
-" Changelog
-au BufNewFile,BufRead [cC]hange[lL]og*
- \ if getline(1) =~ '; urgency='
- \| call s:StarSetf('debchangelog')
- \|else
- \| call s:StarSetf('changelog')
- \|endif
-
-" Crontab
-au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/* call s:StarSetf('crontab')
-
-" dnsmasq(8) configuration
-au BufNewFile,BufRead */etc/dnsmasq.d/* call s:StarSetf('dnsmasq')
-
-" Dockerfile
-au BufNewFile,BufRead Dockerfile.*,Containerfile.* call s:StarSetf('dockerfile')
-
-" Dracula
-au BufNewFile,BufRead drac.* call s:StarSetf('dracula')
-
-" Fvwm
-au BufNewFile,BufRead */.fvwm/* call s:StarSetf('fvwm')
-au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
- \ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
-au BufNewFile,BufRead *fvwm2rc*
- \ if expand("<afile>:e") == "m4"
- \| call s:StarSetf('fvwm2m4')
- \|else
- \| let b:fvwm_version = 2 | call s:StarSetf('fvwm')
- \|endif
-
-" Gedcom
-au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom')
-
-" Git
-au BufNewFile,BufRead */.gitconfig.d/*,*/etc/gitconfig.d/* call s:StarSetf('gitconfig')
-
-" Gitolite
-au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite')
-
-" GTK RC
-au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc')
-
-" Jam
-au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam')
-
-" Jargon
-au! BufNewFile,BufRead *jarg*
- \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
- \| call s:StarSetf('jargon')
- \|endif
-
-" Java Properties resource file (note: doesn't catch font.properties.pl)
-au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties')
-
-" Kconfig
-au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig')
-
-" Lilo: Linux loader
-au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo')
-
-" Libsensors
-au BufNewFile,BufRead */etc/sensors.d/[^.]* call s:StarSetf('sensors')
-
-" Logcheck
-au BufNewFile,BufRead */etc/logcheck/*.d*/* call s:StarSetf('logcheck')
-
-" Makefile
-au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make')
-
-" Ruby Makefile
-au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
-
-" Mail (also matches muttrc.vim, so this is below the other checks)
-au BufNewFile,BufRead {neo,}mutt[[:alnum:]._-]\\\{6\} setf mail
-
-au BufNewFile,BufRead reportbug-* call s:StarSetf('mail')
-
-" Modconf
-au BufNewFile,BufRead */etc/modutils/*
- \ if executable(expand("<afile>")) != 1
- \| call s:StarSetf('modconf')
- \|endif
-au BufNewFile,BufRead */etc/modprobe.* call s:StarSetf('modconf')
-
-" Mutt setup files (must be before catch *.rc)
-au BufNewFile,BufRead */etc/Muttrc.d/* call s:StarSetf('muttrc')
-
-" Mutt setup file
-au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc')
-au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
-
-" Neomutt setup file
-au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc')
-au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc')
-
-" Nroff macros
-au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
-
-" OpenBSD hostname.if
-au BufNewFile,BufRead */etc/hostname.* call s:StarSetf('config')
-
-" Pam conf
-au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf')
-
-" Printcap and Termcap
-au BufNewFile,BufRead *printcap*
- \ if !did_filetype()
- \| let b:ptcap_type = "print" | call s:StarSetf('ptcap')
- \|endif
-au BufNewFile,BufRead *termcap*
- \ if !did_filetype()
- \| let b:ptcap_type = "term" | call s:StarSetf('ptcap')
- \|endif
-
-" ReDIF
-" Only used when the .rdf file was not detected to be XML.
-au BufRead,BufNewFile *.rdf call dist#ft#Redif()
-
-" Remind
-au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
-
-" SGML catalog file
-au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
-
-" avoid doc files being recognized a shell files
-au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
-
-" Shell scripts ending in a star
-au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
-au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
-au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
-
-" Sudoers
-au BufNewFile,BufRead */etc/sudoers.d/* call s:StarSetf('sudoers')
-
-" tcsh scripts ending in a star
-au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh")
-
-" csh scripts ending in a star
-au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH()
-
-" tmux configuration with arbitrary extension
-au BufNewFile,BufRead {.,}tmux*.conf* setf tmux
-
-" VHDL
-au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
-
-" Vim script
-au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')
-
-" Subversion commit file
-au BufNewFile,BufRead svn-commit*.tmp setf svn
-
-" X resources file
-au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
-
-" XFree86 config
-au BufNewFile,BufRead XF86Config-4*
- \ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf')
-au BufNewFile,BufRead XF86Config*
- \ if getline(1) =~ '\<XConfigurator\>'
- \| let b:xf86conf_xfree86_version = 3
- \|endif
- \|call s:StarSetf('xf86conf')
-
-" X11 xmodmap
-au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap')
-
-" Xinetd conf
-au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd')
-
-" yum conf (close enough to dosini)
-au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
-
-" Z-Shell script ending in a star
-au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh')
-au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
-
-
-" Help files match *.txt but should have a last line that is a modeline.
-au BufNewFile,BufRead *.txt
- \ if getline('$') !~ 'vim:.*ft=help'
- \| setf text
- \| endif
-
-" Blueprint markup files
-au BufNewFile,BufRead *.blp setf blueprint
-
-if !exists('g:did_load_ftdetect')
- " Use the filetype detect plugins. They may overrule any of the previously
- " detected filetypes.
- runtime! ftdetect/*.vim
- runtime! ftdetect/*.lua
-endif
-
-" NOTE: The above command could have ended the filetypedetect autocmd group
-" and started another one. Let's make sure it has ended to get to a consistent
-" state.
-augroup END
-
-" Generic configuration file. Use FALLBACK, it's just guessing!
-au filetypedetect BufNewFile,BufRead,StdinReadPost *
- \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
- \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
- \ || getline(4) =~ '^#' || getline(5) =~ '^#') |
- \ setf FALLBACK conf |
- \ endif
-
-
-" If the GUI is already running, may still need to install the Syntax menu.
-" Don't do it when the 'M' flag is included in 'guioptions'.
-if has("menu") && has("gui_running")
- \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
- source <sfile>:p:h/menu.vim
-endif
-
-" Function called for testing all functions defined here. These are
-" script-local, thus need to be executed here.
-" Returns a string with error messages (hopefully empty).
-func TestFiletypeFuncs(testlist)
- let output = ''
- for f in a:testlist
- try
- exe f
- catch
- let output = output . "\n" . f . ": " . v:exception
- endtry
- endfor
- return output
-endfunc
-
-" Restore 'cpoptions'
-let &cpo = s:cpo_save
-unlet s:cpo_save
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim
index 3faeff621a..5931cd921d 100644
--- a/runtime/ftplugin/abaqus.vim
+++ b/runtime/ftplugin/abaqus.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Abaqus finite element input file (www.abaqus.com)
" Maintainer: Carl Osterwisch <costerwi@gmail.com>
-" Last Change: 2022 Aug 03
+" Last Change: 2022 Oct 08
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin") | finish | endif
@@ -66,25 +66,44 @@ if exists("loaded_matchit") && !exists("b:match_words")
endif
if !exists("no_plugin_maps") && !exists("no_abaqus_maps")
- " Define keys used to move [count] keywords backward or forward.
- noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
- noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
+ " Map [[ and ]] keys to move [count] keywords backward or forward
+ nnoremap <silent><buffer> ]] :call <SID>Abaqus_NextKeyword(1)<CR>
+ nnoremap <silent><buffer> [[ :call <SID>Abaqus_NextKeyword(-1)<CR>
+ function! <SID>Abaqus_NextKeyword(direction)
+ .mark '
+ if a:direction < 0
+ let flags = 'b'
+ else
+ let flags = ''
+ endif
+ let l:count = abs(a:direction) * v:count1
+ while l:count > 0 && search("^\\*\\a", flags)
+ let l:count -= 1
+ endwhile
+ endfunction
- " Define key to toggle commenting of the current line or range
+ " Map \\ to toggle commenting of the current line or range
noremap <silent><buffer> <LocalLeader><LocalLeader>
\ :call <SID>Abaqus_ToggleComment()<CR>j
function! <SID>Abaqus_ToggleComment() range
- if strpart(getline(a:firstline), 0, 2) == "**"
- " Un-comment all lines in range
- silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
- else
- " Comment all lines in range
- silent execute a:firstline . ',' . a:lastline . 's/^/**/'
- endif
+ if strpart(getline(a:firstline), 0, 2) == "**"
+ " Un-comment all lines in range
+ silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
+ else
+ " Comment all lines in range
+ silent execute a:firstline . ',' . a:lastline . 's/^/**/'
+ endif
+ endfunction
+
+ " Map \s to swap first two comma separated fields
+ noremap <silent><buffer> <LocalLeader>s :call <SID>Abaqus_Swap()<CR>
+ function! <SID>Abaqus_Swap() range
+ silent execute a:firstline . ',' . a:lastline . 's/\([^*,]*\),\([^,]*\)/\2,\1/'
endfunction
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
\ . "|unmap <buffer> <LocalLeader><LocalLeader>"
+ \ . "|unmap <buffer> <LocalLeader>s"
endif
" Undo must be done in nocompatible mode for <LocalLeader>.
diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim
index aaa61f71d9..c28b8aecf8 100644
--- a/runtime/ftplugin/lua.vim
+++ b/runtime/ftplugin/lua.vim
@@ -3,7 +3,8 @@
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
" Contributor: Dorai Sitaram <ds26@gte.com>
-" Last Change: 2022 Sep 05
+" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
+" Last Change: 2022 Oct 15
if exists("b:did_ftplugin")
finish
@@ -19,9 +20,11 @@ setlocal formatoptions-=t formatoptions+=croql
let &l:define = '\<function\|\<local\%(\s\+function\)\='
+" TODO: handle init.lua
+setlocal includeexpr=substitute(v:fname,'\\.','/','g')
setlocal suffixesadd=.lua
-let b:undo_ftplugin = "setlocal cms< com< def< fo< sua<"
+let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<"
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim
index fc1d9e068b..2b963f139d 100644
--- a/runtime/ftplugin/markdown.vim
+++ b/runtime/ftplugin/markdown.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
-" Language: Markdown
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2019 Dec 05
+" Language: Markdown
+" Maintainer: Tim Pope <https://github.com/tpope/vim-markdown>
+" Last Change: 2022 Oct 13
if exists("b:did_ftplugin")
finish
@@ -9,18 +9,33 @@ endif
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+let s:keepcpo= &cpo
+set cpo&vim
+
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s-->
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
-setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
+setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\}
if exists('b:undo_ftplugin')
- let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
+ let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<"
else
- let b:undo_ftplugin = "setl cms< com< fo< flp<"
+ let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<"
+endif
+
+if get(g:, 'markdown_recommended_style', 1)
+ setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4
+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
function! s:NotCodeBlock(lnum) abort
- return synIDattr(synID(v:lnum, 1, 1), 'name') !=# 'markdownCode'
+ return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCode'
endfunction
function! MarkdownFold() abort
@@ -64,11 +79,14 @@ function! MarkdownFoldText() abort
return hash_indent.' '.title.' '.linecount
endfunction
-if has("folding") && exists("g:markdown_folding")
+if has("folding") && get(g:, "markdown_folding", 0)
setlocal foldexpr=MarkdownFold()
setlocal foldmethod=expr
setlocal foldtext=MarkdownFoldText()
- let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<"
+ 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/poefilter.vim b/runtime/ftplugin/poefilter.vim
new file mode 100644
index 0000000000..92c2def630
--- /dev/null
+++ b/runtime/ftplugin/poefilter.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: PoE item filter
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Last Change: 2022 Oct 07
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/ftplugin/ssa.vim b/runtime/ftplugin/ssa.vim
new file mode 100644
index 0000000000..04cc7a9bde
--- /dev/null
+++ b/runtime/ftplugin/ssa.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: SubStation Alpha
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Last Change: 2022 Oct 10
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=:;,:!: commentstring=;\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index d2840b3a7e..fa792422ba 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -2285,8 +2285,6 @@ end
---
--- See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
---
---- Note that Lua filetype detection is disabled when |g:do_legacy_filetype| is set.
----
--- Example:
--- <pre>
--- vim.filetype.add({
@@ -2323,7 +2321,7 @@ end
--- })
--- </pre>
---
---- To add a fallback match on contents (see |new-filetype-scripts|), use
+--- To add a fallback match on contents, use
--- <pre>
--- vim.filetype.add {
--- pattern = {
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index 7fc7f1b7ca..23fa1c5068 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -181,7 +181,7 @@ function M.cls(bufnr)
return vim.g.filetype_cls
end
local line = getlines(bufnr, 1)
- if line:find('^%%') then
+ if line:find('^[%%\\]') then
return 'tex'
elseif line:find('^#') and line:lower():find('rexx') then
return 'rexx'
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 4034753322..7442c8f005 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -637,7 +637,7 @@ function protocol.make_client_capabilities()
codeActionLiteralSupport = {
codeActionKind = {
valueSet = (function()
- local res = vim.tbl_values(protocol.CodeActionKind)
+ local res = vim.tbl_values(constants.CodeActionKind)
table.sort(res)
return res
end)(),
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 382322cfe2..4db5e20921 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 02
+" Last Change: 2022 Oct 15
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
@@ -874,6 +874,8 @@ if has("lispindent")
call <SID>BinOptionL("lisp")
call append("$", "lispwords\twords that change how lisp indenting works")
call <SID>OptionL("lw")
+ call <SID>AddOption("lispoptions", "options for Lisp indenting")
+ call <SID>OptionL("lop")
endif
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
deleted file mode 100644
index 2d8bfdcb05..0000000000
--- a/runtime/scripts.vim
+++ /dev/null
@@ -1,459 +0,0 @@
-" Vim support file to detect file types in scripts
-"
-" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2021 Jan 22
-
-" This file is called by an autocommand for every file that has just been
-" loaded into a buffer. It checks if the type of file can be recognized by
-" the file contents. The autocommand is in $VIMRUNTIME/filetype.vim.
-"
-" Note that the pattern matches are done with =~# to avoid the value of the
-" 'ignorecase' option making a difference. Where case is to be ignored use
-" =~? instead. Do not use =~ anywhere.
-
-" Only run when using legacy filetype
-if !exists('g:do_legacy_filetype')
- finish
-endif
-
-" Only do the rest when the FileType autocommand has not been triggered yet.
-if did_filetype()
- finish
-endif
-
-" Load the user defined scripts file first
-" Only do this when the FileType autocommand has not been triggered yet
-if exists("myscriptsfile") && filereadable(expand(myscriptsfile))
- execute "source " . myscriptsfile
- if did_filetype()
- finish
- endif
-endif
-
-" Line continuation is used here, remove 'C' from 'cpoptions'
-let s:cpo_save = &cpo
-set cpo&vim
-
-let s:line1 = getline(1)
-
-if s:line1 =~# "^#!"
- " A script that starts with "#!".
-
- " Check for a line like "#!/usr/bin/env {options} bash". Turn it into
- " "#!/usr/bin/bash" to make matching easier.
- " Recognize only a few {options} that are commonly used.
- if s:line1 =~# '^#!\s*\S*\<env\s'
- let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
- let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
- let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
- endif
-
- " Get the program name.
- " Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
- " If the word env is used, use the first word after the space:
- " "#!/usr/bin/env perl [path/args]"
- " If there is no path use the first word: "#!perl [path/args]".
- " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
- if s:line1 =~# '^#!\s*\a:[/\\]'
- let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
- elseif s:line1 =~# '^#!.*\<env\>'
- let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
- elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
- let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
- else
- let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
- endif
-
- " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
- " third line. Suggested by Steven Atkinson.
- if getline(3) =~# '^exec wish'
- let s:name = 'wish'
- endif
-
- " Bourne-like shell scripts: bash bash2 ksh ksh93 sh
- if s:name =~# '^\(bash\d*\|\|ksh\d*\|sh\)\>'
- call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim
-
- " csh scripts
- elseif s:name =~# '^csh\>'
- if exists("g:filetype_csh")
- call dist#ft#SetFileTypeShell(g:filetype_csh)
- else
- call dist#ft#SetFileTypeShell("csh")
- endif
-
- " tcsh scripts
- elseif s:name =~# '^tcsh\>'
- call dist#ft#SetFileTypeShell("tcsh")
-
- " Z shell scripts
- elseif s:name =~# '^zsh\>'
- set ft=zsh
-
- " TCL scripts
- elseif s:name =~# '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
- set ft=tcl
-
- " Expect scripts
- elseif s:name =~# '^expect\>'
- set ft=expect
-
- " Gnuplot scripts
- elseif s:name =~# '^gnuplot\>'
- set ft=gnuplot
-
- " Makefiles
- elseif s:name =~# 'make\>'
- set ft=make
-
- " Pike
- elseif s:name =~# '^pike\%(\>\|[0-9]\)'
- set ft=pike
-
- " Lua
- elseif s:name =~# 'lua'
- set ft=lua
-
- " Perl
- elseif s:name =~# 'perl'
- set ft=perl
-
- " PHP
- elseif s:name =~# 'php'
- set ft=php
-
- " Python
- elseif s:name =~# 'python'
- set ft=python
-
- " Groovy
- elseif s:name =~# '^groovy\>'
- set ft=groovy
-
- " Raku
- elseif s:name =~# 'raku'
- set ft=raku
-
- " Ruby
- elseif s:name =~# 'ruby'
- set ft=ruby
-
- " JavaScript
- elseif s:name =~# 'node\(js\)\=\>\|js\>' || s:name =~# 'rhino\>'
- set ft=javascript
-
- " BC calculator
- elseif s:name =~# '^bc\>'
- set ft=bc
-
- " sed
- elseif s:name =~# 'sed\>'
- set ft=sed
-
- " OCaml-scripts
- elseif s:name =~# 'ocaml'
- set ft=ocaml
-
- " Awk scripts; also finds "gawk"
- elseif s:name =~# 'awk\>'
- set ft=awk
-
- " Website MetaLanguage
- elseif s:name =~# 'wml'
- set ft=wml
-
- " Scheme scripts
- elseif s:name =~# 'scheme'
- set ft=scheme
-
- " CFEngine scripts
- elseif s:name =~# 'cfengine'
- set ft=cfengine
-
- " Erlang scripts
- elseif s:name =~# 'escript'
- set ft=erlang
-
- " Haskell
- elseif s:name =~# 'haskell'
- set ft=haskell
-
- " Scala
- elseif s:name =~# 'scala\>'
- set ft=scala
-
- " Clojure
- elseif s:name =~# 'clojure'
- set ft=clojure
-
- " Free Pascal
- elseif s:name =~# 'instantfpc\>'
- set ft=pascal
-
- " Fennel
- elseif s:name =~# 'fennel\>'
- set ft=fennel
-
- " MikroTik RouterOS script
- elseif s:name =~# 'rsc\>'
- set ft=routeros
-
- " Fish shell
- elseif s:name =~# 'fish\>'
- set ft=fish
-
- " Gforth
- elseif s:name =~# 'gforth\>'
- set ft=forth
-
- " Icon
- elseif s:name =~# 'icon\>'
- set ft=icon
-
- " Guile
- elseif s:name =~# 'guile'
- set ft=scheme
-
- endif
- unlet s:name
-
-else
- " File does not start with "#!".
-
- let s:line2 = getline(2)
- let s:line3 = getline(3)
- let s:line4 = getline(4)
- let s:line5 = getline(5)
-
- " Bourne-like shell scripts: sh ksh bash bash2
- if s:line1 =~# '^:$'
- call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim
-
- " Z shell scripts
- elseif s:line1 =~# '^#compdef\>' || s:line1 =~# '^#autoload\>' ||
- \ "\n".s:line1."\n".s:line2."\n".s:line3."\n".s:line4."\n".s:line5 =~# '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>'
- set ft=zsh
-
- " ELM Mail files
- elseif s:line1 =~# '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
- set ft=mail
-
- " Mason
- elseif s:line1 =~# '^<[%&].*>'
- set ft=mason
-
- " Vim scripts (must have '" vim' as the first line to trigger this)
- elseif s:line1 =~# '^" *[vV]im$'
- set ft=vim
-
- " libcxx and libstdc++ standard library headers like "iostream" do not have
- " an extension, recognize the Emacs file mode.
- elseif s:line1 =~? '-\*-.*C++.*-\*-'
- set ft=cpp
-
- " MOO
- elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
- set ft=moo
-
- " Diff file:
- " - "diff" in first line (context diff)
- " - "Only in " in first line
- " - "--- " in first line and "+++ " in second line (unified diff).
- " - "*** " in first line and "--- " in second line (context diff).
- " - "# It was generated by makepatch " in the second line (makepatch diff).
- " - "Index: <filename>" in the first line (CVS file)
- " - "=== ", line of "=", "---", "+++ " (SVK diff)
- " - "=== ", "--- ", "+++ " (bzr diff, common case)
- " - "=== (removed|added|renamed|modified)" (bzr diff, alternative)
- " - "# HG changeset patch" in first line (Mercurial export format)
- elseif s:line1 =~# '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)'
- \ || (s:line1 =~# '^--- ' && s:line2 =~# '^+++ ')
- \ || (s:line1 =~# '^\* looking for ' && s:line2 =~# '^\* comparing to ')
- \ || (s:line1 =~# '^\*\*\* ' && s:line2 =~# '^--- ')
- \ || (s:line1 =~# '^=== ' && ((s:line2 =~# '^=\{66\}' && s:line3 =~# '^--- ' && s:line4 =~# '^+++') || (s:line2 =~# '^--- ' && s:line3 =~# '^+++ ')))
- \ || (s:line1 =~# '^=== \(removed\|added\|renamed\|modified\)')
- set ft=diff
-
- " PostScript Files (must have %!PS as the first line, like a2ps output)
- elseif s:line1 =~# '^%![ \t]*PS'
- set ft=postscr
-
- " M4 scripts: Guess there is a line that starts with "dnl".
- elseif s:line1 =~# '^\s*dnl\>'
- \ || s:line2 =~# '^\s*dnl\>'
- \ || s:line3 =~# '^\s*dnl\>'
- \ || s:line4 =~# '^\s*dnl\>'
- \ || s:line5 =~# '^\s*dnl\>'
- set ft=m4
-
- " AmigaDos scripts
- elseif $TERM == "amiga"
- \ && (s:line1 =~# "^;" || s:line1 =~? '^\.bra')
- set ft=amiga
-
- " SiCAD scripts (must have procn or procd as the first line to trigger this)
- elseif s:line1 =~? '^ *proc[nd] *$'
- set ft=sicad
-
- " Purify log files start with "**** Purify"
- elseif s:line1 =~# '^\*\*\*\* Purify'
- set ft=purifylog
-
- " XML
- elseif s:line1 =~# '<?\s*xml.*?>'
- set ft=xml
-
- " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN")
- elseif s:line1 =~# '\<DTD\s\+XHTML\s'
- set ft=xhtml
-
- " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
- " Avoid "doctype html", used by slim.
- elseif s:line1 =~? '<!DOCTYPE\s\+html\>'
- set ft=html
-
- " PDF
- elseif s:line1 =~# '^%PDF-'
- set ft=pdf
-
- " XXD output
- elseif s:line1 =~# '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} '
- set ft=xxd
-
- " RCS/CVS log output
- elseif s:line1 =~# '^RCS file:' || s:line2 =~# '^RCS file:'
- set ft=rcslog
-
- " CVS commit
- elseif s:line2 =~# '^CVS:' || getline("$") =~# '^CVS: '
- set ft=cvs
-
- " Prescribe
- elseif s:line1 =~# '^!R!'
- set ft=prescribe
-
- " Send-pr
- elseif s:line1 =~# '^SEND-PR:'
- set ft=sendpr
-
- " SNNS files
- elseif s:line1 =~# '^SNNS network definition file'
- set ft=snnsnet
- elseif s:line1 =~# '^SNNS pattern definition file'
- set ft=snnspat
- elseif s:line1 =~# '^SNNS result file'
- set ft=snnsres
-
- " Virata
- elseif s:line1 =~# '^%.\{-}[Vv]irata'
- \ || s:line2 =~# '^%.\{-}[Vv]irata'
- \ || s:line3 =~# '^%.\{-}[Vv]irata'
- \ || s:line4 =~# '^%.\{-}[Vv]irata'
- \ || s:line5 =~# '^%.\{-}[Vv]irata'
- set ft=virata
-
- " Strace
- elseif s:line1 =~# '[0-9:.]* *execve(' || s:line1 =~# '^__libc_start_main'
- set ft=strace
-
- " VSE JCL
- elseif s:line1 =~# '^\* $$ JOB\>' || s:line1 =~# '^// *JOB\>'
- set ft=vsejcl
-
- " TAK and SINDA
- elseif s:line4 =~# 'K & K Associates' || s:line2 =~# 'TAK 2000'
- set ft=takout
- elseif s:line3 =~# 'S Y S T E M S I M P R O V E D '
- set ft=sindaout
- elseif getline(6) =~# 'Run Date: '
- set ft=takcmp
- elseif getline(9) =~# 'Node File 1'
- set ft=sindacmp
-
- " DNS zone files
- elseif s:line1.s:line2.s:line3.s:line4 =~# '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA'
- set ft=bindzone
-
- " BAAN
- elseif s:line1 =~# '|\*\{1,80}' && s:line2 =~# 'VRC '
- \ || s:line2 =~# '|\*\{1,80}' && s:line3 =~# 'VRC '
- set ft=baan
-
- " Valgrind
- elseif s:line1 =~# '^==\d\+== valgrind' || s:line3 =~# '^==\d\+== Using valgrind'
- set ft=valgrind
-
- " Go docs
- elseif s:line1 =~# '^PACKAGE DOCUMENTATION$'
- set ft=godoc
-
- " Renderman Interface Bytestream
- elseif s:line1 =~# '^##RenderMan'
- set ft=rib
-
- " Scheme scripts
- elseif s:line1 =~# 'exec\s\+\S*scheme' || s:line2 =~# 'exec\s\+\S*scheme'
- set ft=scheme
-
- " Git output
- elseif s:line1 =~# '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$'
- set ft=git
-
- " Gprof (gnu profiler)
- elseif s:line1 == 'Flat profile:'
- \ && s:line2 == ''
- \ && s:line3 =~# '^Each sample counts as .* seconds.$'
- set ft=gprof
-
- " Erlang terms
- " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes)
- elseif s:line1 =~? '-\*-.*erlang.*-\*-'
- set ft=erlang
-
- " YAML
- elseif s:line1 =~# '^%YAML'
- set ft=yaml
-
- " MikroTik RouterOS script
- elseif s:line1 =~# '^#.*by RouterOS.*$'
- set ft=routeros
-
- " Sed scripts
- " #ncomment is allowed but most likely a false positive so require a space
- " before any trailing comment text
- elseif s:line1 =~# '^#n\%($\|\s\)'
- set ft=sed
-
- " CVS diff
- else
- let s:lnum = 1
- while getline(s:lnum) =~# "^? " && s:lnum < line("$")
- let s:lnum += 1
- endwhile
- if getline(s:lnum) =~# '^Index:\s\+\f\+$'
- set ft=diff
-
- " locale input files: Formal Definitions of Cultural Conventions
- " filename must be like en_US, fr_FR@euro or en_US.UTF-8
- elseif expand("%") =~# '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
- let s:lnum = 1
- while s:lnum < 100 && s:lnum < line("$")
- if getline(s:lnum) =~# '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
- setf fdcc
- break
- endif
- let s:lnum += 1
- endwhile
- endif
- unlet s:lnum
-
- endif
-
- unlet s:line2 s:line3 s:line4 s:line5
-
-endif
-
-" Restore 'cpoptions'
-let &cpo = s:cpo_save
-
-unlet s:cpo_save s:line1
diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim
index ba9e6a198d..a664e7689d 100644
--- a/runtime/synmenu.vim
+++ b/runtime/synmenu.vim
@@ -2,7 +2,7 @@
" This file is normally sourced from menu.vim.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2017 Oct 28
+" Last Change: 2022 Oct 04
" Define the SetSyn function, used for the Syntax menu entries.
" Set 'filetype' and also 'syntax' if it is manually selected.
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index 890e9ae1a7..50878a78ea 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Apr 24
+" Last Change: 2022 Oct 05
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
diff --git a/runtime/syntax/markdown.vim b/runtime/syntax/markdown.vim
index 17b61c2fa4..44187ff18c 100644
--- a/runtime/syntax/markdown.vim
+++ b/runtime/syntax/markdown.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Markdown
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Maintainer: Tim Pope <https://github.com/tpope/vim-markdown>
" Filenames: *.markdown
-" Last Change: 2020 Jan 14
+" Last Change: 2022 Oct 13
if exists("b:current_syntax")
finish
@@ -12,6 +12,12 @@ if !exists('main_syntax')
let main_syntax = 'markdown'
endif
+if has('folding')
+ let s:foldmethod = &l:foldmethod
+ let s:foldtext = &l:foldtext
+endif
+let s:iskeyword = &l:iskeyword
+
runtime! syntax/html.vim
unlet! b:current_syntax
@@ -26,17 +32,33 @@ for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
if s:type =~ '\.'
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
endif
- exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
+ syn case match
+ exe 'syn include @markdownHighlight_'.tr(s:type,'.','_').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
unlet! b:current_syntax
let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type
unlet! s:done_include
+syn spell toplevel
+if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod
+ let &l:foldmethod = s:foldmethod
+ unlet s:foldmethod
+endif
+if exists('s:foldtext') && s:foldtext !=# &l:foldtext
+ let &l:foldtext = s:foldtext
+ unlet s:foldtext
+endif
+if s:iskeyword !=# &l:iskeyword
+ let &l:iskeyword = s:iskeyword
+endif
+unlet s:iskeyword
+
if !exists('g:markdown_minlines')
let g:markdown_minlines = 50
endif
execute 'syn sync minlines=' . g:markdown_minlines
+syn sync linebreaks=1
syn case ignore
syn match markdownValid '[<>]\c[a-z/$!]\@!' transparent contains=NONE
@@ -52,16 +74,16 @@ syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHea
syn match markdownHeadingRule "^[=-]\+$" contained
-syn region markdownH1 matchgroup=markdownH1Delimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
-syn region markdownH2 matchgroup=markdownH2Delimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
-syn region markdownH3 matchgroup=markdownH3Delimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
-syn region markdownH4 matchgroup=markdownH4Delimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
-syn region markdownH5 matchgroup=markdownH5Delimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
-syn region markdownH6 matchgroup=markdownH6Delimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH1 matchgroup=markdownH1Delimiter start=" \{,3}#\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH2 matchgroup=markdownH2Delimiter start=" \{,3}##\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH3 matchgroup=markdownH3Delimiter start=" \{,3}###\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH4 matchgroup=markdownH4Delimiter start=" \{,3}####\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH5 matchgroup=markdownH5Delimiter start=" \{,3}#####\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
+syn region markdownH6 matchgroup=markdownH6Delimiter start=" \{,3}######\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
-syn region markdownCodeBlock start=" \|\t" end="$" contained
+syn region markdownCodeBlock start="^\n\( \{4,}\|\t\)" end="^\ze \{,3}\S.*$" keepend
" TODO: real nesting
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
@@ -79,7 +101,7 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
-syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
+syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^][]*\%(\[\_[^][]*\]\_[^][]*\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
@@ -88,31 +110,38 @@ let s:concealends = ''
if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1
let s:concealends = ' concealends'
endif
-exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
-exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\w\@<!_\S\@=" end="\S\@<=_\w\@!" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
-exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" skip="\\\*" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
-exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\w\@<!__\S\@=" end="\S\@<=__\w\@!" skip="\\_" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
-exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
-exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\w\@<!___\S\@=" end="\S\@<=___\w\@!" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
+exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\*\S\@=" end="\S\@<=\*\|^$" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
+exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\w\@<!_\S\@=" end="\S\@<=_\w\@!\|^$" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
+exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\*\*\S\@=" end="\S\@<=\*\*\|^$" skip="\\\*" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
+exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\w\@<!__\S\@=" end="\S\@<=__\w\@!\|^$" skip="\\_" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
+exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\*\*\*\S\@=" end="\S\@<=\*\*\*\|^$" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
+exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\w\@<!___\S\@=" end="\S\@<=___\w\@!\|^$" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
+exe 'syn region markdownStrike matchgroup=markdownStrikeDelimiter start="\~\~\S\@=" end="\S\@<=\~\~\|^$" contains=markdownLineStart,@Spell' . s:concealends
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
-syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*````*.*$" end="^\s*````*\ze\s*$" keepend
+syn region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
+syn region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
syn match markdownFootnote "\[^[^\]]\+\]"
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
-if main_syntax ==# 'markdown'
- let s:done_include = {}
- for s:type in g:markdown_fenced_languages
- if has_key(s:done_include, matchstr(s:type,'[^.]*'))
- continue
- endif
- exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
- let s:done_include[matchstr(s:type,'[^.]*')] = 1
- endfor
- unlet! s:type
- unlet! s:done_include
+let s:done_include = {}
+for s:type in g:markdown_fenced_languages
+ if has_key(s:done_include, matchstr(s:type,'[^.]*'))
+ continue
+ endif
+ exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
+ exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
+ let s:done_include[matchstr(s:type,'[^.]*')] = 1
+endfor
+unlet! s:type
+unlet! s:done_include
+
+if get(b:, 'markdown_yaml_head', get(g:, 'markdown_yaml_head', main_syntax ==# 'markdown'))
+ syn include @markdownYamlTop syntax/yaml.vim
+ unlet! b:current_syntax
+ syn region markdownYamlHead start="\%^---$" end="^\%(---\|\.\.\.\)\s*$" keepend contains=@markdownYamlTop,@Spell
endif
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
@@ -156,6 +185,8 @@ hi def link markdownBold htmlBold
hi def link markdownBoldDelimiter markdownBold
hi def link markdownBoldItalic htmlBoldItalic
hi def link markdownBoldItalicDelimiter markdownBoldItalic
+hi def link markdownStrike htmlStrike
+hi def link markdownStrikeDelimiter markdownStrike
hi def link markdownCodeDelimiter Delimiter
hi def link markdownEscape Special
diff --git a/runtime/syntax/poefilter.vim b/runtime/syntax/poefilter.vim
new file mode 100644
index 0000000000..f7e92034ee
--- /dev/null
+++ b/runtime/syntax/poefilter.vim
@@ -0,0 +1,167 @@
+" Vim syntax file
+" Language: PoE item filter
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: *.filter
+" Last Change: 2022 Oct 07
+
+if exists('b:current_syntax')
+ finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+" Comment
+syn keyword poefilterTodo TODO NOTE XXX contained
+syn match poefilterCommentTag /\[[0-9A-Z\[\]]\+\]/ contained
+syn match poefilterComment /#.*$/ contains=poefilterTodo,poefilterCommentTag,@Spell
+
+" Blocks
+syn keyword poefilterBlock Show Hide
+
+" Conditions
+syn keyword poefilterCondition
+ \ AlternateQuality
+ \ AnyEnchantment
+ \ BlightedMap
+ \ Corrupted
+ \ ElderItem
+ \ ElderMap
+ \ FracturedItem
+ \ Identified
+ \ Mirrored
+ \ Replica
+ \ Scourged
+ \ ShapedMap
+ \ ShaperItem
+ \ SynthesisedItem
+ \ UberBlightedMap
+ \ skipwhite nextgroup=poefilterBoolean
+syn keyword poefilterCondition
+ \ ArchnemesisMod
+ \ BaseType
+ \ Class
+ \ EnchantmentPassiveNode
+ \ HasEnchantment
+ \ HasExplicitMod
+ \ ItemLevel
+ \ SocketGroup
+ \ Sockets
+ \ skipwhite nextgroup=poefilterOperator,poefilterString
+syn keyword poefilterCondition
+ \ AreaLevel
+ \ BaseArmour
+ \ BaseDefencePercentile
+ \ BaseEnergyShield
+ \ BaseEvasion
+ \ BaseWard
+ \ CorruptedMods
+ \ DropLevel
+ \ EnchantmentPassiveNum
+ \ GemLevel
+ \ HasEaterOfWorldsImplicit
+ \ HasSearingExarchImplicit
+ \ Height
+ \ LinkedSockets
+ \ MapTier
+ \ Quality
+ \ StackSize
+ \ Width
+ \ skipwhite nextgroup=poefilterOperator,poefilterNumber
+syn keyword poefilterCondition
+ \ GemQualityType
+ \ skipwhite nextgroup=poefilterString,poefilterQuality
+syn keyword poefilterCondition
+ \ HasInfluence
+ \ skipwhite nextgroup=poefilterString,poefilterInfluence
+syn keyword poefilterCondition
+ \ Rarity
+ \ skipwhite nextgroup=poefilterString,poefilterRarity
+
+" Actions
+syn keyword poefilterAction
+ \ PlayAlertSound
+ \ PlayAlertSoundPositional
+ \ skipwhite nextgroup=poefilterNumber,poefilterDisable
+syn keyword poefilterAction
+ \ CustomAlertSound
+ \ CustomAlertSoundOptional
+ \ skipwhite nextgroup=poefilterString
+syn keyword poefilterAction
+ \ DisableDropSound
+ \ EnableDropSound
+ \ DisableDropSoundIfAlertSound
+ \ EnableDropSoundIfAlertSound
+ \ skipwhite nextgroup=poefilterBoolean
+syn keyword poefilterAction
+ \ MinimapIcon
+ \ SetBackgroundColor
+ \ SetBorderColor
+ \ SetFontSize
+ \ SetTextColor
+ \ skipwhite nextgroup=poefilterNumber
+syn keyword poefilterAction
+ \ PlayEffect
+ \ skipwhite nextgroup=poefilterColour
+
+" Operators
+syn match poefilterOperator /!\|[<>=]=\?/ contained
+ \ skipwhite nextgroup=poefilterString,poefilterNumber,
+ \ poefilterQuality,poefilterRarity,poefilterInfluence
+
+" Arguments
+syn match poefilterString /[-a-zA-Z0-9:,']/ contained contains=@Spell
+ \ skipwhite nextgroup=poefilterString,poefilterNumber,
+ \ poefilterQuality,poefilterRarity,poefilterInfluence
+syn region poefilterString matchgroup=poefilterQuote keepend
+ \ start=/"/ end=/"/ concealends contained contains=@Spell
+ \ skipwhite nextgroup=poefilterString,poefilterNumber,
+ \ poefilterQuality,poefilterRarity,poefilterInfluence
+syn match poefilterNumber /-1\|0\|[1-9][0-9]*/ contained
+ \ skipwhite nextgroup=poefilterString,poefilterNumber,
+ \ poefilterQuality,poefilterRarity,poefilterInfluence,poefilterColour
+syn keyword poefilterBoolean True False contained
+
+" Special arguments (conditions)
+syn keyword poefilterQuality Superior Divergent Anomalous Phantasmal
+ \ contained skipwhite nextgroup=poefilterString,poefilterQuality
+syn keyword poefilterRarity Normal Magic Rare Unique
+ \ contained skipwhite nextgroup=poefilterString,poefilterRarity
+syn keyword poefilterInfluence Shaper Elder
+ \ Crusader Hunter Redeemer Warlord None
+ \ contained skipwhite nextgroup=poefilterString,poefilterInfluence
+
+" Special arguments (actions)
+syn keyword poefilterColour Red Green Blue Brown
+ \ White Yellow Cyan Grey Orange Pink Purple
+ \ contained skipwhite nextgroup=poefilterShape,poefilterTemp
+syn keyword poefilterShape Circle Diamond Hecagon Square Star Triangle
+ \ Cross Moon Raindrop Kite Pentagon UpsideDownHouse contained
+syn keyword poefilterDisable None contained
+syn keyword poefilterTemp Temp contained
+
+" Colours
+
+hi def link poefilterAction Statement
+hi def link poefilterBlock Structure
+hi def link poefilterBoolean Boolean
+hi def link poefilterColour Special
+hi def link poefilterComment Comment
+hi def link poefilterCommentTag SpecialComment
+hi def link poefilterCondition Conditional
+hi def link poefilterDisable Constant
+hi def link poefilterInfluence Special
+hi def link poefilterNumber Number
+hi def link poefilterOperator Operator
+hi def link poefilterQuality Special
+hi def link poefilterQuote Delimiter
+hi def link poefilterRarity Special
+hi def link poefilterShape Special
+hi def link poefilterString String
+hi def link poefilterTemp StorageClass
+hi def link poefilterTodo Todo
+
+let b:current_syntax = 'poefilter'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/sed.vim b/runtime/syntax/sed.vim
index 63b39db81f..d1f631df4b 100644
--- a/runtime/syntax/sed.vim
+++ b/runtime/syntax/sed.vim
@@ -1,30 +1,42 @@
" Vim syntax file
-" Language: sed
-" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
-" URL: http://folk.uio.no/hakonrk/vim/syntax/sed.vim
-" Last Change: 2010 May 29
+" Language: sed
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
+" Contributor: Jack Haden-Enneking
+" Last Change: 2022 Oct 15
" quit when a syntax file was already loaded
if exists("b:current_syntax")
- finish
+ finish
endif
+syn keyword sedTodo contained TODO FIXME XXX
+
syn match sedError "\S"
syn match sedWhitespace "\s\+" contained
syn match sedSemicolon ";"
syn match sedAddress "[[:digit:]$]"
syn match sedAddress "\d\+\~\d\+"
-syn region sedAddress matchgroup=Special start="[{,;]\s*/\(\\/\)\="lc=1 skip="[^\\]\(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
-syn region sedAddress matchgroup=Special start="^\s*/\(\\/\)\=" skip="[^\\]\(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
-syn match sedComment "^\s*#.*$"
-syn match sedFunction "[dDgGhHlnNpPqQx=]\s*\($\|;\)" contains=sedSemicolon,sedWhitespace
+syn region sedAddress matchgroup=Special start="[{,;]\s*/\%(\\/\)\="lc=1 skip="[^\\]\%(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
+syn region sedAddress matchgroup=Special start="^\s*/\%(\\/\)\=" skip="[^\\]\%(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
+syn match sedFunction "[dDgGhHlnNpPqQx=]\s*\%($\|;\)" contains=sedSemicolon,sedWhitespace
+if exists("g:sed_dialect") && g:sed_dialect ==? "bsd"
+ syn match sedComment "^\s*#.*$" contains=sedTodo
+else
+ syn match sedFunction "[dDgGhHlnNpPqQx=]\s*\ze#" contains=sedSemicolon,sedWhitespace
+ syn match sedComment "#.*$" contains=sedTodo
+endif
syn match sedLabel ":[^;]*"
-syn match sedLineCont "^\(\\\\\)*\\$" contained
-syn match sedLineCont "[^\\]\(\\\\\)*\\$"ms=e contained
+syn match sedLineCont "^\%(\\\\\)*\\$" contained
+syn match sedLineCont "[^\\]\%(\\\\\)*\\$"ms=e contained
syn match sedSpecial "[{},!]"
-if exists("highlight_sedtabs")
- syn match sedTab "\t" contained
+
+" continue to silently support the old name
+let s:highlight_tabs = v:false
+if exists("g:highlight_sedtabs") || get(g:, "sed_highlight_tabs", 0)
+ let s:highlight_tabs = v:true
+ syn match sedTab "\t" contained
endif
" Append/Change/Insert
@@ -34,39 +46,39 @@ syn region sedBranch matchgroup=sedFunction start="[bt]" matchgroup=sedSemicolon
syn region sedRW matchgroup=sedFunction start="[rw]" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace
" Substitution/transform with various delimiters
-syn region sedFlagwrite matchgroup=sedFlag start="w" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace contained
-syn match sedFlag "[[:digit:]gpI]*w\=" contains=sedFlagwrite contained
+syn region sedFlagWrite matchgroup=sedFlag start="w" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace contained
+syn match sedFlag "[[:digit:]gpI]*w\=" contains=sedFlagWrite contained
syn match sedRegexpMeta "[.*^$]" contained
syn match sedRegexpMeta "\\." contains=sedTab contained
syn match sedRegexpMeta "\[.\{-}\]" contains=sedTab contained
syn match sedRegexpMeta "\\{\d\*,\d*\\}" contained
-syn match sedRegexpMeta "\\(.\{-}\\)" contains=sedTab contained
-syn match sedReplaceMeta "&\|\\\($\|.\)" contains=sedTab contained
+syn match sedRegexpMeta "\\%(.\{-}\\)" contains=sedTab contained
+syn match sedReplaceMeta "&\|\\\%($\|.\)" contains=sedTab contained
" Metacharacters: $ * . \ ^ [ ~
" @ is used as delimiter and treated on its own below
-let __at = char2nr("@")
-let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64
+let s:at = char2nr("@")
+let s:i = char2nr(" ") " ASCII: 32, EBCDIC: 64
if has("ebcdic")
- let __sed_last = 255
+ let s:last = 255
else
- let __sed_last = 126
+ let s:last = 126
endif
-let __sed_metacharacters = '$*.\^[~'
-while __sed_i <= __sed_last
- let __sed_delimiter = escape(nr2char(__sed_i), __sed_metacharacters)
- if __sed_i != __at
- exe 'syn region sedAddress matchgroup=Special start=@\\'.__sed_delimiter.'\(\\'.__sed_delimiter.'\)\=@ skip=@[^\\]\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'I\=@ contains=sedTab'
- exe 'syn region sedRegexp'.__sed_i 'matchgroup=Special start=@'.__sed_delimiter.'\(\\\\\|\\'.__sed_delimiter.'\)*@ skip=@[^\\'.__sed_delimiter.']\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'@me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement'.__sed_i
- exe 'syn region sedReplacement'.__sed_i 'matchgroup=Special start=@'.__sed_delimiter.'\(\\\\\|\\'.__sed_delimiter.'\)*@ skip=@[^\\'.__sed_delimiter.']\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'@ contains=sedTab,sedReplaceMeta keepend contained nextgroup=sedFlag'
- endif
- let __sed_i = __sed_i + 1
+let s:metacharacters = '$*.\^[~'
+while s:i <= s:last
+ let s:delimiter = escape(nr2char(s:i), s:metacharacters)
+ if s:i != s:at
+ exe 'syn region sedAddress matchgroup=Special start=@\\'.s:delimiter.'\%(\\'.s:delimiter.'\)\=@ skip=@[^\\]\%(\\\\\)*\\'.s:delimiter.'@ end=@'.s:delimiter.'[IM]\=@ contains=sedTab'
+ exe 'syn region sedRegexp'.s:i 'matchgroup=Special start=@'.s:delimiter.'\%(\\\\\|\\'.s:delimiter.'\)*@ skip=@[^\\'.s:delimiter.']\%(\\\\\)*\\'.s:delimiter.'@ end=@'.s:delimiter.'@me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement'.s:i
+ exe 'syn region sedReplacement'.s:i 'matchgroup=Special start=@'.s:delimiter.'\%(\\\\\|\\'.s:delimiter.'\)*@ skip=@[^\\'.s:delimiter.']\%(\\\\\)*\\'.s:delimiter.'@ end=@'.s:delimiter.'@ contains=sedTab,sedReplaceMeta keepend contained nextgroup=@sedFlags'
+ endif
+ let s:i = s:i + 1
endwhile
-syn region sedAddress matchgroup=Special start=+\\@\(\\@\)\=+ skip=+[^\\]\(\\\\\)*\\@+ end=+@I\=+ contains=sedTab,sedRegexpMeta
-syn region sedRegexp64 matchgroup=Special start=+@\(\\\\\|\\@\)*+ skip=+[^\\@]\(\\\\\)*\\@+ end=+@+me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement64
-syn region sedReplacement64 matchgroup=Special start=+@\(\\\\\|\\@\)*+ skip=+[^\\@]\(\\\\\)*\\@+ end=+@+ contains=sedTab,sedReplaceMeta keepend contained nextgroup=sedFlag
+syn region sedAddress matchgroup=Special start=+\\@\%(\\@\)\=+ skip=+[^\\]\%(\\\\\)*\\@+ end=+@I\=+ contains=sedTab,sedRegexpMeta
+syn region sedRegexp64 matchgroup=Special start=+@\%(\\\\\|\\@\)*+ skip=+[^\\@]\%(\\\\\)*\\@+ end=+@+me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement64
+syn region sedReplacement64 matchgroup=Special start=+@\%(\\\\\|\\@\)*+ skip=+[^\\@]\%(\\\\\)*\\@+ end=+@+ contains=sedTab,sedReplaceMeta keepend contained nextgroup=sedFlag
-" Since the syntax for the substituion command is very similar to the
+" Since the syntax for the substitution command is very similar to the
" syntax for the transform command, I use the same pattern matching
" for both commands. There is one problem -- the transform command
" (y) does not allow any flags. To save memory, I ignore this problem.
@@ -80,7 +92,7 @@ hi def link sedComment Comment
hi def link sedDelete Function
hi def link sedError Error
hi def link sedFlag Type
-hi def link sedFlagwrite Constant
+hi def link sedFlagWrite Constant
hi def link sedFunction Function
hi def link sedLabel Label
hi def link sedLineCont Special
@@ -88,23 +100,24 @@ hi def link sedPutHoldspc Function
hi def link sedReplaceMeta Special
hi def link sedRegexpMeta Special
hi def link sedRW Constant
-hi def link sedSemicolon Special
+hi def link sedSemicolon Special
hi def link sedST Function
hi def link sedSpecial Special
+hi def link sedTodo Todo
hi def link sedWhitespace NONE
-if exists("highlight_sedtabs")
-hi def link sedTab Todo
+if s:highlight_tabs
+ hi def link sedTab Todo
endif
-let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64
-while __sed_i <= __sed_last
-exe "hi def link sedRegexp".__sed_i "Macro"
-exe "hi def link sedReplacement".__sed_i "NONE"
-let __sed_i = __sed_i + 1
+let s:i = char2nr(" ") " ASCII: 32, EBCDIC: 64
+while s:i <= s:last
+ exe "hi def link sedRegexp".s:i "Macro"
+ exe "hi def link sedReplacement".s:i "NONE"
+ let s:i = s:i + 1
endwhile
-
-unlet __sed_i __sed_last __sed_delimiter __sed_metacharacters
+unlet s:i s:last s:delimiter s:metacharacters s:at
+unlet s:highlight_tabs
let b:current_syntax = "sed"
-" vim: sts=4 sw=4 ts=8
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/syntax/ssa.vim b/runtime/syntax/ssa.vim
new file mode 100644
index 0000000000..a5dbf37c30
--- /dev/null
+++ b/runtime/syntax/ssa.vim
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language: SubStation Alpha
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: *.ass,*.ssa
+" Last Change: 2022 Oct 10
+
+if exists('b:current_syntax')
+ finish
+endif
+
+" Comments
+syn keyword ssaTodo TODO FIXME NOTE XXX contained
+syn match ssaComment /^\(;\|!:\).*$/ contains=ssaTodo,@Spell
+syn match ssaTextComment /{[^}]*}/ contained contains=@Spell
+
+" Sections
+syn match ssaSection /^\[[a-zA-Z0-9+ ]\+\]$/
+
+" Headers
+syn match ssaHeader /^[^;!:]\+:/ skipwhite nextgroup=ssaField
+
+" Fields
+syn match ssaField /[^,]*/ contained skipwhite nextgroup=ssaDelimiter
+
+" Time
+syn match ssaTime /\d:\d\d:\d\d\.\d\d/ contained skipwhite nextgroup=ssaDelimiter
+
+" Delimiter
+syn match ssaDelimiter /,/ contained skipwhite nextgroup=ssaField,ssaTime,ssaText
+
+" Text
+syn match ssaText /\(^Dialogue:\(.*,\)\{9}\)\@<=.*$/ contained contains=@ssaTags,@Spell
+syn cluster ssaTags contains=ssaOverrideTag,ssaEscapeChar,ssaTextComment,ssaItalics,ssaBold,ssaUnderline,ssaStrikeout
+
+" Override tags
+syn match ssaOverrideTag /{\\[^}]\+}/ contained contains=@NoSpell
+
+" Special characters
+syn match ssaEscapeChar /\\[nNh{}]/ contained contains=@NoSpell
+
+" Markup
+syn region ssaItalics start=/{\\i1}/ end=/{\\i0}/ matchgroup=ssaOverrideTag keepend oneline contained contains=@ssaTags,@Spell
+syn region ssaBold start=/{\\b1}/ end=/{\\b0}/ matchgroup=ssaOverrideTag keepend oneline contained contains=@ssaTags,@Spell
+syn region ssaUnderline start=/{\\u1}/ end=/{\\u0}/ matchgroup=ssaOverrideTag keepend oneline contained contains=@ssaTags,@Spell
+syn region ssaStrikeout start=/{\\s1}/ end=/{\\s0}/ matchgroup=ssaOverrideTag keepend oneline contained contains=@ssaTags,@Spell
+
+hi def link ssaDelimiter Delimiter
+hi def link ssaComment Comment
+hi def link ssaEscapeChar SpecialChar
+hi def link ssaField String
+hi def link ssaHeader Label
+hi def link ssaSection StorageClass
+hi def link ssaOverrideTag Special
+hi def link ssaTextComment Comment
+hi def link ssaTime Number
+hi def link ssaTodo Todo
+
+hi ssaBold cterm=bold gui=bold
+hi ssaItalics cterm=italic gui=italic
+hi ssaStrikeout cterm=strikethrough gui=strikethrough
+hi ssaUnderline cterm=underline gui=underline
+
+let b:current_syntax = 'srt'
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index f824feb856..fbade1b4f7 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -195,6 +195,10 @@ preprocess_patch() {
local na_src='auto\|configure.*\|GvimExt\|libvterm\|proto\|tee\|VisVim\|xpm\|xxd\|Make.*\|INSTALL.*\|beval.*\|gui.*\|if_cscop\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv'
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%(testdir/\)\@<!\%('"${na_src}"'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file"
+ # Remove runtime files ported to Lua.
+ local na_rt='filetype\.vim\|scripts\.vim\|autoload\/ft\/dist\.vim'
+ 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/\<\%('"${na_rt}"'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file"
+
# Remove unwanted Vim doc files.
local na_doc='channel\.txt\|if_cscop\.txt\|netbeans\.txt\|os_\w\+\.txt\|term\.txt\|todo\.txt\|version\d\.txt\|vim9\.txt\|sponsor\.txt\|intro\.txt\|tags'
2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\<\%('"${na_doc}"'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file"
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 29b00bad2a..84ff2fa59b 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1959,8 +1959,9 @@ void free_buf_options(buf_T *buf, int free_p_ff)
clear_string_option(&buf->b_p_ft);
clear_string_option(&buf->b_p_cink);
clear_string_option(&buf->b_p_cino);
- clear_string_option(&buf->b_p_cinw);
+ clear_string_option(&buf->b_p_lop);
clear_string_option(&buf->b_p_cinsd);
+ clear_string_option(&buf->b_p_cinw);
clear_string_option(&buf->b_p_cpt);
clear_string_option(&buf->b_p_cfu);
clear_string_option(&buf->b_p_ofu);
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 630e1d14a8..043a31bf16 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -699,6 +699,7 @@ struct file_buffer {
uint32_t b_p_fex_flags; ///< flags for 'formatexpr'
char *b_p_kp; ///< 'keywordprg'
int b_p_lisp; ///< 'lisp'
+ char *b_p_lop; ///< 'lispoptions'
char *b_p_menc; ///< 'makeencoding'
char *b_p_mps; ///< 'matchpairs'
int b_p_ml; ///< 'modeline'
diff --git a/src/nvim/change.c b/src/nvim/change.c
index c6f9e9f5c2..2424a8a2eb 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -1814,17 +1814,19 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
vreplace_mode = 0;
}
- if (!p_paste
- && leader == NULL
- && curbuf->b_p_lisp
- && curbuf->b_p_ai) {
- // do lisp indenting
- fixthisline(get_lisp_indent);
- ai_col = (colnr_T)getwhitecols_curline();
- } else if (do_cindent) {
- // do 'cindent' or 'indentexpr' indenting
- do_c_expr_indent();
- ai_col = (colnr_T)getwhitecols_curline();
+ if (!p_paste) {
+ if (leader == NULL
+ && !use_indentexpr_for_lisp()
+ && curbuf->b_p_lisp
+ && curbuf->b_p_ai) {
+ // do lisp indenting
+ fixthisline(get_lisp_indent);
+ ai_col = (colnr_T)getwhitecols_curline();
+ } else if (do_cindent || (curbuf->b_p_ai && use_indentexpr_for_lisp())) {
+ // do 'cindent' or 'indentexpr' indenting
+ do_c_expr_indent();
+ ai_col = (colnr_T)getwhitecols_curline();
+ }
}
if (vreplace_mode != 0) {
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 0e14567286..e37f967a2c 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -2993,34 +2993,6 @@ bool cindent_on(void)
return !p_paste && (curbuf->b_p_cin || *curbuf->b_p_inde != NUL);
}
-// Re-indent the current line, based on the current contents of it and the
-// surrounding lines. Fixing the cursor position seems really easy -- I'm very
-// confused what all the part that handles Control-T is doing that I'm not.
-// "get_the_indent" should be get_c_indent, get_expr_indent or get_lisp_indent.
-void fixthisline(IndentGetter get_the_indent)
-{
- int amount = get_the_indent();
-
- if (amount >= 0) {
- change_indent(INDENT_SET, amount, false, 0, true);
- if (linewhite(curwin->w_cursor.lnum)) {
- did_ai = true; // delete the indent if the line stays empty
- }
- }
-}
-
-void fix_indent(void)
-{
- if (p_paste) {
- return;
- }
- if (curbuf->b_p_lisp && curbuf->b_p_ai) {
- fixthisline(get_lisp_indent);
- } else if (cindent_on()) {
- do_c_expr_indent();
- }
-}
-
/// Check that "cinkeys" contains the key "keytyped",
/// when == '*': Only if key is preceded with '*' (indent before insert)
/// when == '!': Only if key is preceded with '!' (don't insert)
diff --git a/src/nvim/edit.h b/src/nvim/edit.h
index eda6d8c9db..91c519f015 100644
--- a/src/nvim/edit.h
+++ b/src/nvim/edit.h
@@ -4,8 +4,6 @@
#include "nvim/autocmd.h"
#include "nvim/vim.h"
-typedef int (*IndentGetter)(void);
-
// Values for in_cinkeys()
#define KEY_OPEN_FORW 0x101
#define KEY_OPEN_BACK 0x102
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 3f5a8afbc1..3f08aa7043 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -15,6 +15,7 @@
#include "nvim/eval.h"
#include "nvim/extmark.h"
#include "nvim/indent.h"
+#include "nvim/indent_c.h"
#include "nvim/mark.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
@@ -1144,3 +1145,45 @@ static int lisp_match(char_u *p)
}
return false;
}
+
+/// Re-indent the current line, based on the current contents of it and the
+/// surrounding lines. Fixing the cursor position seems really easy -- I'm very
+/// confused what all the part that handles Control-T is doing that I'm not.
+/// "get_the_indent" should be get_c_indent, get_expr_indent or get_lisp_indent.
+void fixthisline(IndentGetter get_the_indent)
+{
+ int amount = get_the_indent();
+
+ if (amount >= 0) {
+ change_indent(INDENT_SET, amount, false, 0, true);
+ if (linewhite(curwin->w_cursor.lnum)) {
+ did_ai = true; // delete the indent if the line stays empty
+ }
+ }
+}
+
+/// Return true if 'indentexpr' should be used for Lisp indenting.
+/// Caller may want to check 'autoindent'.
+bool use_indentexpr_for_lisp(void)
+{
+ return curbuf->b_p_lisp
+ && *curbuf->b_p_inde != NUL
+ && strcmp(curbuf->b_p_lop, "expr:1") == 0;
+}
+
+/// Fix indent for 'lisp' and 'cindent'.
+void fix_indent(void)
+{
+ if (p_paste) {
+ return; // no auto-indenting when 'paste' is set
+ }
+ if (curbuf->b_p_lisp && curbuf->b_p_ai) {
+ if (use_indentexpr_for_lisp()) {
+ do_c_expr_indent();
+ } else {
+ fixthisline(get_lisp_indent);
+ }
+ } else if (cindent_on()) {
+ do_c_expr_indent();
+ }
+}
diff --git a/src/nvim/indent.h b/src/nvim/indent.h
index f96732bf1c..f807bbb42b 100644
--- a/src/nvim/indent.h
+++ b/src/nvim/indent.h
@@ -3,6 +3,8 @@
#include "nvim/vim.h"
+typedef int (*IndentGetter)(void);
+
// flags for set_indent()
#define SIN_CHANGED 1 // call changed_bytes() when line changed
#define SIN_INSERT 2 // insert indent before existing text
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 8b2fea9535..29008200a7 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3370,6 +3370,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
// adjust '] mark
curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1;
curbuf->b_op_end.col = bd.textcol + (colnr_T)totlen - 1;
+ if (curbuf->b_op_end.col < 0) {
+ curbuf->b_op_end.col = 0;
+ }
curbuf->b_op_end.coladd = 0;
if (flags & PUT_CURSEND) {
colnr_T len;
@@ -6203,7 +6206,11 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
// If 'equalprg' is empty, do the indenting internally.
if (oap->op_type == OP_INDENT && *get_equalprg() == NUL) {
if (curbuf->b_p_lisp) {
- op_reindent(oap, get_lisp_indent);
+ if (use_indentexpr_for_lisp()) {
+ op_reindent(oap, get_expr_indent);
+ } else {
+ op_reindent(oap, get_lisp_indent);
+ }
break;
}
op_reindent(oap,
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 7202156c46..0b819aad43 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4008,6 +4008,8 @@ static char_u *get_varp(vimoption_T *p)
return (char_u *)&(curbuf->b_p_fex);
case PV_LISP:
return (char_u *)&(curbuf->b_p_lisp);
+ case PV_LOP:
+ return (char_u *)&(curbuf->b_p_lop);
case PV_ML:
return (char_u *)&(curbuf->b_p_ml);
case PV_MPS:
@@ -4414,6 +4416,8 @@ void buf_copy_options(buf_T *buf, int flags)
COPY_OPT_SCTX(buf, BV_CINO);
buf->b_p_cinsd = xstrdup(p_cinsd);
COPY_OPT_SCTX(buf, BV_CINSD);
+ buf->b_p_lop = xstrdup(p_lop);
+ COPY_OPT_SCTX(buf, BV_LOP);
// Don't copy 'filetype', it must be detected
buf->b_p_ft = empty_option;
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 196ab865a2..c4333a6f61 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -580,6 +580,7 @@ EXTERN char_u *p_lm; // 'langmenu'
EXTERN long p_lines; // 'lines'
EXTERN long p_linespace; // 'linespace'
EXTERN int p_lisp; ///< 'lisp'
+EXTERN char *p_lop; ///< 'lispoptions'
EXTERN char_u *p_lispwords; // 'lispwords'
EXTERN long p_ls; // 'laststatus'
EXTERN long p_stal; // 'showtabline'
@@ -878,6 +879,7 @@ enum {
BV_KMAP,
BV_KP,
BV_LISP,
+ BV_LOP,
BV_LW,
BV_MENC,
BV_MA,
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index f4d6c808fa..8a883a09c3 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1364,6 +1364,14 @@ return {
defaults={if_true=false}
},
{
+ full_name='lispoptions', abbreviation='lop',
+ short_desc=N_("options for lisp indenting"),
+ type='string', list='onecomma', scope={'buffer'},
+ deny_duplicates=true,
+ varname='p_lop', pv_name='p_lop',
+ defaults={if_true=''}
+ },
+ {
full_name='lispwords', abbreviation='lw',
short_desc=N_("words that change how lisp indenting works"),
type='string', list='onecomma', scope={'global', 'buffer'},
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index be3e137b69..43628d2842 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -228,6 +228,7 @@ void check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_cink);
check_string_option(&buf->b_p_cino);
parse_cino(buf);
+ check_string_option(&buf->b_p_lop);
check_string_option(&buf->b_p_ft);
check_string_option(&buf->b_p_cinw);
check_string_option(&buf->b_p_cinsd);
@@ -1378,6 +1379,10 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf
} else if (gvarp == &p_cino) { // 'cinoptions'
// TODO(vim): recognize errors
parse_cino(curbuf);
+ } else if (gvarp == &p_lop) { // 'lispoptions'
+ if (**varp != NUL && strcmp(*varp, "expr:0") != 0 && strcmp(*varp, "expr:1") != 0) {
+ errmsg = e_invarg;
+ }
} else if (varp == &p_icm) { // 'inccommand'
if (check_opt_strings(p_icm, p_icm_values, false) != OK) {
errmsg = e_invarg;
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 7669b3d82a..1ceab2a67a 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -1768,6 +1768,11 @@ func Test_cls_file()
call assert_equal('tex', &filetype)
bwipe!
+ call writefile(['\NeedsTeXFormat{LaTeX2e}'], 'Xfile.cls')
+ split Xfile.cls
+ call assert_equal('tex', &filetype)
+ bwipe!
+
" Rexx
call writefile(['# rexx'], 'Xfile.cls')
diff --git a/src/nvim/testdir/test_legacy_filetype.vim b/src/nvim/testdir/test_legacy_filetype.vim
deleted file mode 100644
index 772faaadb0..0000000000
--- a/src/nvim/testdir/test_legacy_filetype.vim
+++ /dev/null
@@ -1,4 +0,0 @@
-let g:do_legacy_filetype = 1
-filetype on
-
-source test_filetype.vim
diff --git a/src/nvim/testdir/test_lispindent.vim b/src/nvim/testdir/test_lispindent.vim
index 8987f67a80..2d6060bba3 100644
--- a/src/nvim/testdir/test_lispindent.vim
+++ b/src/nvim/testdir/test_lispindent.vim
@@ -97,8 +97,23 @@ func Test_lispindent_with_indentexpr()
exe "normal a(x\<CR>1\<CR>2)\<Esc>"
let expected = ['(x', ' 1', ' 2)']
call assert_equal(expected, getline(1, 3))
+ " with Lisp indenting the first line is not indented
normal 1G=G
call assert_equal(expected, getline(1, 3))
+
+ %del
+ setl lispoptions=expr:1 indentexpr=5
+ exe "normal a(x\<CR>1\<CR>2)\<Esc>"
+ let expected_expr = ['(x', ' 1', ' 2)']
+ call assert_equal(expected_expr, getline(1, 3))
+ normal 2G2<<=G
+ call assert_equal(expected_expr, getline(1, 3))
+
+ setl lispoptions=expr:0
+ " with Lisp indenting the first line is not indented
+ normal 1G3<<=G
+ call assert_equal(expected, getline(1, 3))
+
bwipe!
endfunc
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index 65665d36c0..7fb34ec81f 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -474,6 +474,18 @@ func Test_visual_block_put()
bw!
endfunc
+func Test_visual_block_put_invalid()
+ enew!
+ behave mswin
+ norm yy
+ norm v)Ps/^/
+ " this was causing the column to become negative
+ silent norm ggv)P
+
+ bwipe!
+ behave xterm
+endfunc
+
" Visual modes (v V CTRL-V) followed by an operator; count; repeating
func Test_visual_mode_op()
new
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d4d406482d..32e15f200a 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2228,6 +2228,9 @@ void intro_message(int colon)
N_("type :q<Enter> to exit "),
N_("type :help<Enter> for help "),
"",
+ N_("type :help news<Enter> to see changes in")
+ " v" STR(NVIM_VERSION_MAJOR) "." STR(NVIM_VERSION_MINOR) "." STR(NVIM_VERSION_PATCH),
+ "",
N_("Help poor children in Uganda!"),
N_("type :help iccf<Enter> for information "),
};
diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua
index ba66117fb1..e5a60f5cb1 100644
--- a/test/functional/plugin/health_spec.lua
+++ b/test/functional/plugin/health_spec.lua
@@ -227,7 +227,7 @@ describe('health.vim', function()
|
{Heading:success1: health#success1#check} |
{Bar:========================================================================}|
- {Heading2:##}{Heading: report 1} |
+ {Heading2:## }{Heading:report 1} |
{Bullet: -} {Ok:OK}: everything is fine |
|
]]}
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 0898d7fe75..8ab25d0102 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1263,7 +1263,6 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~ }|
{1:~ }|
- {1:~ }|
{MATCH:.*}|
{1:~ }|
{1:~ }Nvim is open source and freely distributable{1: }|
@@ -1274,6 +1273,8 @@ describe('ui/ext_messages', function()
{1:~ }type :q{5:<Enter>} to exit {1: }|
{1:~ }type :help{5:<Enter>} for help {1: }|
{1:~ }|
+ {1:~ }type :help news{5:<Enter>} to see changes in v{MATCH:.*}|
+ {1:~ }|
{MATCH:.*}|
{MATCH:.*}|
{1:~ }|
@@ -1281,7 +1282,6 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~ }|
{1:~ }|
- {1:~ }|
]])
feed("<c-l>")
@@ -1319,7 +1319,6 @@ describe('ui/ext_messages', function()
|
|
|
- |
{MATCH:.*}|
|
Nvim is open source and freely distributable |
@@ -1330,6 +1329,8 @@ describe('ui/ext_messages', function()
type :q{5:<Enter>} to exit |
type :help{5:<Enter>} for help |
|
+ type :help news{5:<Enter>} to see changes in {MATCH:.*}|
+ |
{MATCH:.*}|
{MATCH:.*}|
|
@@ -1337,7 +1338,6 @@ describe('ui/ext_messages', function()
|
|
|
- |
]], messages={
{content = { { "Press ENTER or type command to continue", 4 } }, kind = "return_prompt" }
}}