runtime(plsql): move fold option from syntax to filetype plugin
Commit:
https://github.com/vim/vim/commit/42e498d9c41a0260ccddceeb2927c18b508eff54
Author: Lee Lindley <[email protected]>
Date: Sun Mar 9 16:25:17 2025 +0100
runtime(plsql): move fold option from syntax to filetype plugin
closes: https://github.com/vim/vim/issues/16838
Co-authored-by: Konfekt <[email protected]>
Signed-off-by: Lee Lindley <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS
index f47bbbbce..27c52f5ab 100644
--- a/.github/MAINTAINERS
+++ b/.github/MAINTAINERS
@@ -250,6 +250,7 @@ runtime/ftplugin/pbtxt.vim @lakshayg
runtime/ftplugin/pdf.vim @tpope
runtime/ftplugin/perl.vim @petdance @dkearns
runtime/ftplugin/php.vim @dkearns
+runtime/ftplugin/plsql.vim @lee-lindley
runtime/ftplugin/pod.vim @petdance @dkearns
runtime/ftplugin/poefilter.vim @ObserverOfTime
runtime/ftplugin/postscr.vim @mrdubya
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index a2c757fb4..39402ee24 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -1,4 +1,4 @@
-*filetype.txt* For Vim version 9.1. Last change: 2025 Feb 25
+*filetype.txt* For Vim version 9.1. Last change: 2025 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -874,6 +874,12 @@ the PDF. The following are treated as tags:
These maps can be disabled with >
:let g:no_pdf_maps = 1
+
+PLSQL *ft-plsql-plugin*
+
+To enable syntax folding in PL/SQL filetypes, set the following variable: >
+
+ :let g:plsql_fold = 1
<
PYTHON *ft-python-plugin* *PEP8*
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 6aee799d0..9c6c9e1e6 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -7419,6 +7419,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
ft-php3-syntax syntax.txt /*ft-php3-syntax*
ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
+ft-plsql-plugin filetype.txt /*ft-plsql-plugin*
ft-posix-syntax syntax.txt /*ft-posix-syntax*
ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
diff --git a/runtime/ftplugin/plsql.vim b/runtime/ftplugin/plsql.vim
new file mode 100755
index 000000000..7fcc5d7a5
--- /dev/null
+++ b/runtime/ftplugin/plsql.vim
@@ -0,0 +1,17 @@
+" Vim ftplugin file
+" Language: Oracle Procedural SQL (PL/SQL)
+" Maintainer: Lee Lindley (lee dot lindley at gmail dot com)
+" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
+" Previous Maintainer: C. Laurence Gonsalves ([email protected])
+" URL: https://github.com/lee-lindley/vim_plsql_syntax
+" Last Change: Feb 19, 2025
+" History: Enno Konfekt move handling of optional syntax folding from syntax
+" file to ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+if get(g:,"plsql_fold",0) == 1
+ setlocal foldmethod=syntax
+ let b:undo_ftplugin = "setl fdm< "
+endif
diff --git a/runtime/syntax/plsql.vim b/runtime/syntax/plsql.vim
index 9b4df09ac..7e44e8333 100644
--- a/runtime/syntax/plsql.vim
+++ b/runtime/syntax/plsql.vim
@@ -4,7 +4,7 @@
" Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
" Previous Maintainer: C. Laurence Gonsalves ([email protected])
" URL: https://github.com/lee-lindley/vim_plsql_syntax
-" Last Change: Sep 19, 2022
+" Last Change: Mar 09, 2025
" History Carsten Czarski (carsten dot czarski at oracle com)
" add handling for typical SQL*Plus commands (rem, start, host,
set, etc)
" add error highlight for non-breaking space
@@ -694,7 +694,6 @@ syn region plsqlSqlPlusCommand
start="^\(SET\|DEFINE\|PROMPT\|ACCEPT\|EXEC\|HOS
syn region plsqlSqlPlusRunFile start="^\(@\|@@\)" skip="\$" end="$" keepend
extend
if get(g:,"plsql_fold",0) == 1
- setlocal foldmethod=syntax
syn sync fromstart
syn cluster plsqlProcedureGroup contains=plsqlProcedure
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1trIbM-000JNR-Nv%40256bit.org.