aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/ftplugin/abap.vim4
-rw-r--r--runtime/ftplugin/art.vim3
-rw-r--r--runtime/ftplugin/asm.vim6
-rw-r--r--runtime/ftplugin/bzl.vim5
-rw-r--r--runtime/ftplugin/dune.vim7
-rw-r--r--runtime/ftplugin/fish.vim3
-rw-r--r--runtime/ftplugin/hare.vim34
-rw-r--r--runtime/ftplugin/ishd.vim23
-rw-r--r--runtime/ftplugin/lprolog.vim12
-rw-r--r--runtime/ftplugin/nginx.vim3
-rw-r--r--runtime/ftplugin/pbtxt.vim8
-rw-r--r--runtime/ftplugin/scala.vim3
-rw-r--r--runtime/ftplugin/sexplib.vim3
-rw-r--r--runtime/ftplugin/usd.vim8
-rw-r--r--runtime/ftplugin/vhdl.vim76
-rw-r--r--runtime/indent/ch.vim3
-rw-r--r--runtime/indent/dune.vim3
-rw-r--r--runtime/indent/fish.vim3
-rw-r--r--runtime/indent/go.vim3
-rw-r--r--runtime/indent/hare.vim3
-rw-r--r--runtime/indent/jsonc.vim3
-rw-r--r--runtime/indent/julia.vim5
-rw-r--r--runtime/indent/logtalk.vim3
-rw-r--r--runtime/indent/ocaml.vim5
-rw-r--r--runtime/indent/php.vim3
-rw-r--r--runtime/indent/raku.vim3
-rw-r--r--runtime/indent/rst.vim3
-rw-r--r--runtime/indent/rust.vim3
-rw-r--r--runtime/indent/scala.vim3
-rw-r--r--runtime/indent/tex.vim4
-rw-r--r--runtime/indent/typescript.vim3
-rw-r--r--runtime/indent/verilog.vim3
-rw-r--r--runtime/indent/vhdl.vim3
33 files changed, 185 insertions, 72 deletions
diff --git a/runtime/ftplugin/abap.vim b/runtime/ftplugin/abap.vim
index 956b002ecd..61db8093fb 100644
--- a/runtime/ftplugin/abap.vim
+++ b/runtime/ftplugin/abap.vim
@@ -3,6 +3,7 @@
" Author: Steven Oliver <oliver.steven@gmail.com>
" Copyright: Copyright (c) 2013 Steven Oliver
" License: You may redistribute this under the same terms as Vim itself
+" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin)
" --------------------------------------------------------------------------
" Only do this when not done yet for this buffer
@@ -17,10 +18,13 @@ set cpo&vim
setlocal softtabstop=2 shiftwidth=2
setlocal suffixesadd=.abap
+let b:undo_ftplugin = "setl sts< sua< sw<"
+
" Windows allows you to filter the open file dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
\ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin .= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/art.vim b/runtime/ftplugin/art.vim
index c501a992d8..41b02a94e5 100644
--- a/runtime/ftplugin/art.vim
+++ b/runtime/ftplugin/art.vim
@@ -3,6 +3,7 @@
" Maintainer: Dorai Sitaram <ds26@gte.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: Apr 2, 2003
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -13,3 +14,5 @@ run ftplugin/lisp.vim
setl lw-=if
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while
+
+let b:undo_ftplugin ..= " | setl lw<"
diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim
index 0914bf634a..f6a92d57d7 100644
--- a/runtime/ftplugin/asm.vim
+++ b/runtime/ftplugin/asm.vim
@@ -1,11 +1,13 @@
" Vim filetype plugin file
" Language: asm
" Maintainer: Colin Caine <cmcaine at the common googlemail domain>
-" Last Changed: 23 May 2020
+" Last Change: 23 May 2020
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
setl comments=:;,s1:/*,mb:*,ex:*/,://
setl commentstring=;%s
-let b:did_ftplugin = 1
+let b:undo_ftplugin = "setl commentstring< comments<"
diff --git a/runtime/ftplugin/bzl.vim b/runtime/ftplugin/bzl.vim
index 8ab876e9d6..716b3890b1 100644
--- a/runtime/ftplugin/bzl.vim
+++ b/runtime/ftplugin/bzl.vim
@@ -2,6 +2,7 @@
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2021 Jan 19
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
""
" @section Introduction, intro
@@ -41,6 +42,9 @@ let &l:tabstop = s:save_tabstop
setlocal formatoptions-=t
+" Initially defined in the python ftplugin sourced above
+let b:undo_ftplugin .= " | setlocal fo<"
+
" Make gf work with imports in BUILD files.
setlocal includeexpr=substitute(v:fname,'//','','')
@@ -48,6 +52,7 @@ setlocal includeexpr=substitute(v:fname,'//','','')
if get(g:, 'ft_bzl_fold', 0)
setlocal foldmethod=syntax
setlocal foldtext=BzlFoldText()
+ let b:undo_ftplugin .= " | setlocal fdm< fdt<"
endif
if exists('*BzlFoldText')
diff --git a/runtime/ftplugin/dune.vim b/runtime/ftplugin/dune.vim
index 86c99c097f..6e20a8fabb 100644
--- a/runtime/ftplugin/dune.vim
+++ b/runtime/ftplugin/dune.vim
@@ -3,8 +3,9 @@
" Anton Kochkov <anton.kochkov@gmail.com>
" URL: https://github.com/ocaml/vim-ocaml
" Last Change:
-" 2018 Nov 3 - Added commentstring (Markus Mottl)
-" 2017 Sep 6 - Initial version (Etienne Millon)
+" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
+" 2018 Nov 03 - Added commentstring (Markus Mottl)
+" 2017 Sep 06 - Initial version (Etienne Millon)
if exists("b:did_ftplugin")
finish
@@ -18,3 +19,5 @@ setl commentstring=;\ %s
setl comments=:;
setl iskeyword+=#,?,.,/
+
+let b:undo_ftplugin = "setl lisp< cms< com< isk<"
diff --git a/runtime/ftplugin/fish.vim b/runtime/ftplugin/fish.vim
index 7acbf44210..f06ad3a0bf 100644
--- a/runtime/ftplugin/fish.vim
+++ b/runtime/ftplugin/fish.vim
@@ -3,6 +3,7 @@
" Maintainer: Nicholas Boyle (github.com/nickeb96)
" Repository: https://github.com/nickeb96/fish.vim
" Last Change: February 1, 2023
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
if exists("b:did_ftplugin")
finish
@@ -13,3 +14,5 @@ setlocal iskeyword=@,48-57,_,192-255,-,.
setlocal comments=:#
setlocal commentstring=#%s
setlocal formatoptions+=crjq
+
+let b:undo_ftplugin = "setl cms< com< fo< isk<"
diff --git a/runtime/ftplugin/hare.vim b/runtime/ftplugin/hare.vim
index bb10daf38c..0200ba5913 100644
--- a/runtime/ftplugin/hare.vim
+++ b/runtime/ftplugin/hare.vim
@@ -2,26 +2,34 @@
" Language: Hare
" Maintainer: Amelia Clarke <me@rsaihe.dev>
" Previous Maintainer: Drew DeVault <sir@cmpwn.com>
-" Last Updated: 2022-09-21
+" Last Updated: 2022-09-28
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
-" Only do this when not done yet for this buffer
if exists('b:did_ftplugin')
finish
endif
-
-" Don't load another plugin for this buffer
let b:did_ftplugin = 1
-setlocal noexpandtab
-setlocal tabstop=8
-setlocal shiftwidth=0
-setlocal softtabstop=0
-setlocal textwidth=80
+" Formatting settings.
+setlocal formatoptions-=t formatoptions+=croql/
+
+" Miscellaneous.
+setlocal comments=://
setlocal commentstring=//\ %s
+setlocal suffixesadd=.ha
-" Set 'formatoptions' to break comment lines but not other lines,
-" and insert the comment leader when hitting <CR> or using "o".
-setlocal fo-=t fo+=croql
+let b:undo_ftplugin = "setl cms< com< fo< sua<"
+
+" Hare recommended style.
+if get(g:, "hare_recommended_style", 1)
+ setlocal noexpandtab
+ setlocal shiftwidth=8
+ setlocal softtabstop=0
+ setlocal tabstop=8
+ setlocal textwidth=80
+ let b:undo_ftplugin ..= " | setl et< sts< sw< ts< tw<"
+endif
compiler hare
-" vim: tabstop=2 shiftwidth=2 expandtab
+
+" vim: et sw=2 sts=2 ts=8
diff --git a/runtime/ftplugin/ishd.vim b/runtime/ftplugin/ishd.vim
index 33ef1510b5..b160349033 100644
--- a/runtime/ftplugin/ishd.vim
+++ b/runtime/ftplugin/ishd.vim
@@ -1,32 +1,37 @@
" Vim filetype plugin file
-" Language: InstallShield (ft=ishd)
-" Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: Sat, 24 May 2003 11:55:36 CEST
+" Language: InstallShield (ft=ishd)
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: 2023 Aug 28
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
-setlocal foldmethod=syntax
-
" Using line continuation here.
let s:cpo_save = &cpo
set cpo-=C
+setlocal foldmethod=syntax
+
+let b:undo_ftplugin = "setl fdm<"
+
" matchit support
if exists("loaded_matchit")
- let b:match_ignorecase=0
- let b:match_words=
+ let b:match_ignorecase = 0
+ let b:match_words =
\ '\%(^\s*\)\@<=\<function\>\s\+[^()]\+\s*(:\%(^\s*\)\@<=\<begin\>\s*$:\%(^\s*\)\@<=\<return\>:\%(^\s*\)\@<=\<end\>\s*;\s*$,' .
\ '\%(^\s*\)\@<=\<repeat\>\s*$:\%(^\s*\)\@<=\<until\>\s\+.\{-}\s*;\s*$,' .
\ '\%(^\s*\)\@<=\<switch\>\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\<endswitch\>\s*;\s*$,' .
\ '\%(^\s*\)\@<=\<while\>\s*(.\{-}):\%(^\s*\)\@<=\<endwhile\>\s*;\s*$,' .
\ '\%(^\s*\)\@<=\<for\>.\{-}\<\%(to\|downto\)\>:\%(^\s*\)\@<=\<endfor\>\s*;\s*$,' .
\ '\%(^\s*\)\@<=\<if\>\s*(.\{-})\s*then:\%(^\s*\)\@<=\<else\s*if\>\s*([^)]*)\s*then:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<endif\>\s*;\s*$'
+ let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words"
endif
-if has("gui_win32") && !exists("b:browsefilter")
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "InstallShield Files (*.rul)\t*.rul\n" .
- \ "All Files (*.*)\t*.*\n"
+ \ "All Files (*.*)\t*\n"
+ let b:undo_ftplugin .= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim
index a8a3c612c1..1075a9c813 100644
--- a/runtime/ftplugin/lprolog.vim
+++ b/runtime/ftplugin/lprolog.vim
@@ -2,7 +2,8 @@
" Language: LambdaProlog (Teyjus)
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
" URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
-" Last Change: 2006 Feb 05
+" Last Change: 2023 Aug 28 - added undo_ftplugin (Vim Project)
+" 2006 Feb 05
" 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
" 2001 Sep 02 - initial release (MM)
@@ -15,11 +16,13 @@ endif
let b:did_ftplugin = 1
" Error format
-setlocal efm=%+A./%f:%l.%c:\ %m formatprg=fmt\ -w75\ -p\\%
+setlocal efm=%+A./%f:%l.%c:\ %m
" Formatting of comments
setlocal formatprg=fmt\ -w75\ -p\\%
+let b:undo_ftplugin = "setlocal efm< fp<"
+
" Add mappings, unless the user didn't want this.
if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
" Uncommenting
@@ -28,6 +31,11 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
vmap <buffer> <LocalLeader>c <Plug>BUncomOn
nmap <buffer> <LocalLeader>C <Plug>LUncomOff
vmap <buffer> <LocalLeader>C <Plug>BUncomOff
+ let b:undo_ftplugin ..=
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>c'" ..
+ \ " | silent! execute 'vunmap <buffer> <LocalLeader>c'" ..
+ \ " | silent! execute 'nunmap <buffer> <LocalLeader>C'" ..
+ \ " | silent! execute 'vunmap <buffer> <LocalLeader>C'"
endif
nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
diff --git a/runtime/ftplugin/nginx.vim b/runtime/ftplugin/nginx.vim
index e808db1277..525d0fdccf 100644
--- a/runtime/ftplugin/nginx.vim
+++ b/runtime/ftplugin/nginx.vim
@@ -2,5 +2,8 @@
" Language: nginx.conf
" Maintainer: Chris Aumann <me@chr4.org>
" Last Change: Apr 15, 2017
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
setlocal commentstring=#\ %s
+
+let b:undo_ftplugin = "setlocal commentstring<"
diff --git a/runtime/ftplugin/pbtxt.vim b/runtime/ftplugin/pbtxt.vim
index e3c1bf7650..56c2553ca8 100644
--- a/runtime/ftplugin/pbtxt.vim
+++ b/runtime/ftplugin/pbtxt.vim
@@ -2,20 +2,16 @@
" Language: Protobuf Text Format
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
" Last Change: 2020 Nov 17
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
" Homepage: https://github.com/lakshayg/vim-pbtxt
if exists("b:did_ftplugin")
finish
endif
-
let b:did_ftplugin = 1
-let s:cpo_save = &cpo
-set cpo&vim
-
setlocal commentstring=#\ %s
-let &cpo = s:cpo_save
-unlet s:cpo_save
+let b:undo_ftplugin = "setlocal commentstring<"
" vim: nowrap sw=2 sts=2 ts=8 noet
diff --git a/runtime/ftplugin/scala.vim b/runtime/ftplugin/scala.vim
index b484df99f3..769499cfc1 100644
--- a/runtime/ftplugin/scala.vim
+++ b/runtime/ftplugin/scala.vim
@@ -4,6 +4,7 @@
" URL: https://github.com/derekwyatt/vim-scala
" License: Same as Vim
" Last Change: 11 August 2021
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
" ----------------------------------------------------------------------------
if exists('b:did_ftplugin') || &cp
@@ -32,4 +33,6 @@ setlocal includeexpr=substitute(v:fname,'\\.','/','g')
setlocal path+=src/main/scala,src/test/scala
setlocal suffixesadd=.scala
+let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<"
+
" vim:set sw=2 sts=2 ts=8 et:
diff --git a/runtime/ftplugin/sexplib.vim b/runtime/ftplugin/sexplib.vim
index 27e1b28370..b0767ef559 100644
--- a/runtime/ftplugin/sexplib.vim
+++ b/runtime/ftplugin/sexplib.vim
@@ -3,6 +3,7 @@
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
" URL: https://github.com/ocaml/vim-ocaml
" Last Change:
+" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
" 2017 Apr 12 - First version (MM)
if exists("b:did_ftplugin")
@@ -13,3 +14,5 @@ let b:did_ftplugin=1
" Comment string
setl commentstring=;\ %s
setl comments=:;
+
+let b:undo_ftplugin = "setl cms< com<"
diff --git a/runtime/ftplugin/usd.vim b/runtime/ftplugin/usd.vim
index c795ba591b..cd5013f960 100644
--- a/runtime/ftplugin/usd.vim
+++ b/runtime/ftplugin/usd.vim
@@ -2,17 +2,13 @@
" Language: Pixar Animation's Universal Scene Description format
" Maintainer: Colin Kennedy <colinvfx@gmail.com>
" Last Change: 2023 May 9
+" 2023 Aug 28 by Vim Project (undo_ftplugin)
if exists("b:did_ftplugin")
finish
endif
-
-let s:cpo_save = &cpo
-set cpo&vim
-
let b:did_ftplugin = 1
setlocal commentstring=#\ %s
-let &cpo = s:cpo_save
-unlet s:cpo_save
+let b:undo_ftplugin = "setlocal commentstring<"
diff --git a/runtime/ftplugin/vhdl.vim b/runtime/ftplugin/vhdl.vim
index 0249b542be..ff56166ebe 100644
--- a/runtime/ftplugin/vhdl.vim
+++ b/runtime/ftplugin/vhdl.vim
@@ -3,6 +3,7 @@
" Maintainer: R.Shankar <shankar.pec?gmail.com>
" Modified By: Gerald Lai <laigera+vim?gmail.com>
" Last Change: 2011 Dec 11
+" 2023 Aug 28 by Vim Project (undo_ftplugin, commentstring)
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -22,13 +23,20 @@ set cpo&vim
" Set 'comments' to format dashed lists in comments.
"setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+setlocal commentstring=--\ %s
+
" Format comments to be up to 78 characters long
"setlocal tw=75
+" let b:undo_ftplugin = "setl cms< com< fo< tw<"
+
+let b:undo_ftplugin = "setl cms< "
+
" Win32 can filter files in the browse dialog
"if has("gui_win32") && !exists("b:browsefilter")
" let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
" \ "All Files (*.*)\t*.*\n"
+" let b:undo_ftplugin .= " | unlet! b:browsefilter"
"endif
" Let the matchit plugin know what items can be matched.
@@ -52,37 +60,49 @@ if ! exists("b:match_words") && exists("loaded_matchit")
\ s:notend.'\<package\>:\<end\s\+package\>,'.
\ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
\ s:notend.'\<configuration\>:\<end\s\+configuration\>'
+ let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words"
endif
-" count repeat
-function! <SID>CountWrapper(cmd)
- let i = v:count1
- if a:cmd[0] == ":"
- while i > 0
- execute a:cmd
- let i = i - 1
- endwhile
- else
- execute "normal! gv\<Esc>"
- execute "normal ".i.a:cmd
- let curcol = col(".")
- let curline = line(".")
- normal! gv
- call cursor(curline, curcol)
- endif
-endfunction
+if !exists("no_plugin_maps") && !exists("no_vhdl_maps")
+ " count repeat
+ function! <SID>CountWrapper(cmd)
+ let i = v:count1
+ if a:cmd[0] == ":"
+ while i > 0
+ execute a:cmd
+ let i = i - 1
+ endwhile
+ else
+ execute "normal! gv\<Esc>"
+ execute "normal ".i.a:cmd
+ let curcol = col(".")
+ let curline = line(".")
+ normal! gv
+ call cursor(curline, curcol)
+ endif
+ endfunction
-" explore motion
-" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
-let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
-noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
-noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
-noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
-noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
-vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
-vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
-vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
-vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
+ " explore motion
+ " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
+ let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
+ noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
+ noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
+ noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
+ noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
+ vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
+ vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
+ vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
+ vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
+ let b:undo_ftplugin .=
+ \ " | silent! execute 'nunmap <buffer> [['" .
+ \ " | silent! execute 'nunmap <buffer> ]]'" .
+ \ " | silent! execute 'nunmap <buffer> []'" .
+ \ " | silent! execute 'nunmap <buffer> ]['" .
+ \ " | silent! execute 'vunmap <buffer> [['" .
+ \ " | silent! execute 'vunmap <buffer> ]]'" .
+ \ " | silent! execute 'vunmap <buffer> []'" .
+ \ " | silent! execute 'vunmap <buffer> ]['"
+endif
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/indent/ch.vim b/runtime/indent/ch.vim
index e1bd8a356c..11b1f67790 100644
--- a/runtime/indent/ch.vim
+++ b/runtime/indent/ch.vim
@@ -3,6 +3,7 @@
" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
" URL: http://www.softintegration.com/download/vim/indent/ch.vim
" Last change: 2006 Apr 30
+" 2023 Aug 28 by Vim Project (undo_indent)
" Created based on cpp.vim
"
" Ch is a C/C++ interpreter with many high level extensions
@@ -16,3 +17,5 @@ let b:did_indent = 1
" Ch indenting is built-in, thus this is very simple
setlocal cindent
+
+let b:undo_indent = "setlocal cindent<"
diff --git a/runtime/indent/dune.vim b/runtime/indent/dune.vim
index 0590d66d13..a9349e4e04 100644
--- a/runtime/indent/dune.vim
+++ b/runtime/indent/dune.vim
@@ -3,6 +3,7 @@
" Maintainers: Markus Mottl <markus.mottl@gmail.com>
" URL: https://github.com/ocaml/vim-ocaml
" Last Change: 2021 Jan 01
+" 2023 Aug 28 by Vim Project (undo_indent)
if exists("b:did_indent")
finish
@@ -11,3 +12,5 @@ let b:did_indent = 1
" dune format-dune-file uses 1 space to indent
setlocal softtabstop=1 shiftwidth=1 expandtab
+
+let b:undo_indent = "setl et< sts< sw<"
diff --git a/runtime/indent/fish.vim b/runtime/indent/fish.vim
index 7455287ec0..e7678cb7c8 100644
--- a/runtime/indent/fish.vim
+++ b/runtime/indent/fish.vim
@@ -3,6 +3,7 @@
" Maintainer: Nicholas Boyle (github.com/nickeb96)
" Repository: https://github.com/nickeb96/fish.vim
" Last Change: February 4, 2023
+" 2023 Aug 28 by Vim Project (undo_indent)
if exists("b:did_indent")
finish
@@ -12,6 +13,8 @@ let b:did_indent = 1
setlocal indentexpr=GetFishIndent(v:lnum)
setlocal indentkeys+==end,=else,=case
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
+
function s:PrevCmdStart(linenum)
let l:linenum = a:linenum
" look for the first line that isn't a line continuation
diff --git a/runtime/indent/go.vim b/runtime/indent/go.vim
index bf9ff75e6c..a9b1d8d19b 100644
--- a/runtime/indent/go.vim
+++ b/runtime/indent/go.vim
@@ -2,6 +2,7 @@
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2017 Jun 13
+" 2023 Aug 28 by Vim Project (undo_indent)
"
" TODO:
" - function invocations split across lines
@@ -19,6 +20,8 @@ setlocal autoindent
setlocal indentexpr=GoIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=)
+let b:undo_indent = "setl ai< inde< indk< lisp<"
+
if exists('*GoIndent')
finish
endif
diff --git a/runtime/indent/hare.vim b/runtime/indent/hare.vim
index bc4fea4e61..0a9d8dafd8 100644
--- a/runtime/indent/hare.vim
+++ b/runtime/indent/hare.vim
@@ -2,6 +2,7 @@
" Language: Hare
" Maintainer: Amelia Clarke <me@rsaihe.dev>
" Last Change: 2022 Sep 22
+" 2023 Aug 28 by Vim Project (undo_indent)
if exists("b:did_indent")
finish
@@ -40,6 +41,8 @@ setlocal cinwords=if,else,for,switch,match
setlocal indentexpr=GetHareIndent()
+let b:undo_indent = "setl cin< cino< cinw< inde< indk<"
+
function! FloorCindent(lnum)
return cindent(a:lnum) / shiftwidth() * shiftwidth()
endfunction
diff --git a/runtime/indent/jsonc.vim b/runtime/indent/jsonc.vim
index bf8e501dd5..058634a6d2 100644
--- a/runtime/indent/jsonc.vim
+++ b/runtime/indent/jsonc.vim
@@ -4,6 +4,7 @@
" Acknowledgement: Based off of vim-json maintained by Eli Parra <eli@elzr.com>
" https://github.com/elzr/vim-json
" Last Change: 2021-07-01
+" 2023 Aug 28 by Vim Project (undo_indent)
" 0. Initialization {{{1
" =================
@@ -20,6 +21,8 @@ setlocal nosmartindent
setlocal indentexpr=GetJSONCIndent()
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
+let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<"
+
" Only define the function once.
if exists("*GetJSONCIndent")
finish
diff --git a/runtime/indent/julia.vim b/runtime/indent/julia.vim
index 8e4c60322e..36f39f6652 100644
--- a/runtime/indent/julia.vim
+++ b/runtime/indent/julia.vim
@@ -3,7 +3,8 @@
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
" Homepage: https://github.com/JuliaEditorSupport/julia-vim
" Last Change: 2022 Jun 14
-" Notes: originally based on Bram Molenaar's indent file for vim
+" 2023 Aug 28 by Vim Project (undo_indent)
+" Notes: originally based on Bram Moolenaar's indent file for vim
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -21,6 +22,8 @@ setlocal indentkeys-=0{
setlocal indentkeys-=0}
setlocal nosmartindent
+let b:undo_indent = "setl ai< inde< indk< si<"
+
" Only define the function once.
if exists("*GetJuliaIndent")
finish
diff --git a/runtime/indent/logtalk.vim b/runtime/indent/logtalk.vim
index 8e36f86115..f7a8b0387c 100644
--- a/runtime/indent/logtalk.vim
+++ b/runtime/indent/logtalk.vim
@@ -1,5 +1,6 @@
" Maintainer: Paulo Moura <pmoura@logtalk.org>
" Revised on: 2018.08.04
+" 2023 Aug 28 by Vim Project (undo_indent)
" Language: Logtalk
" This Logtalk indent file is a modified version of the Prolog
@@ -16,6 +17,8 @@ setlocal indentexpr=GetLogtalkIndent()
setlocal indentkeys-=:,0#
setlocal indentkeys+=0%,-,0;,>,0)
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
+
" Only define the function once.
if exists("*GetLogtalkIndent")
finish
diff --git a/runtime/indent/ocaml.vim b/runtime/indent/ocaml.vim
index 19c81f49c4..c9beb8be0b 100644
--- a/runtime/indent/ocaml.vim
+++ b/runtime/indent/ocaml.vim
@@ -4,7 +4,8 @@
" Mike Leary <leary@nwlink.com>
" Markus Mottl <markus.mottl@gmail.com>
" URL: https://github.com/ocaml/vim-ocaml
-" Last Change: 2017 Jun 13
+" Last Change: 2023 Aug 28 - Add undo_indent (Vim Project)
+" 2017 Jun 13
" 2005 Jun 25 - Fixed multiple bugs due to 'else\nreturn ind' working
" 2005 May 09 - Added an option to not indent OCaml-indents specially (MM)
" 2013 June - commented textwidth (Marc Weber)
@@ -24,6 +25,8 @@ setlocal indentkeys+=0=and,0=class,0=constraint,0=done,0=else,0=end,0=exception,
setlocal nolisp
setlocal nosmartindent
+let b:undo_indent = "setl et< inde< indk< lisp< si<"
+
" At least Marc Weber and Markus Mottl do not like this:
" setlocal textwidth=80
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index 6b3d700059..350accaa11 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -4,6 +4,7 @@
" URL: https://www.2072productions.com/vim/indent/php.vim
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2020 Mar 05
+" 2023 Aug 28 by Vim Project (undo_indent)
" Version: 1.70
"
"
@@ -128,7 +129,7 @@ setlocal nolisp
setlocal indentexpr=GetPhpIndent()
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
-
+let b:undo_indent = "setl ai< cin< inde< indk< lisp< si<"
let s:searchpairflags = 'bWr'
diff --git a/runtime/indent/raku.vim b/runtime/indent/raku.vim
index 3f9b49ec77..753a2b04be 100644
--- a/runtime/indent/raku.vim
+++ b/runtime/indent/raku.vim
@@ -4,6 +4,7 @@
" Homepage: https://github.com/vim-perl/vim-perl
" Bugs/requests: https://github.com/vim-perl/vim-perl/issues
" Last Change: 2020 Apr 15
+" 2023 Aug 28 by Vim Project (undo_indent)
" Contributors: Andy Lester <andy@petdance.com>
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
@@ -47,6 +48,8 @@ if !b:indent_use_syntax
setlocal indentkeys+=0=EO
endif
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
+
let s:cpo_save = &cpo
set cpo-=C
diff --git a/runtime/indent/rst.vim b/runtime/indent/rst.vim
index a31ad8e080..e3c10865a6 100644
--- a/runtime/indent/rst.vim
+++ b/runtime/indent/rst.vim
@@ -4,6 +4,7 @@
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2020-03-31
+" 2023 Aug 28 by Vim Project (undo_indent)
if exists("b:did_indent")
finish
@@ -14,6 +15,8 @@ setlocal indentexpr=GetRSTIndent()
setlocal indentkeys=!^F,o,O
setlocal nosmartindent
+let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<"
+
if exists("*GetRSTIndent")
finish
endif
diff --git a/runtime/indent/rust.vim b/runtime/indent/rust.vim
index 2b544f4a67..b27d93c3a2 100644
--- a/runtime/indent/rust.vim
+++ b/runtime/indent/rust.vim
@@ -2,6 +2,7 @@
" Language: Rust
" Author: Chris Morgan <me@chrismorgan.info>
" Last Change: 2017 Jun 13
+" 2023 Aug 28 by Vim Project (undo_indent)
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" Only load this indent file when no other was loaded.
@@ -24,6 +25,8 @@ setlocal indentkeys=0{,0},!^F,o,O,0[,0]
setlocal indentexpr=GetRustIndent(v:lnum)
+let b:undo_indent = "setlocal cindent< cinoptions< cinkeys< cinwords< lisp< autoindent< indentkeys< indentexpr<"
+
" Only define the function once.
if exists("*GetRustIndent")
finish
diff --git a/runtime/indent/scala.vim b/runtime/indent/scala.vim
index b5eba29543..c6aba4e388 100644
--- a/runtime/indent/scala.vim
+++ b/runtime/indent/scala.vim
@@ -4,6 +4,7 @@
" Modifications By: Derek Wyatt
" URL: https://github.com/derekwyatt/vim-scala
" Last Change: 2016 Aug 26
+" 2023 Aug 28 by Vim Project (undo_indent)
if exists("b:did_indent")
finish
@@ -14,6 +15,8 @@ setlocal autoindent
setlocal indentexpr=GetScalaIndent()
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
+let b:undo_indent = "setl ai< inde< indk<"
+
if exists("*GetScalaIndent")
finish
endif
diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim
index d356ba905b..68d13fb116 100644
--- a/runtime/indent/tex.vim
+++ b/runtime/indent/tex.vim
@@ -67,7 +67,8 @@
" 2020/04/26 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix a bug related to \[ & \]. Thanks Manuel Boni for
" reporting.
-"
+" 2023/08/28 by Vim Project
+" (*) Set b:undo_indent.
" }}}
" Document: {{{
@@ -167,6 +168,7 @@ setlocal indentexpr=GetTeXIndent()
setlocal indentkeys&
exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g')
let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '')
+let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys< smartindent<"
" }}}
function! GetTeXIndent() " {{{
diff --git a/runtime/indent/typescript.vim b/runtime/indent/typescript.vim
index e899f83d0f..e26750b8aa 100644
--- a/runtime/indent/typescript.vim
+++ b/runtime/indent/typescript.vim
@@ -2,6 +2,7 @@
" Language: TypeScript
" Maintainer: See https://github.com/HerringtonDarkholme/yats.vim
" Last Change: 2019 Oct 18
+" 2023 Aug 28 by Vim Project (undo_indent)
" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org
" 0. Initialization {{{1
@@ -20,6 +21,8 @@ setlocal indentexpr=GetTypescriptIndent()
setlocal formatexpr=Fixedgq(v:lnum,v:count)
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
+let b:undo_indent = "setlocal formatexpr< indentexpr< indentkeys< smartindent<"
+
" Only define the function once.
if exists("*GetTypescriptIndent")
finish
diff --git a/runtime/indent/verilog.vim b/runtime/indent/verilog.vim
index e81197c3b4..377615c348 100644
--- a/runtime/indent/verilog.vim
+++ b/runtime/indent/verilog.vim
@@ -1,6 +1,7 @@
" Language: Verilog HDL
" Maintainer: Chih-Tsun Huang <cthuang@cs.nthu.edu.tw>
" Last Change: 2017 Aug 25 by Chih-Tsun Huang
+" 2023 Aug 28 by Vim Project (undo_indent)
" URL: http://www.cs.nthu.edu.tw/~cthuang/vim/indent/verilog.vim
"
" Credits:
@@ -28,6 +29,8 @@ setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify
setlocal indentkeys+==endconfig,=endgenerate,=endprimitive,=endtable
setlocal indentkeys+==`else,=`elsif,=`endif
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
+
" Only define the function once.
if exists("*GetVerilogIndent")
finish
diff --git a/runtime/indent/vhdl.vim b/runtime/indent/vhdl.vim
index ad318066f4..b01d1156e9 100644
--- a/runtime/indent/vhdl.vim
+++ b/runtime/indent/vhdl.vim
@@ -3,6 +3,7 @@
" Maintainer: Gerald Lai <laigera+vim?gmail.com>
" Version: 1.62
" Last Change: 2017 Oct 17
+" 2023 Aug 28 by Vim Project (undo_indent)
" URL: http://www.vim.org/scripts/script.php?script_id=1450
" only load this indent file when no other was loaded
@@ -19,6 +20,8 @@ setlocal indentkeys+==~if,=~then,=~elsif,=~else
setlocal indentkeys+==~case,=~loop,=~for,=~generate,=~record,=~units,=~process,=~block,=~function,=~component,=~procedure
setlocal indentkeys+==~architecture,=~configuration,=~entity,=~package
+let b:undo_indent = "setlocal indentexpr< indentkeys<"
+
" constants
" not a comment
let s:NC = '\%(--.*\)\@<!'