mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
runtime: Set b:undo_ftplugin where missing (#12943)
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
fe1463674c
commit
f937ab32a1
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -158,6 +158,7 @@ runtime/ftplugin/html.vim @dkearns
|
|||||||
runtime/ftplugin/i3config.vim @hiqua
|
runtime/ftplugin/i3config.vim @hiqua
|
||||||
runtime/ftplugin/icon.vim @dkearns
|
runtime/ftplugin/icon.vim @dkearns
|
||||||
runtime/ftplugin/indent.vim @dkearns
|
runtime/ftplugin/indent.vim @dkearns
|
||||||
|
runtime/ftplugin/ishd.vim @dkearns
|
||||||
runtime/ftplugin/j.vim @glts
|
runtime/ftplugin/j.vim @glts
|
||||||
runtime/ftplugin/javascript.vim @dkearns
|
runtime/ftplugin/javascript.vim @dkearns
|
||||||
runtime/ftplugin/javascriptreact.vim @dkearns
|
runtime/ftplugin/javascriptreact.vim @dkearns
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
" Author: Steven Oliver <oliver.steven@gmail.com>
|
" Author: Steven Oliver <oliver.steven@gmail.com>
|
||||||
" Copyright: Copyright (c) 2013 Steven Oliver
|
" Copyright: Copyright (c) 2013 Steven Oliver
|
||||||
" License: You may redistribute this under the same terms as Vim itself
|
" 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
|
" Only do this when not done yet for this buffer
|
||||||
@ -17,10 +18,13 @@ set cpo&vim
|
|||||||
setlocal softtabstop=2 shiftwidth=2
|
setlocal softtabstop=2 shiftwidth=2
|
||||||
setlocal suffixesadd=.abap
|
setlocal suffixesadd=.abap
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl sts< sua< sw<"
|
||||||
|
|
||||||
" Windows allows you to filter the open file dialog
|
" Windows allows you to filter the open file dialog
|
||||||
if has("gui_win32") && !exists("b:browsefilter")
|
if has("gui_win32") && !exists("b:browsefilter")
|
||||||
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
|
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
|
||||||
\ "All Files (*.*)\t*.*\n"
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
" Maintainer: Dorai Sitaram <ds26@gte.com>
|
" Maintainer: Dorai Sitaram <ds26@gte.com>
|
||||||
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
|
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
|
||||||
" Last Change: Apr 2, 2003
|
" Last Change: Apr 2, 2003
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
@ -13,3 +14,5 @@ run ftplugin/lisp.vim
|
|||||||
|
|
||||||
setl lw-=if
|
setl lw-=if
|
||||||
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while
|
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while
|
||||||
|
|
||||||
|
let b:undo_ftplugin ..= " | setl lw<"
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: asm
|
" Language: asm
|
||||||
" Maintainer: Colin Caine <cmcaine at the common googlemail domain>
|
" 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
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setl comments=:;,s1:/*,mb:*,ex:*/,://
|
setl comments=:;,s1:/*,mb:*,ex:*/,://
|
||||||
setl commentstring=;%s
|
setl commentstring=;%s
|
||||||
|
|
||||||
let b:did_ftplugin = 1
|
let b:undo_ftplugin = "setl commentstring< comments<"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
" Language: Bazel (http://bazel.io)
|
" Language: Bazel (http://bazel.io)
|
||||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||||
" Last Change: 2021 Jan 19
|
" Last Change: 2021 Jan 19
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
|
|
||||||
""
|
""
|
||||||
" @section Introduction, intro
|
" @section Introduction, intro
|
||||||
@ -41,6 +42,9 @@ let &l:tabstop = s:save_tabstop
|
|||||||
|
|
||||||
setlocal formatoptions-=t
|
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.
|
" Make gf work with imports in BUILD files.
|
||||||
setlocal includeexpr=substitute(v:fname,'//','','')
|
setlocal includeexpr=substitute(v:fname,'//','','')
|
||||||
|
|
||||||
@ -48,6 +52,7 @@ setlocal includeexpr=substitute(v:fname,'//','','')
|
|||||||
if get(g:, 'ft_bzl_fold', 0)
|
if get(g:, 'ft_bzl_fold', 0)
|
||||||
setlocal foldmethod=syntax
|
setlocal foldmethod=syntax
|
||||||
setlocal foldtext=BzlFoldText()
|
setlocal foldtext=BzlFoldText()
|
||||||
|
let b:undo_ftplugin .= " | setlocal fdm< fdt<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('*BzlFoldText')
|
if exists('*BzlFoldText')
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
" Anton Kochkov <anton.kochkov@gmail.com>
|
" Anton Kochkov <anton.kochkov@gmail.com>
|
||||||
" URL: https://github.com/ocaml/vim-ocaml
|
" URL: https://github.com/ocaml/vim-ocaml
|
||||||
" Last Change:
|
" Last Change:
|
||||||
" 2018 Nov 3 - Added commentstring (Markus Mottl)
|
" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
|
||||||
" 2017 Sep 6 - Initial version (Etienne Millon)
|
" 2018 Nov 03 - Added commentstring (Markus Mottl)
|
||||||
|
" 2017 Sep 06 - Initial version (Etienne Millon)
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -18,3 +19,5 @@ setl commentstring=;\ %s
|
|||||||
setl comments=:;
|
setl comments=:;
|
||||||
|
|
||||||
setl iskeyword+=#,?,.,/
|
setl iskeyword+=#,?,.,/
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl lisp< cms< com< isk<"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
" Maintainer: Nicholas Boyle (github.com/nickeb96)
|
" Maintainer: Nicholas Boyle (github.com/nickeb96)
|
||||||
" Repository: https://github.com/nickeb96/fish.vim
|
" Repository: https://github.com/nickeb96/fish.vim
|
||||||
" Last Change: February 1, 2023
|
" Last Change: February 1, 2023
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -13,3 +14,5 @@ setlocal iskeyword=@,48-57,_,192-255,-,.
|
|||||||
setlocal comments=:#
|
setlocal comments=:#
|
||||||
setlocal commentstring=#%s
|
setlocal commentstring=#%s
|
||||||
setlocal formatoptions+=crjq
|
setlocal formatoptions+=crjq
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< com< fo< isk<"
|
||||||
|
@ -2,26 +2,34 @@
|
|||||||
" Language: Hare
|
" Language: Hare
|
||||||
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
" Maintainer: Amelia Clarke <me@rsaihe.dev>
|
||||||
" Previous Maintainer: Drew DeVault <sir@cmpwn.com>
|
" 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')
|
if exists('b:did_ftplugin')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Don't load another plugin for this buffer
|
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal noexpandtab
|
" Formatting settings.
|
||||||
setlocal tabstop=8
|
setlocal formatoptions-=t formatoptions+=croql/
|
||||||
setlocal shiftwidth=0
|
|
||||||
setlocal softtabstop=0
|
|
||||||
setlocal textwidth=80
|
|
||||||
setlocal commentstring=//\ %s
|
|
||||||
|
|
||||||
" Set 'formatoptions' to break comment lines but not other lines,
|
" Miscellaneous.
|
||||||
" and insert the comment leader when hitting <CR> or using "o".
|
setlocal comments=://
|
||||||
setlocal fo-=t fo+=croql
|
setlocal commentstring=//\ %s
|
||||||
|
setlocal suffixesadd=.ha
|
||||||
|
|
||||||
|
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
|
compiler hare
|
||||||
" vim: tabstop=2 shiftwidth=2 expandtab
|
|
||||||
|
" vim: et sw=2 sts=2 ts=8
|
||||||
|
@ -1,32 +1,37 @@
|
|||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: InstallShield (ft=ishd)
|
" Language: InstallShield (ft=ishd)
|
||||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||||
" Last Change: Sat, 24 May 2003 11:55:36 CEST
|
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||||
|
" Last Change: 2023 Aug 28
|
||||||
|
|
||||||
if exists("b:did_ftplugin") | finish | endif
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal foldmethod=syntax
|
|
||||||
|
|
||||||
" Using line continuation here.
|
" Using line continuation here.
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
|
setlocal foldmethod=syntax
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl fdm<"
|
||||||
|
|
||||||
" matchit support
|
" matchit support
|
||||||
if exists("loaded_matchit")
|
if exists("loaded_matchit")
|
||||||
let b:match_ignorecase=0
|
let b:match_ignorecase = 0
|
||||||
let b:match_words=
|
let b:match_words =
|
||||||
\ '\%(^\s*\)\@<=\<function\>\s\+[^()]\+\s*(:\%(^\s*\)\@<=\<begin\>\s*$:\%(^\s*\)\@<=\<return\>:\%(^\s*\)\@<=\<end\>\s*;\s*$,' .
|
\ '\%(^\s*\)\@<=\<function\>\s\+[^()]\+\s*(:\%(^\s*\)\@<=\<begin\>\s*$:\%(^\s*\)\@<=\<return\>:\%(^\s*\)\@<=\<end\>\s*;\s*$,' .
|
||||||
\ '\%(^\s*\)\@<=\<repeat\>\s*$:\%(^\s*\)\@<=\<until\>\s\+.\{-}\s*;\s*$,' .
|
\ '\%(^\s*\)\@<=\<repeat\>\s*$:\%(^\s*\)\@<=\<until\>\s\+.\{-}\s*;\s*$,' .
|
||||||
\ '\%(^\s*\)\@<=\<switch\>\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\<endswitch\>\s*;\s*$,' .
|
\ '\%(^\s*\)\@<=\<switch\>\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\<endswitch\>\s*;\s*$,' .
|
||||||
\ '\%(^\s*\)\@<=\<while\>\s*(.\{-}):\%(^\s*\)\@<=\<endwhile\>\s*;\s*$,' .
|
\ '\%(^\s*\)\@<=\<while\>\s*(.\{-}):\%(^\s*\)\@<=\<endwhile\>\s*;\s*$,' .
|
||||||
\ '\%(^\s*\)\@<=\<for\>.\{-}\<\%(to\|downto\)\>:\%(^\s*\)\@<=\<endfor\>\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*$'
|
\ '\%(^\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
|
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" .
|
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
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
" Language: LambdaProlog (Teyjus)
|
" Language: LambdaProlog (Teyjus)
|
||||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||||
" URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
|
" 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 16 - fixed 'no_mail_maps'-bug (MM)
|
||||||
" 2001 Sep 02 - initial release (MM)
|
" 2001 Sep 02 - initial release (MM)
|
||||||
|
|
||||||
@ -15,11 +16,13 @@ endif
|
|||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
" Error format
|
" Error format
|
||||||
setlocal efm=%+A./%f:%l.%c:\ %m formatprg=fmt\ -w75\ -p\\%
|
setlocal efm=%+A./%f:%l.%c:\ %m
|
||||||
|
|
||||||
" Formatting of comments
|
" Formatting of comments
|
||||||
setlocal formatprg=fmt\ -w75\ -p\\%
|
setlocal formatprg=fmt\ -w75\ -p\\%
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setlocal efm< fp<"
|
||||||
|
|
||||||
" Add mappings, unless the user didn't want this.
|
" Add mappings, unless the user didn't want this.
|
||||||
if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
|
if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
|
||||||
" Uncommenting
|
" Uncommenting
|
||||||
@ -28,6 +31,11 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
|
|||||||
vmap <buffer> <LocalLeader>c <Plug>BUncomOn
|
vmap <buffer> <LocalLeader>c <Plug>BUncomOn
|
||||||
nmap <buffer> <LocalLeader>C <Plug>LUncomOff
|
nmap <buffer> <LocalLeader>C <Plug>LUncomOff
|
||||||
vmap <buffer> <LocalLeader>C <Plug>BUncomOff
|
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
|
endif
|
||||||
|
|
||||||
nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
|
nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
|
||||||
|
@ -2,5 +2,8 @@
|
|||||||
" Language: nginx.conf
|
" Language: nginx.conf
|
||||||
" Maintainer: Chris Aumann <me@chr4.org>
|
" Maintainer: Chris Aumann <me@chr4.org>
|
||||||
" Last Change: Apr 15, 2017
|
" Last Change: Apr 15, 2017
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setlocal commentstring<"
|
||||||
|
@ -2,20 +2,16 @@
|
|||||||
" Language: Protobuf Text Format
|
" Language: Protobuf Text Format
|
||||||
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
||||||
" Last Change: 2020 Nov 17
|
" Last Change: 2020 Nov 17
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let b:undo_ftplugin = "setlocal commentstring<"
|
||||||
unlet s:cpo_save
|
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
" vim: nowrap sw=2 sts=2 ts=8 noet
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
" URL: https://github.com/derekwyatt/vim-scala
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
" License: Same as Vim
|
" License: Same as Vim
|
||||||
" Last Change: 11 August 2021
|
" Last Change: 11 August 2021
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
if exists('b:did_ftplugin') || &cp
|
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 path+=src/main/scala,src/test/scala
|
||||||
setlocal suffixesadd=.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:
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||||
" URL: https://github.com/ocaml/vim-ocaml
|
" URL: https://github.com/ocaml/vim-ocaml
|
||||||
" Last Change:
|
" Last Change:
|
||||||
|
" 2023 Aug 28 - Added undo_ftplugin (Vim Project)
|
||||||
" 2017 Apr 12 - First version (MM)
|
" 2017 Apr 12 - First version (MM)
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
@ -13,3 +14,5 @@ let b:did_ftplugin=1
|
|||||||
" Comment string
|
" Comment string
|
||||||
setl commentstring=;\ %s
|
setl commentstring=;\ %s
|
||||||
setl comments=:;
|
setl comments=:;
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl cms< com<"
|
||||||
|
@ -2,17 +2,13 @@
|
|||||||
" Language: Pixar Animation's Universal Scene Description format
|
" Language: Pixar Animation's Universal Scene Description format
|
||||||
" Maintainer: Colin Kennedy <colinvfx@gmail.com>
|
" Maintainer: Colin Kennedy <colinvfx@gmail.com>
|
||||||
" Last Change: 2023 May 9
|
" Last Change: 2023 May 9
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin)
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let b:undo_ftplugin = "setlocal commentstring<"
|
||||||
unlet s:cpo_save
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
" Maintainer: R.Shankar <shankar.pec?gmail.com>
|
" Maintainer: R.Shankar <shankar.pec?gmail.com>
|
||||||
" Modified By: Gerald Lai <laigera+vim?gmail.com>
|
" Modified By: Gerald Lai <laigera+vim?gmail.com>
|
||||||
" Last Change: 2011 Dec 11
|
" Last Change: 2011 Dec 11
|
||||||
|
" 2023 Aug 28 by Vim Project (undo_ftplugin, commentstring)
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
@ -22,13 +23,20 @@ set cpo&vim
|
|||||||
" Set 'comments' to format dashed lists in comments.
|
" Set 'comments' to format dashed lists in comments.
|
||||||
"setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
"setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||||
|
|
||||||
|
setlocal commentstring=--\ %s
|
||||||
|
|
||||||
" Format comments to be up to 78 characters long
|
" Format comments to be up to 78 characters long
|
||||||
"setlocal tw=75
|
"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
|
" Win32 can filter files in the browse dialog
|
||||||
"if has("gui_win32") && !exists("b:browsefilter")
|
"if has("gui_win32") && !exists("b:browsefilter")
|
||||||
" let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
" let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
||||||
" \ "All Files (*.*)\t*.*\n"
|
" \ "All Files (*.*)\t*.*\n"
|
||||||
|
" let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||||
"endif
|
"endif
|
||||||
|
|
||||||
" Let the matchit plugin know what items can be matched.
|
" 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.'\<package\>:\<end\s\+package\>,'.
|
||||||
\ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
|
\ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
|
||||||
\ s:notend.'\<configuration\>:\<end\s\+configuration\>'
|
\ s:notend.'\<configuration\>:\<end\s\+configuration\>'
|
||||||
|
let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" count repeat
|
if !exists("no_plugin_maps") && !exists("no_vhdl_maps")
|
||||||
function! <SID>CountWrapper(cmd)
|
" count repeat
|
||||||
let i = v:count1
|
function! <SID>CountWrapper(cmd)
|
||||||
if a:cmd[0] == ":"
|
let i = v:count1
|
||||||
while i > 0
|
if a:cmd[0] == ":"
|
||||||
execute a:cmd
|
while i > 0
|
||||||
let i = i - 1
|
execute a:cmd
|
||||||
endwhile
|
let i = i - 1
|
||||||
else
|
endwhile
|
||||||
execute "normal! gv\<Esc>"
|
else
|
||||||
execute "normal ".i.a:cmd
|
execute "normal! gv\<Esc>"
|
||||||
let curcol = col(".")
|
execute "normal ".i.a:cmd
|
||||||
let curline = line(".")
|
let curcol = col(".")
|
||||||
normal! gv
|
let curline = line(".")
|
||||||
call cursor(curline, curcol)
|
normal! gv
|
||||||
endif
|
call cursor(curline, curcol)
|
||||||
endfunction
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" explore motion
|
" explore motion
|
||||||
" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
|
" 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\)'
|
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>\\%^","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>\\%$","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>\\%^","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>\\%$","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>
|
||||||
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
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
Loading…
x
Reference in New Issue
Block a user