* [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
@ 2025-07-16 19:22 Bruno Thomsen
2025-07-17 6:31 ` Alexander Dahl via ptxdist
2025-07-23 7:11 ` Michael Olbrich
0 siblings, 2 replies; 10+ messages in thread
From: Bruno Thomsen @ 2025-07-16 19:22 UTC (permalink / raw)
To: ptxdist; +Cc: bruno.thomsen
Setup sane editor default using vim modeline.
sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
VS Code can also use it with modelines extention.
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
---
rules/templates/template-barebox-imx-habv4-in | 2 ++
rules/templates/template-barebox-imx-habv4-make | 2 +-
rules/templates/template-barebox-in | 2 ++
rules/templates/template-barebox-make | 2 +-
rules/templates/template-blspec-entry-in | 2 ++
rules/templates/template-blspec-entry-make | 2 +-
rules/templates/template-class-existing-target-in | 2 ++
rules/templates/template-class-existing-target-make | 2 +-
rules/templates/template-class-in | 2 ++
rules/templates/template-class-make | 2 +-
rules/templates/template-code-signing-provider-choice-in | 2 ++
rules/templates/template-code-signing-provider-in | 2 ++
rules/templates/template-code-signing-provider-make | 2 +-
rules/templates/template-code-signing-provider-pre-make | 2 +-
rules/templates/template-file-in | 2 ++
rules/templates/template-file-make | 2 +-
rules/templates/template-font-in | 2 ++
rules/templates/template-font-make | 2 +-
rules/templates/template-host-python3-in | 2 ++
rules/templates/template-host-python3-make | 2 +-
rules/templates/template-image-fit-in | 2 ++
rules/templates/template-image-fit-make | 2 +-
rules/templates/template-image-genimage-in | 2 ++
rules/templates/template-image-genimage-make | 2 +-
rules/templates/template-image-tgz-in | 2 ++
rules/templates/template-image-tgz-make | 2 +-
rules/templates/template-kernel-in | 2 ++
rules/templates/template-kernel-make | 2 +-
rules/templates/template-python3-in | 2 ++
rules/templates/template-python3-make | 2 +-
rules/templates/template-src-autoconf-in | 2 ++
rules/templates/template-src-autoconf-make | 2 +-
rules/templates/template-src-cmake-prog-in | 2 ++
rules/templates/template-src-cmake-prog-make | 2 +-
rules/templates/template-src-linux-driver-in | 2 ++
rules/templates/template-src-linux-driver-make | 2 +-
rules/templates/template-src-make-prog-in | 2 ++
rules/templates/template-src-make-prog-make | 2 +-
rules/templates/template-src-meson-prog-in | 2 ++
rules/templates/template-src-meson-prog-make | 2 +-
rules/templates/template-src-qmake-prog-in | 2 ++
rules/templates/template-src-qmake-prog-make | 2 +-
rules/templates/template-src-stellaris-in | 2 ++
rules/templates/template-src-stellaris-make | 2 +-
rules/templates/template-target-in | 2 ++
rules/templates/template-target-make | 2 +-
46 files changed, 69 insertions(+), 23 deletions(-)
diff --git a/rules/templates/template-barebox-imx-habv4-in b/rules/templates/template-barebox-imx-habv4-in
index 16258cbee..381435fa3 100644
--- a/rules/templates/template-barebox-imx-habv4-in
+++ b/rules/templates/template-barebox-imx-habv4-in
@@ -17,3 +17,5 @@ config BAREBOX_@PACKAGE@
Enable this to add the public keys for the FIT image:
CONFIG_CRYPTO_RSA_KEY="__ENV__FIT_KEY"
CONFIG_CRYPTO_RSA_KEY_NAME_HINT="image-kernel-fit"
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-barebox-imx-habv4-make b/rules/templates/template-barebox-imx-habv4-make
index d87729eff..7fdb3a535 100644
--- a/rules/templates/template-barebox-imx-habv4-make
+++ b/rules/templates/template-barebox-imx-habv4-make
@@ -106,4 +106,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
$(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
@$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-barebox-in b/rules/templates/template-barebox-in
index 44d920f4f..064c54a74 100644
--- a/rules/templates/template-barebox-in
+++ b/rules/templates/template-barebox-in
@@ -5,3 +5,5 @@ config BAREBOX_@PACKAGE@
prompt "Barebox (@package@)"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-barebox-make b/rules/templates/template-barebox-make
index 6821d65b9..48ed38886 100644
--- a/rules/templates/template-barebox-make
+++ b/rules/templates/template-barebox-make
@@ -86,4 +86,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
$(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
@$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-blspec-entry-in b/rules/templates/template-blspec-entry-in
index c17e3ed8c..0966b4adb 100644
--- a/rules/templates/template-blspec-entry-in
+++ b/rules/templates/template-blspec-entry-in
@@ -3,3 +3,5 @@
config BLSPEC_@PACKAGE@
tristate
prompt "/loader/entries/@ENTRY@ bootloader spec entry"
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-blspec-entry-make b/rules/templates/template-blspec-entry-make
index 88c904666..68ef5c520 100644
--- a/rules/templates/template-blspec-entry-make
+++ b/rules/templates/template-blspec-entry-make
@@ -33,4 +33,4 @@ $(STATEDIR)/blspec-@package@.targetinstall:
@$(call touch)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-class-existing-target-in b/rules/templates/template-class-existing-target-in
index b1c8e7102..8f11d5fbb 100644
--- a/rules/templates/template-class-existing-target-in
+++ b/rules/templates/template-class-existing-target-in
@@ -3,3 +3,5 @@
config @CLASS@@PACKAGE@
tristate
@DEFAULT@@SELECT@@PROMPT@
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-class-existing-target-make b/rules/templates/template-class-existing-target-make
index 752036ccc..df28632ae 100644
--- a/rules/templates/template-class-existing-target-make
+++ b/rules/templates/template-class-existing-target-make
@@ -66,4 +66,4 @@
# @$(call targetinfo)
# @$(call clean_pkg, @CLASS@@PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-class-in b/rules/templates/template-class-in
index b1c8e7102..8f11d5fbb 100644
--- a/rules/templates/template-class-in
+++ b/rules/templates/template-class-in
@@ -3,3 +3,5 @@
config @CLASS@@PACKAGE@
tristate
@DEFAULT@@SELECT@@PROMPT@
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-class-make b/rules/templates/template-class-make
index 205e0a10f..2e8d459b3 100644
--- a/rules/templates/template-class-make
+++ b/rules/templates/template-class-make
@@ -75,4 +75,4 @@
# @$(call targetinfo)
# @$(call clean_pkg, @CLASS@@PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-code-signing-provider-choice-in b/rules/templates/template-code-signing-provider-choice-in
index e2108f870..448dbf023 100644
--- a/rules/templates/template-code-signing-provider-choice-in
+++ b/rules/templates/template-code-signing-provider-choice-in
@@ -3,3 +3,5 @@
config CODE_SIGNING_PROVIDER_@PACKAGE@
bool
prompt "@package@"
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-code-signing-provider-in b/rules/templates/template-code-signing-provider-in
index b84ba839c..374d450af 100644
--- a/rules/templates/template-code-signing-provider-in
+++ b/rules/templates/template-code-signing-provider-in
@@ -12,3 +12,5 @@ config HOST_@PACKAGE@_CODE_SIGNING
select HOST_OPENSSL
select HOST_EXTRACT_CERT
@EXTRA_DEPENDENCIES@
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-code-signing-provider-make b/rules/templates/template-code-signing-provider-make
index 4cf9cac35..22e11db22 100644
--- a/rules/templates/template-code-signing-provider-make
+++ b/rules/templates/template-code-signing-provider-make
@@ -39,4 +39,4 @@ $(STATEDIR)/host-@package@-code-signing.install:
@$(call targetinfo)
@$(call touch)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-code-signing-provider-pre-make b/rules/templates/template-code-signing-provider-pre-make
index 90b58d2c2..21ad0eb85 100644
--- a/rules/templates/template-code-signing-provider-pre-make
+++ b/rules/templates/template-code-signing-provider-pre-make
@@ -15,4 +15,4 @@ CODE_SIGNING_ENV += \
#$(call ptx/online-code-signing-provider)
endif
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-file-in b/rules/templates/template-file-in
index e5cdde569..4bd575fdd 100644
--- a/rules/templates/template-file-in
+++ b/rules/templates/template-file-in
@@ -5,3 +5,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-file-make b/rules/templates/template-file-make
index 54268bdbc..ae143e3a9 100644
--- a/rules/templates/template-file-make
+++ b/rules/templates/template-file-make
@@ -84,4 +84,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-font-in b/rules/templates/template-font-in
index bf20d50bf..f38fca8ef 100644
--- a/rules/templates/template-font-in
+++ b/rules/templates/template-font-in
@@ -6,3 +6,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-font-make b/rules/templates/template-font-make
index 13a59041b..203893f92 100644
--- a/rules/templates/template-font-make
+++ b/rules/templates/template-font-make
@@ -66,4 +66,4 @@ $(STATEDIR)/@package@.targetinstall:
@$(call touch)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-host-python3-in b/rules/templates/template-host-python3-in
index 87a8004ae..b5b82ff79 100644
--- a/rules/templates/template-host-python3-in
+++ b/rules/templates/template-host-python3-in
@@ -4,3 +4,5 @@ config @PREFIX@_@PACKAGE@
tristate
default y if ALLYES
select @PREFIX@
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-host-python3-make b/rules/templates/template-host-python3-make
index c3b766bab..7fa07571e 100644
--- a/rules/templates/template-host-python3-make
+++ b/rules/templates/template-host-python3-make
@@ -30,4 +30,4 @@ HOST_PACKAGES-$(PTXCONF_@PREFIX@_@PACKAGE@) += @prefix@-@package@
@PREFIX@_@PACKAGE@_CONF_TOOL := python3
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-fit-in b/rules/templates/template-image-fit-in
index 1a89153fc..5375a7c4c 100644
--- a/rules/templates/template-image-fit-in
+++ b/rules/templates/template-image-fit-in
@@ -8,3 +8,5 @@ config IMAGE_@PACKAGE@
prompt "Generate images/@package@.fit"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-fit-make b/rules/templates/template-image-fit-make
index cd57d24df..8244e0ff1 100644
--- a/rules/templates/template-image-fit-make
+++ b/rules/templates/template-image-fit-make
@@ -31,4 +31,4 @@ $(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS)
@$(call world/image-fit, IMAGE_@PACKAGE@)
@$(call finish)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-genimage-in b/rules/templates/template-image-genimage-in
index 28a95d6d9..8d9e1781e 100644
--- a/rules/templates/template-image-genimage-in
+++ b/rules/templates/template-image-genimage-in
@@ -6,3 +6,5 @@ config IMAGE_@PACKAGE@
prompt "Generate images/@package@.@TYPE@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-genimage-make b/rules/templates/template-image-genimage-make
index 9ca5309d2..72c9e2cc8 100644
--- a/rules/templates/template-image-genimage-make
+++ b/rules/templates/template-image-genimage-make
@@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_IMAGE):
@$(call image/genimage, IMAGE_@PACKAGE@)
@$(call finish)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-tgz-in b/rules/templates/template-image-tgz-in
index cdb0712f6..b949e2f97 100644
--- a/rules/templates/template-image-tgz-in
+++ b/rules/templates/template-image-tgz-in
@@ -5,3 +5,5 @@ config IMAGE_@PACKAGE@_TGZ
prompt "Generate images/@package@.tgz"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-image-tgz-make b/rules/templates/template-image-tgz-make
index 1a2cb7a07..f12fc45bf 100644
--- a/rules/templates/template-image-tgz-make
+++ b/rules/templates/template-image-tgz-make
@@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_TGZ_IMAGE):
@$(call image/archive, IMAGE_@PACKAGE@_TGZ)
@$(call finish)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-kernel-in b/rules/templates/template-kernel-in
index cd0b4042a..a0e2f6635 100644
--- a/rules/templates/template-kernel-in
+++ b/rules/templates/template-kernel-in
@@ -8,3 +8,5 @@ config KERNEL_@PACKAGE@
#select HOST_U_BOOT_TOOLS
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-kernel-make b/rules/templates/template-kernel-make
index 38a953c84..0c95f415f 100644
--- a/rules/templates/template-kernel-make
+++ b/rules/templates/template-kernel-make
@@ -151,4 +151,4 @@ $(STATEDIR)/kernel-@package@.targetinstall:
$(call ptx/kconfig-targets, kernel-@package@): $(STATEDIR)/kernel-@package@.extract
@$(call world/kconfig, KERNEL_@PACKAGE@, $(subst kernel-@package@_,,$@))
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-python3-in b/rules/templates/template-python3-in
index 5f758f5bd..e8c40db88 100644
--- a/rules/templates/template-python3-in
+++ b/rules/templates/template-python3-in
@@ -6,3 +6,5 @@ config PYTHON3_@PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-python3-make b/rules/templates/template-python3-make
index 90884a2d8..ec3bd44ac 100644
--- a/rules/templates/template-python3-make
+++ b/rules/templates/template-python3-make
@@ -50,4 +50,4 @@ $(STATEDIR)/python3-@package@.targetinstall:
@$(call touch)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-autoconf-in b/rules/templates/template-src-autoconf-in
index bd724effb..a18a8c229 100644
--- a/rules/templates/template-src-autoconf-in
+++ b/rules/templates/template-src-autoconf-in
@@ -5,3 +5,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-autoconf-make b/rules/templates/template-src-autoconf-make
index d8d61988b..d1f063915 100644
--- a/rules/templates/template-src-autoconf-make
+++ b/rules/templates/template-src-autoconf-make
@@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-cmake-prog-in b/rules/templates/template-src-cmake-prog-in
index 37e6541dd..32e35b310 100644
--- a/rules/templates/template-src-cmake-prog-in
+++ b/rules/templates/template-src-cmake-prog-in
@@ -6,3 +6,5 @@ config @PACKAGE@
select HOST_CMAKE
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-cmake-prog-make b/rules/templates/template-src-cmake-prog-make
index 9d724f21b..b3b63e408 100644
--- a/rules/templates/template-src-cmake-prog-make
+++ b/rules/templates/template-src-cmake-prog-make
@@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-linux-driver-in b/rules/templates/template-src-linux-driver-in
index 4d0463a9f..98071c9a0 100644
--- a/rules/templates/template-src-linux-driver-in
+++ b/rules/templates/template-src-linux-driver-in
@@ -7,3 +7,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-linux-driver-make b/rules/templates/template-src-linux-driver-make
index 4f4009472..a165f9d71 100644
--- a/rules/templates/template-src-linux-driver-make
+++ b/rules/templates/template-src-linux-driver-make
@@ -63,4 +63,4 @@ $(STATEDIR)/@package@.targetinstall:
@$(call compile, @PACKAGE@, $(@PACKAGE@_MAKE_OPT)_install)
@$(call touch)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-make-prog-in b/rules/templates/template-src-make-prog-in
index e5cdde569..4bd575fdd 100644
--- a/rules/templates/template-src-make-prog-in
+++ b/rules/templates/template-src-make-prog-in
@@ -5,3 +5,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-make-prog-make b/rules/templates/template-src-make-prog-make
index 9bd5c8dc5..0d81d9f2b 100644
--- a/rules/templates/template-src-make-prog-make
+++ b/rules/templates/template-src-make-prog-make
@@ -95,4 +95,4 @@ $(STATEDIR)/@package@.clean:
@-$(call execute, @PACKAGE@, $(@PACKAGE@_MAKE_ENV) $(MAKE) clean)
@$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-meson-prog-in b/rules/templates/template-src-meson-prog-in
index 34dc24f9f..6142b6ba4 100644
--- a/rules/templates/template-src-meson-prog-in
+++ b/rules/templates/template-src-meson-prog-in
@@ -6,3 +6,5 @@ config @PACKAGE@
select HOST_MESON
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-meson-prog-make b/rules/templates/template-src-meson-prog-make
index 5396db40c..64ce2409a 100644
--- a/rules/templates/template-src-meson-prog-make
+++ b/rules/templates/template-src-meson-prog-make
@@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-qmake-prog-in b/rules/templates/template-src-qmake-prog-in
index a20378948..6890e5983 100644
--- a/rules/templates/template-src-qmake-prog-in
+++ b/rules/templates/template-src-qmake-prog-in
@@ -6,3 +6,5 @@ config @PACKAGE@
select QT5
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
index 3d9156499..5a67e23bc 100644
--- a/rules/templates/template-src-qmake-prog-make
+++ b/rules/templates/template-src-qmake-prog-make
@@ -77,4 +77,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-stellaris-in b/rules/templates/template-src-stellaris-in
index d255fec84..f7436c1fc 100644
--- a/rules/templates/template-src-stellaris-in
+++ b/rules/templates/template-src-stellaris-in
@@ -6,3 +6,5 @@ config @PACKAGE@
prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-src-stellaris-make b/rules/templates/template-src-stellaris-make
index 750724376..68f025a9d 100644
--- a/rules/templates/template-src-stellaris-make
+++ b/rules/templates/template-src-stellaris-make
@@ -102,4 +102,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-target-in b/rules/templates/template-target-in
index ac8b3aa47..cb1d6eefb 100644
--- a/rules/templates/template-target-in
+++ b/rules/templates/template-target-in
@@ -5,3 +5,5 @@ config @PACKAGE@
@SELECT@ prompt "@package@"
help
FIXME
+
+# vim: ft=kconfig noet tw=72 ts=8 sw=8
diff --git a/rules/templates/template-target-make b/rules/templates/template-target-make
index 6add94b3d..e0ebe4d34 100644
--- a/rules/templates/template-target-make
+++ b/rules/templates/template-target-make
@@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
# @$(call targetinfo)
# @$(call clean_pkg, @PACKAGE@)
-# vim: syntax=make
+# vim: ft=make noet tw=72 ts=8 sw=8
base-commit: 8b4232c8d76fccd51e7338379f449add3183f0b9
--
2.50.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-16 19:22 [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files Bruno Thomsen
@ 2025-07-17 6:31 ` Alexander Dahl via ptxdist
2025-07-23 7:11 ` Michael Olbrich
1 sibling, 0 replies; 10+ messages in thread
From: Alexander Dahl via ptxdist @ 2025-07-17 6:31 UTC (permalink / raw)
To: Bruno Thomsen; +Cc: Alexander Dahl, ptxdist
Hello Bruno,
Am Wed, Jul 16, 2025 at 09:22:55PM +0200 schrieb Bruno Thomsen:
> Setup sane editor default using vim modeline.
>
> sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
>
> VS Code can also use it with modelines extention.
>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Greets
Alex
> ---
> rules/templates/template-barebox-imx-habv4-in | 2 ++
> rules/templates/template-barebox-imx-habv4-make | 2 +-
> rules/templates/template-barebox-in | 2 ++
> rules/templates/template-barebox-make | 2 +-
> rules/templates/template-blspec-entry-in | 2 ++
> rules/templates/template-blspec-entry-make | 2 +-
> rules/templates/template-class-existing-target-in | 2 ++
> rules/templates/template-class-existing-target-make | 2 +-
> rules/templates/template-class-in | 2 ++
> rules/templates/template-class-make | 2 +-
> rules/templates/template-code-signing-provider-choice-in | 2 ++
> rules/templates/template-code-signing-provider-in | 2 ++
> rules/templates/template-code-signing-provider-make | 2 +-
> rules/templates/template-code-signing-provider-pre-make | 2 +-
> rules/templates/template-file-in | 2 ++
> rules/templates/template-file-make | 2 +-
> rules/templates/template-font-in | 2 ++
> rules/templates/template-font-make | 2 +-
> rules/templates/template-host-python3-in | 2 ++
> rules/templates/template-host-python3-make | 2 +-
> rules/templates/template-image-fit-in | 2 ++
> rules/templates/template-image-fit-make | 2 +-
> rules/templates/template-image-genimage-in | 2 ++
> rules/templates/template-image-genimage-make | 2 +-
> rules/templates/template-image-tgz-in | 2 ++
> rules/templates/template-image-tgz-make | 2 +-
> rules/templates/template-kernel-in | 2 ++
> rules/templates/template-kernel-make | 2 +-
> rules/templates/template-python3-in | 2 ++
> rules/templates/template-python3-make | 2 +-
> rules/templates/template-src-autoconf-in | 2 ++
> rules/templates/template-src-autoconf-make | 2 +-
> rules/templates/template-src-cmake-prog-in | 2 ++
> rules/templates/template-src-cmake-prog-make | 2 +-
> rules/templates/template-src-linux-driver-in | 2 ++
> rules/templates/template-src-linux-driver-make | 2 +-
> rules/templates/template-src-make-prog-in | 2 ++
> rules/templates/template-src-make-prog-make | 2 +-
> rules/templates/template-src-meson-prog-in | 2 ++
> rules/templates/template-src-meson-prog-make | 2 +-
> rules/templates/template-src-qmake-prog-in | 2 ++
> rules/templates/template-src-qmake-prog-make | 2 +-
> rules/templates/template-src-stellaris-in | 2 ++
> rules/templates/template-src-stellaris-make | 2 +-
> rules/templates/template-target-in | 2 ++
> rules/templates/template-target-make | 2 +-
> 46 files changed, 69 insertions(+), 23 deletions(-)
>
> diff --git a/rules/templates/template-barebox-imx-habv4-in b/rules/templates/template-barebox-imx-habv4-in
> index 16258cbee..381435fa3 100644
> --- a/rules/templates/template-barebox-imx-habv4-in
> +++ b/rules/templates/template-barebox-imx-habv4-in
> @@ -17,3 +17,5 @@ config BAREBOX_@PACKAGE@
> Enable this to add the public keys for the FIT image:
> CONFIG_CRYPTO_RSA_KEY="__ENV__FIT_KEY"
> CONFIG_CRYPTO_RSA_KEY_NAME_HINT="image-kernel-fit"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-imx-habv4-make b/rules/templates/template-barebox-imx-habv4-make
> index d87729eff..7fdb3a535 100644
> --- a/rules/templates/template-barebox-imx-habv4-make
> +++ b/rules/templates/template-barebox-imx-habv4-make
> @@ -106,4 +106,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-in b/rules/templates/template-barebox-in
> index 44d920f4f..064c54a74 100644
> --- a/rules/templates/template-barebox-in
> +++ b/rules/templates/template-barebox-in
> @@ -5,3 +5,5 @@ config BAREBOX_@PACKAGE@
> prompt "Barebox (@package@)"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-make b/rules/templates/template-barebox-make
> index 6821d65b9..48ed38886 100644
> --- a/rules/templates/template-barebox-make
> +++ b/rules/templates/template-barebox-make
> @@ -86,4 +86,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-blspec-entry-in b/rules/templates/template-blspec-entry-in
> index c17e3ed8c..0966b4adb 100644
> --- a/rules/templates/template-blspec-entry-in
> +++ b/rules/templates/template-blspec-entry-in
> @@ -3,3 +3,5 @@
> config BLSPEC_@PACKAGE@
> tristate
> prompt "/loader/entries/@ENTRY@ bootloader spec entry"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-blspec-entry-make b/rules/templates/template-blspec-entry-make
> index 88c904666..68ef5c520 100644
> --- a/rules/templates/template-blspec-entry-make
> +++ b/rules/templates/template-blspec-entry-make
> @@ -33,4 +33,4 @@ $(STATEDIR)/blspec-@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-existing-target-in b/rules/templates/template-class-existing-target-in
> index b1c8e7102..8f11d5fbb 100644
> --- a/rules/templates/template-class-existing-target-in
> +++ b/rules/templates/template-class-existing-target-in
> @@ -3,3 +3,5 @@
> config @CLASS@@PACKAGE@
> tristate
> @DEFAULT@@SELECT@@PROMPT@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-existing-target-make b/rules/templates/template-class-existing-target-make
> index 752036ccc..df28632ae 100644
> --- a/rules/templates/template-class-existing-target-make
> +++ b/rules/templates/template-class-existing-target-make
> @@ -66,4 +66,4 @@
> # @$(call targetinfo)
> # @$(call clean_pkg, @CLASS@@PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-in b/rules/templates/template-class-in
> index b1c8e7102..8f11d5fbb 100644
> --- a/rules/templates/template-class-in
> +++ b/rules/templates/template-class-in
> @@ -3,3 +3,5 @@
> config @CLASS@@PACKAGE@
> tristate
> @DEFAULT@@SELECT@@PROMPT@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-make b/rules/templates/template-class-make
> index 205e0a10f..2e8d459b3 100644
> --- a/rules/templates/template-class-make
> +++ b/rules/templates/template-class-make
> @@ -75,4 +75,4 @@
> # @$(call targetinfo)
> # @$(call clean_pkg, @CLASS@@PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-choice-in b/rules/templates/template-code-signing-provider-choice-in
> index e2108f870..448dbf023 100644
> --- a/rules/templates/template-code-signing-provider-choice-in
> +++ b/rules/templates/template-code-signing-provider-choice-in
> @@ -3,3 +3,5 @@
> config CODE_SIGNING_PROVIDER_@PACKAGE@
> bool
> prompt "@package@"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-in b/rules/templates/template-code-signing-provider-in
> index b84ba839c..374d450af 100644
> --- a/rules/templates/template-code-signing-provider-in
> +++ b/rules/templates/template-code-signing-provider-in
> @@ -12,3 +12,5 @@ config HOST_@PACKAGE@_CODE_SIGNING
> select HOST_OPENSSL
> select HOST_EXTRACT_CERT
> @EXTRA_DEPENDENCIES@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-make b/rules/templates/template-code-signing-provider-make
> index 4cf9cac35..22e11db22 100644
> --- a/rules/templates/template-code-signing-provider-make
> +++ b/rules/templates/template-code-signing-provider-make
> @@ -39,4 +39,4 @@ $(STATEDIR)/host-@package@-code-signing.install:
> @$(call targetinfo)
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-pre-make b/rules/templates/template-code-signing-provider-pre-make
> index 90b58d2c2..21ad0eb85 100644
> --- a/rules/templates/template-code-signing-provider-pre-make
> +++ b/rules/templates/template-code-signing-provider-pre-make
> @@ -15,4 +15,4 @@ CODE_SIGNING_ENV += \
> #$(call ptx/online-code-signing-provider)
> endif
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-file-in b/rules/templates/template-file-in
> index e5cdde569..4bd575fdd 100644
> --- a/rules/templates/template-file-in
> +++ b/rules/templates/template-file-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-file-make b/rules/templates/template-file-make
> index 54268bdbc..ae143e3a9 100644
> --- a/rules/templates/template-file-make
> +++ b/rules/templates/template-file-make
> @@ -84,4 +84,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-font-in b/rules/templates/template-font-in
> index bf20d50bf..f38fca8ef 100644
> --- a/rules/templates/template-font-in
> +++ b/rules/templates/template-font-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-font-make b/rules/templates/template-font-make
> index 13a59041b..203893f92 100644
> --- a/rules/templates/template-font-make
> +++ b/rules/templates/template-font-make
> @@ -66,4 +66,4 @@ $(STATEDIR)/@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-host-python3-in b/rules/templates/template-host-python3-in
> index 87a8004ae..b5b82ff79 100644
> --- a/rules/templates/template-host-python3-in
> +++ b/rules/templates/template-host-python3-in
> @@ -4,3 +4,5 @@ config @PREFIX@_@PACKAGE@
> tristate
> default y if ALLYES
> select @PREFIX@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-host-python3-make b/rules/templates/template-host-python3-make
> index c3b766bab..7fa07571e 100644
> --- a/rules/templates/template-host-python3-make
> +++ b/rules/templates/template-host-python3-make
> @@ -30,4 +30,4 @@ HOST_PACKAGES-$(PTXCONF_@PREFIX@_@PACKAGE@) += @prefix@-@package@
>
> @PREFIX@_@PACKAGE@_CONF_TOOL := python3
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-fit-in b/rules/templates/template-image-fit-in
> index 1a89153fc..5375a7c4c 100644
> --- a/rules/templates/template-image-fit-in
> +++ b/rules/templates/template-image-fit-in
> @@ -8,3 +8,5 @@ config IMAGE_@PACKAGE@
> prompt "Generate images/@package@.fit"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-fit-make b/rules/templates/template-image-fit-make
> index cd57d24df..8244e0ff1 100644
> --- a/rules/templates/template-image-fit-make
> +++ b/rules/templates/template-image-fit-make
> @@ -31,4 +31,4 @@ $(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS)
> @$(call world/image-fit, IMAGE_@PACKAGE@)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-genimage-in b/rules/templates/template-image-genimage-in
> index 28a95d6d9..8d9e1781e 100644
> --- a/rules/templates/template-image-genimage-in
> +++ b/rules/templates/template-image-genimage-in
> @@ -6,3 +6,5 @@ config IMAGE_@PACKAGE@
> prompt "Generate images/@package@.@TYPE@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-genimage-make b/rules/templates/template-image-genimage-make
> index 9ca5309d2..72c9e2cc8 100644
> --- a/rules/templates/template-image-genimage-make
> +++ b/rules/templates/template-image-genimage-make
> @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_IMAGE):
> @$(call image/genimage, IMAGE_@PACKAGE@)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-tgz-in b/rules/templates/template-image-tgz-in
> index cdb0712f6..b949e2f97 100644
> --- a/rules/templates/template-image-tgz-in
> +++ b/rules/templates/template-image-tgz-in
> @@ -5,3 +5,5 @@ config IMAGE_@PACKAGE@_TGZ
> prompt "Generate images/@package@.tgz"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-tgz-make b/rules/templates/template-image-tgz-make
> index 1a2cb7a07..f12fc45bf 100644
> --- a/rules/templates/template-image-tgz-make
> +++ b/rules/templates/template-image-tgz-make
> @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_TGZ_IMAGE):
> @$(call image/archive, IMAGE_@PACKAGE@_TGZ)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-kernel-in b/rules/templates/template-kernel-in
> index cd0b4042a..a0e2f6635 100644
> --- a/rules/templates/template-kernel-in
> +++ b/rules/templates/template-kernel-in
> @@ -8,3 +8,5 @@ config KERNEL_@PACKAGE@
> #select HOST_U_BOOT_TOOLS
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-kernel-make b/rules/templates/template-kernel-make
> index 38a953c84..0c95f415f 100644
> --- a/rules/templates/template-kernel-make
> +++ b/rules/templates/template-kernel-make
> @@ -151,4 +151,4 @@ $(STATEDIR)/kernel-@package@.targetinstall:
> $(call ptx/kconfig-targets, kernel-@package@): $(STATEDIR)/kernel-@package@.extract
> @$(call world/kconfig, KERNEL_@PACKAGE@, $(subst kernel-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-python3-in b/rules/templates/template-python3-in
> index 5f758f5bd..e8c40db88 100644
> --- a/rules/templates/template-python3-in
> +++ b/rules/templates/template-python3-in
> @@ -6,3 +6,5 @@ config PYTHON3_@PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-python3-make b/rules/templates/template-python3-make
> index 90884a2d8..ec3bd44ac 100644
> --- a/rules/templates/template-python3-make
> +++ b/rules/templates/template-python3-make
> @@ -50,4 +50,4 @@ $(STATEDIR)/python3-@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-autoconf-in b/rules/templates/template-src-autoconf-in
> index bd724effb..a18a8c229 100644
> --- a/rules/templates/template-src-autoconf-in
> +++ b/rules/templates/template-src-autoconf-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-autoconf-make b/rules/templates/template-src-autoconf-make
> index d8d61988b..d1f063915 100644
> --- a/rules/templates/template-src-autoconf-make
> +++ b/rules/templates/template-src-autoconf-make
> @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-cmake-prog-in b/rules/templates/template-src-cmake-prog-in
> index 37e6541dd..32e35b310 100644
> --- a/rules/templates/template-src-cmake-prog-in
> +++ b/rules/templates/template-src-cmake-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select HOST_CMAKE
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-cmake-prog-make b/rules/templates/template-src-cmake-prog-make
> index 9d724f21b..b3b63e408 100644
> --- a/rules/templates/template-src-cmake-prog-make
> +++ b/rules/templates/template-src-cmake-prog-make
> @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-linux-driver-in b/rules/templates/template-src-linux-driver-in
> index 4d0463a9f..98071c9a0 100644
> --- a/rules/templates/template-src-linux-driver-in
> +++ b/rules/templates/template-src-linux-driver-in
> @@ -7,3 +7,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-linux-driver-make b/rules/templates/template-src-linux-driver-make
> index 4f4009472..a165f9d71 100644
> --- a/rules/templates/template-src-linux-driver-make
> +++ b/rules/templates/template-src-linux-driver-make
> @@ -63,4 +63,4 @@ $(STATEDIR)/@package@.targetinstall:
> @$(call compile, @PACKAGE@, $(@PACKAGE@_MAKE_OPT)_install)
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-make-prog-in b/rules/templates/template-src-make-prog-in
> index e5cdde569..4bd575fdd 100644
> --- a/rules/templates/template-src-make-prog-in
> +++ b/rules/templates/template-src-make-prog-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-make-prog-make b/rules/templates/template-src-make-prog-make
> index 9bd5c8dc5..0d81d9f2b 100644
> --- a/rules/templates/template-src-make-prog-make
> +++ b/rules/templates/template-src-make-prog-make
> @@ -95,4 +95,4 @@ $(STATEDIR)/@package@.clean:
> @-$(call execute, @PACKAGE@, $(@PACKAGE@_MAKE_ENV) $(MAKE) clean)
> @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-meson-prog-in b/rules/templates/template-src-meson-prog-in
> index 34dc24f9f..6142b6ba4 100644
> --- a/rules/templates/template-src-meson-prog-in
> +++ b/rules/templates/template-src-meson-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select HOST_MESON
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-meson-prog-make b/rules/templates/template-src-meson-prog-make
> index 5396db40c..64ce2409a 100644
> --- a/rules/templates/template-src-meson-prog-make
> +++ b/rules/templates/template-src-meson-prog-make
> @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-qmake-prog-in b/rules/templates/template-src-qmake-prog-in
> index a20378948..6890e5983 100644
> --- a/rules/templates/template-src-qmake-prog-in
> +++ b/rules/templates/template-src-qmake-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select QT5
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
> index 3d9156499..5a67e23bc 100644
> --- a/rules/templates/template-src-qmake-prog-make
> +++ b/rules/templates/template-src-qmake-prog-make
> @@ -77,4 +77,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-stellaris-in b/rules/templates/template-src-stellaris-in
> index d255fec84..f7436c1fc 100644
> --- a/rules/templates/template-src-stellaris-in
> +++ b/rules/templates/template-src-stellaris-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-stellaris-make b/rules/templates/template-src-stellaris-make
> index 750724376..68f025a9d 100644
> --- a/rules/templates/template-src-stellaris-make
> +++ b/rules/templates/template-src-stellaris-make
> @@ -102,4 +102,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call clean_pkg, @PACKAGE@)
>
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-target-in b/rules/templates/template-target-in
> index ac8b3aa47..cb1d6eefb 100644
> --- a/rules/templates/template-target-in
> +++ b/rules/templates/template-target-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> @SELECT@ prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-target-make b/rules/templates/template-target-make
> index 6add94b3d..e0ebe4d34 100644
> --- a/rules/templates/template-target-make
> +++ b/rules/templates/template-target-make
> @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
>
> base-commit: 8b4232c8d76fccd51e7338379f449add3183f0b9
> --
> 2.50.1
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-16 19:22 [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files Bruno Thomsen
2025-07-17 6:31 ` Alexander Dahl via ptxdist
@ 2025-07-23 7:11 ` Michael Olbrich
2025-07-23 17:03 ` Bruno Thomsen
1 sibling, 1 reply; 10+ messages in thread
From: Michael Olbrich @ 2025-07-23 7:11 UTC (permalink / raw)
To: Bruno Thomsen; +Cc: ptxdist
On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> Setup sane editor default using vim modeline.
>
> sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
tw=72 is fine for the .in files. That will give a good flow for the help
text. Most of the rest will be shorter anyways.
But the makefiles have longer lines. The banner above the stage are already
78 chars wide and many of the variables at the top as well.
And for the rest, readability really depends on the content and a defined
textwidth suggests a hard limit that I don't want to set.
Maybe a soft visual limit with cc=80 instead?
Michael
>
> VS Code can also use it with modelines extention.
>
> Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> ---
> rules/templates/template-barebox-imx-habv4-in | 2 ++
> rules/templates/template-barebox-imx-habv4-make | 2 +-
> rules/templates/template-barebox-in | 2 ++
> rules/templates/template-barebox-make | 2 +-
> rules/templates/template-blspec-entry-in | 2 ++
> rules/templates/template-blspec-entry-make | 2 +-
> rules/templates/template-class-existing-target-in | 2 ++
> rules/templates/template-class-existing-target-make | 2 +-
> rules/templates/template-class-in | 2 ++
> rules/templates/template-class-make | 2 +-
> rules/templates/template-code-signing-provider-choice-in | 2 ++
> rules/templates/template-code-signing-provider-in | 2 ++
> rules/templates/template-code-signing-provider-make | 2 +-
> rules/templates/template-code-signing-provider-pre-make | 2 +-
> rules/templates/template-file-in | 2 ++
> rules/templates/template-file-make | 2 +-
> rules/templates/template-font-in | 2 ++
> rules/templates/template-font-make | 2 +-
> rules/templates/template-host-python3-in | 2 ++
> rules/templates/template-host-python3-make | 2 +-
> rules/templates/template-image-fit-in | 2 ++
> rules/templates/template-image-fit-make | 2 +-
> rules/templates/template-image-genimage-in | 2 ++
> rules/templates/template-image-genimage-make | 2 +-
> rules/templates/template-image-tgz-in | 2 ++
> rules/templates/template-image-tgz-make | 2 +-
> rules/templates/template-kernel-in | 2 ++
> rules/templates/template-kernel-make | 2 +-
> rules/templates/template-python3-in | 2 ++
> rules/templates/template-python3-make | 2 +-
> rules/templates/template-src-autoconf-in | 2 ++
> rules/templates/template-src-autoconf-make | 2 +-
> rules/templates/template-src-cmake-prog-in | 2 ++
> rules/templates/template-src-cmake-prog-make | 2 +-
> rules/templates/template-src-linux-driver-in | 2 ++
> rules/templates/template-src-linux-driver-make | 2 +-
> rules/templates/template-src-make-prog-in | 2 ++
> rules/templates/template-src-make-prog-make | 2 +-
> rules/templates/template-src-meson-prog-in | 2 ++
> rules/templates/template-src-meson-prog-make | 2 +-
> rules/templates/template-src-qmake-prog-in | 2 ++
> rules/templates/template-src-qmake-prog-make | 2 +-
> rules/templates/template-src-stellaris-in | 2 ++
> rules/templates/template-src-stellaris-make | 2 +-
> rules/templates/template-target-in | 2 ++
> rules/templates/template-target-make | 2 +-
> 46 files changed, 69 insertions(+), 23 deletions(-)
>
> diff --git a/rules/templates/template-barebox-imx-habv4-in b/rules/templates/template-barebox-imx-habv4-in
> index 16258cbee..381435fa3 100644
> --- a/rules/templates/template-barebox-imx-habv4-in
> +++ b/rules/templates/template-barebox-imx-habv4-in
> @@ -17,3 +17,5 @@ config BAREBOX_@PACKAGE@
> Enable this to add the public keys for the FIT image:
> CONFIG_CRYPTO_RSA_KEY="__ENV__FIT_KEY"
> CONFIG_CRYPTO_RSA_KEY_NAME_HINT="image-kernel-fit"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-imx-habv4-make b/rules/templates/template-barebox-imx-habv4-make
> index d87729eff..7fdb3a535 100644
> --- a/rules/templates/template-barebox-imx-habv4-make
> +++ b/rules/templates/template-barebox-imx-habv4-make
> @@ -106,4 +106,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-in b/rules/templates/template-barebox-in
> index 44d920f4f..064c54a74 100644
> --- a/rules/templates/template-barebox-in
> +++ b/rules/templates/template-barebox-in
> @@ -5,3 +5,5 @@ config BAREBOX_@PACKAGE@
> prompt "Barebox (@package@)"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-barebox-make b/rules/templates/template-barebox-make
> index 6821d65b9..48ed38886 100644
> --- a/rules/templates/template-barebox-make
> +++ b/rules/templates/template-barebox-make
> @@ -86,4 +86,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-blspec-entry-in b/rules/templates/template-blspec-entry-in
> index c17e3ed8c..0966b4adb 100644
> --- a/rules/templates/template-blspec-entry-in
> +++ b/rules/templates/template-blspec-entry-in
> @@ -3,3 +3,5 @@
> config BLSPEC_@PACKAGE@
> tristate
> prompt "/loader/entries/@ENTRY@ bootloader spec entry"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-blspec-entry-make b/rules/templates/template-blspec-entry-make
> index 88c904666..68ef5c520 100644
> --- a/rules/templates/template-blspec-entry-make
> +++ b/rules/templates/template-blspec-entry-make
> @@ -33,4 +33,4 @@ $(STATEDIR)/blspec-@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-existing-target-in b/rules/templates/template-class-existing-target-in
> index b1c8e7102..8f11d5fbb 100644
> --- a/rules/templates/template-class-existing-target-in
> +++ b/rules/templates/template-class-existing-target-in
> @@ -3,3 +3,5 @@
> config @CLASS@@PACKAGE@
> tristate
> @DEFAULT@@SELECT@@PROMPT@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-existing-target-make b/rules/templates/template-class-existing-target-make
> index 752036ccc..df28632ae 100644
> --- a/rules/templates/template-class-existing-target-make
> +++ b/rules/templates/template-class-existing-target-make
> @@ -66,4 +66,4 @@
> # @$(call targetinfo)
> # @$(call clean_pkg, @CLASS@@PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-in b/rules/templates/template-class-in
> index b1c8e7102..8f11d5fbb 100644
> --- a/rules/templates/template-class-in
> +++ b/rules/templates/template-class-in
> @@ -3,3 +3,5 @@
> config @CLASS@@PACKAGE@
> tristate
> @DEFAULT@@SELECT@@PROMPT@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-class-make b/rules/templates/template-class-make
> index 205e0a10f..2e8d459b3 100644
> --- a/rules/templates/template-class-make
> +++ b/rules/templates/template-class-make
> @@ -75,4 +75,4 @@
> # @$(call targetinfo)
> # @$(call clean_pkg, @CLASS@@PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-choice-in b/rules/templates/template-code-signing-provider-choice-in
> index e2108f870..448dbf023 100644
> --- a/rules/templates/template-code-signing-provider-choice-in
> +++ b/rules/templates/template-code-signing-provider-choice-in
> @@ -3,3 +3,5 @@
> config CODE_SIGNING_PROVIDER_@PACKAGE@
> bool
> prompt "@package@"
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-in b/rules/templates/template-code-signing-provider-in
> index b84ba839c..374d450af 100644
> --- a/rules/templates/template-code-signing-provider-in
> +++ b/rules/templates/template-code-signing-provider-in
> @@ -12,3 +12,5 @@ config HOST_@PACKAGE@_CODE_SIGNING
> select HOST_OPENSSL
> select HOST_EXTRACT_CERT
> @EXTRA_DEPENDENCIES@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-make b/rules/templates/template-code-signing-provider-make
> index 4cf9cac35..22e11db22 100644
> --- a/rules/templates/template-code-signing-provider-make
> +++ b/rules/templates/template-code-signing-provider-make
> @@ -39,4 +39,4 @@ $(STATEDIR)/host-@package@-code-signing.install:
> @$(call targetinfo)
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-code-signing-provider-pre-make b/rules/templates/template-code-signing-provider-pre-make
> index 90b58d2c2..21ad0eb85 100644
> --- a/rules/templates/template-code-signing-provider-pre-make
> +++ b/rules/templates/template-code-signing-provider-pre-make
> @@ -15,4 +15,4 @@ CODE_SIGNING_ENV += \
> #$(call ptx/online-code-signing-provider)
> endif
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-file-in b/rules/templates/template-file-in
> index e5cdde569..4bd575fdd 100644
> --- a/rules/templates/template-file-in
> +++ b/rules/templates/template-file-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-file-make b/rules/templates/template-file-make
> index 54268bdbc..ae143e3a9 100644
> --- a/rules/templates/template-file-make
> +++ b/rules/templates/template-file-make
> @@ -84,4 +84,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-font-in b/rules/templates/template-font-in
> index bf20d50bf..f38fca8ef 100644
> --- a/rules/templates/template-font-in
> +++ b/rules/templates/template-font-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-font-make b/rules/templates/template-font-make
> index 13a59041b..203893f92 100644
> --- a/rules/templates/template-font-make
> +++ b/rules/templates/template-font-make
> @@ -66,4 +66,4 @@ $(STATEDIR)/@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-host-python3-in b/rules/templates/template-host-python3-in
> index 87a8004ae..b5b82ff79 100644
> --- a/rules/templates/template-host-python3-in
> +++ b/rules/templates/template-host-python3-in
> @@ -4,3 +4,5 @@ config @PREFIX@_@PACKAGE@
> tristate
> default y if ALLYES
> select @PREFIX@
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-host-python3-make b/rules/templates/template-host-python3-make
> index c3b766bab..7fa07571e 100644
> --- a/rules/templates/template-host-python3-make
> +++ b/rules/templates/template-host-python3-make
> @@ -30,4 +30,4 @@ HOST_PACKAGES-$(PTXCONF_@PREFIX@_@PACKAGE@) += @prefix@-@package@
>
> @PREFIX@_@PACKAGE@_CONF_TOOL := python3
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-fit-in b/rules/templates/template-image-fit-in
> index 1a89153fc..5375a7c4c 100644
> --- a/rules/templates/template-image-fit-in
> +++ b/rules/templates/template-image-fit-in
> @@ -8,3 +8,5 @@ config IMAGE_@PACKAGE@
> prompt "Generate images/@package@.fit"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-fit-make b/rules/templates/template-image-fit-make
> index cd57d24df..8244e0ff1 100644
> --- a/rules/templates/template-image-fit-make
> +++ b/rules/templates/template-image-fit-make
> @@ -31,4 +31,4 @@ $(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS)
> @$(call world/image-fit, IMAGE_@PACKAGE@)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-genimage-in b/rules/templates/template-image-genimage-in
> index 28a95d6d9..8d9e1781e 100644
> --- a/rules/templates/template-image-genimage-in
> +++ b/rules/templates/template-image-genimage-in
> @@ -6,3 +6,5 @@ config IMAGE_@PACKAGE@
> prompt "Generate images/@package@.@TYPE@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-genimage-make b/rules/templates/template-image-genimage-make
> index 9ca5309d2..72c9e2cc8 100644
> --- a/rules/templates/template-image-genimage-make
> +++ b/rules/templates/template-image-genimage-make
> @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_IMAGE):
> @$(call image/genimage, IMAGE_@PACKAGE@)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-tgz-in b/rules/templates/template-image-tgz-in
> index cdb0712f6..b949e2f97 100644
> --- a/rules/templates/template-image-tgz-in
> +++ b/rules/templates/template-image-tgz-in
> @@ -5,3 +5,5 @@ config IMAGE_@PACKAGE@_TGZ
> prompt "Generate images/@package@.tgz"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-image-tgz-make b/rules/templates/template-image-tgz-make
> index 1a2cb7a07..f12fc45bf 100644
> --- a/rules/templates/template-image-tgz-make
> +++ b/rules/templates/template-image-tgz-make
> @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_TGZ_IMAGE):
> @$(call image/archive, IMAGE_@PACKAGE@_TGZ)
> @$(call finish)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-kernel-in b/rules/templates/template-kernel-in
> index cd0b4042a..a0e2f6635 100644
> --- a/rules/templates/template-kernel-in
> +++ b/rules/templates/template-kernel-in
> @@ -8,3 +8,5 @@ config KERNEL_@PACKAGE@
> #select HOST_U_BOOT_TOOLS
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-kernel-make b/rules/templates/template-kernel-make
> index 38a953c84..0c95f415f 100644
> --- a/rules/templates/template-kernel-make
> +++ b/rules/templates/template-kernel-make
> @@ -151,4 +151,4 @@ $(STATEDIR)/kernel-@package@.targetinstall:
> $(call ptx/kconfig-targets, kernel-@package@): $(STATEDIR)/kernel-@package@.extract
> @$(call world/kconfig, KERNEL_@PACKAGE@, $(subst kernel-@package@_,,$@))
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-python3-in b/rules/templates/template-python3-in
> index 5f758f5bd..e8c40db88 100644
> --- a/rules/templates/template-python3-in
> +++ b/rules/templates/template-python3-in
> @@ -6,3 +6,5 @@ config PYTHON3_@PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-python3-make b/rules/templates/template-python3-make
> index 90884a2d8..ec3bd44ac 100644
> --- a/rules/templates/template-python3-make
> +++ b/rules/templates/template-python3-make
> @@ -50,4 +50,4 @@ $(STATEDIR)/python3-@package@.targetinstall:
>
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-autoconf-in b/rules/templates/template-src-autoconf-in
> index bd724effb..a18a8c229 100644
> --- a/rules/templates/template-src-autoconf-in
> +++ b/rules/templates/template-src-autoconf-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-autoconf-make b/rules/templates/template-src-autoconf-make
> index d8d61988b..d1f063915 100644
> --- a/rules/templates/template-src-autoconf-make
> +++ b/rules/templates/template-src-autoconf-make
> @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-cmake-prog-in b/rules/templates/template-src-cmake-prog-in
> index 37e6541dd..32e35b310 100644
> --- a/rules/templates/template-src-cmake-prog-in
> +++ b/rules/templates/template-src-cmake-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select HOST_CMAKE
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-cmake-prog-make b/rules/templates/template-src-cmake-prog-make
> index 9d724f21b..b3b63e408 100644
> --- a/rules/templates/template-src-cmake-prog-make
> +++ b/rules/templates/template-src-cmake-prog-make
> @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-linux-driver-in b/rules/templates/template-src-linux-driver-in
> index 4d0463a9f..98071c9a0 100644
> --- a/rules/templates/template-src-linux-driver-in
> +++ b/rules/templates/template-src-linux-driver-in
> @@ -7,3 +7,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-linux-driver-make b/rules/templates/template-src-linux-driver-make
> index 4f4009472..a165f9d71 100644
> --- a/rules/templates/template-src-linux-driver-make
> +++ b/rules/templates/template-src-linux-driver-make
> @@ -63,4 +63,4 @@ $(STATEDIR)/@package@.targetinstall:
> @$(call compile, @PACKAGE@, $(@PACKAGE@_MAKE_OPT)_install)
> @$(call touch)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-make-prog-in b/rules/templates/template-src-make-prog-in
> index e5cdde569..4bd575fdd 100644
> --- a/rules/templates/template-src-make-prog-in
> +++ b/rules/templates/template-src-make-prog-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-make-prog-make b/rules/templates/template-src-make-prog-make
> index 9bd5c8dc5..0d81d9f2b 100644
> --- a/rules/templates/template-src-make-prog-make
> +++ b/rules/templates/template-src-make-prog-make
> @@ -95,4 +95,4 @@ $(STATEDIR)/@package@.clean:
> @-$(call execute, @PACKAGE@, $(@PACKAGE@_MAKE_ENV) $(MAKE) clean)
> @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-meson-prog-in b/rules/templates/template-src-meson-prog-in
> index 34dc24f9f..6142b6ba4 100644
> --- a/rules/templates/template-src-meson-prog-in
> +++ b/rules/templates/template-src-meson-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select HOST_MESON
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-meson-prog-make b/rules/templates/template-src-meson-prog-make
> index 5396db40c..64ce2409a 100644
> --- a/rules/templates/template-src-meson-prog-make
> +++ b/rules/templates/template-src-meson-prog-make
> @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-qmake-prog-in b/rules/templates/template-src-qmake-prog-in
> index a20378948..6890e5983 100644
> --- a/rules/templates/template-src-qmake-prog-in
> +++ b/rules/templates/template-src-qmake-prog-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> select QT5
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
> index 3d9156499..5a67e23bc 100644
> --- a/rules/templates/template-src-qmake-prog-make
> +++ b/rules/templates/template-src-qmake-prog-make
> @@ -77,4 +77,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-stellaris-in b/rules/templates/template-src-stellaris-in
> index d255fec84..f7436c1fc 100644
> --- a/rules/templates/template-src-stellaris-in
> +++ b/rules/templates/template-src-stellaris-in
> @@ -6,3 +6,5 @@ config @PACKAGE@
> prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-src-stellaris-make b/rules/templates/template-src-stellaris-make
> index 750724376..68f025a9d 100644
> --- a/rules/templates/template-src-stellaris-make
> +++ b/rules/templates/template-src-stellaris-make
> @@ -102,4 +102,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call clean_pkg, @PACKAGE@)
>
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-target-in b/rules/templates/template-target-in
> index ac8b3aa47..cb1d6eefb 100644
> --- a/rules/templates/template-target-in
> +++ b/rules/templates/template-target-in
> @@ -5,3 +5,5 @@ config @PACKAGE@
> @SELECT@ prompt "@package@"
> help
> FIXME
> +
> +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> diff --git a/rules/templates/template-target-make b/rules/templates/template-target-make
> index 6add94b3d..e0ebe4d34 100644
> --- a/rules/templates/template-target-make
> +++ b/rules/templates/template-target-make
> @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> # @$(call targetinfo)
> # @$(call clean_pkg, @PACKAGE@)
>
> -# vim: syntax=make
> +# vim: ft=make noet tw=72 ts=8 sw=8
>
> base-commit: 8b4232c8d76fccd51e7338379f449add3183f0b9
> --
> 2.50.1
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-23 7:11 ` Michael Olbrich
@ 2025-07-23 17:03 ` Bruno Thomsen
2025-07-24 7:51 ` Markus Heidelberg via ptxdist
0 siblings, 1 reply; 10+ messages in thread
From: Bruno Thomsen @ 2025-07-23 17:03 UTC (permalink / raw)
To: Michael Olbrich; +Cc: ptxdist
Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
<m.olbrich@pengutronix.de>:
>
> On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > Setup sane editor default using vim modeline.
> >
> > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
>
> tw=72 is fine for the .in files. That will give a good flow for the help
> text. Most of the rest will be shorter anyways.
>
> But the makefiles have longer lines. The banner above the stage are already
> 78 chars wide and many of the variables at the top as well.
> And for the rest, readability really depends on the content and a defined
> textwidth suggests a hard limit that I don't want to set.
>
> Maybe a soft visual limit with cc=80 instead?
You are right the limits are too low.
I dug a little into how many lines are longer than 72, 80, 100 and 120 in
kconfig (*.in) and makefiles (*.make).
grep -n '.\{72\}' rules/*.in | wc -l
579
grep -n '.\{80\}' rules/*.in | wc -l
108
grep -n '.\{100\}' rules/*.in | wc -l
22
grep -n '.\{120\}' rules/*.in | wc -l
10
grep -n '.\{72\}' rules/*.make | wc -l
15364
grep -n '.\{80\}' rules/*.make | wc -l
5913
grep -n '.\{100\}' rules/*.make | wc -l
1651
grep -n '.\{120\}' rules/*.make | wc -l
408
Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
and cc=100 on makefiles?
/Bruno
>
> Michael
>
> >
> > VS Code can also use it with modelines extention.
> >
> > Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> > ---
> > rules/templates/template-barebox-imx-habv4-in | 2 ++
> > rules/templates/template-barebox-imx-habv4-make | 2 +-
> > rules/templates/template-barebox-in | 2 ++
> > rules/templates/template-barebox-make | 2 +-
> > rules/templates/template-blspec-entry-in | 2 ++
> > rules/templates/template-blspec-entry-make | 2 +-
> > rules/templates/template-class-existing-target-in | 2 ++
> > rules/templates/template-class-existing-target-make | 2 +-
> > rules/templates/template-class-in | 2 ++
> > rules/templates/template-class-make | 2 +-
> > rules/templates/template-code-signing-provider-choice-in | 2 ++
> > rules/templates/template-code-signing-provider-in | 2 ++
> > rules/templates/template-code-signing-provider-make | 2 +-
> > rules/templates/template-code-signing-provider-pre-make | 2 +-
> > rules/templates/template-file-in | 2 ++
> > rules/templates/template-file-make | 2 +-
> > rules/templates/template-font-in | 2 ++
> > rules/templates/template-font-make | 2 +-
> > rules/templates/template-host-python3-in | 2 ++
> > rules/templates/template-host-python3-make | 2 +-
> > rules/templates/template-image-fit-in | 2 ++
> > rules/templates/template-image-fit-make | 2 +-
> > rules/templates/template-image-genimage-in | 2 ++
> > rules/templates/template-image-genimage-make | 2 +-
> > rules/templates/template-image-tgz-in | 2 ++
> > rules/templates/template-image-tgz-make | 2 +-
> > rules/templates/template-kernel-in | 2 ++
> > rules/templates/template-kernel-make | 2 +-
> > rules/templates/template-python3-in | 2 ++
> > rules/templates/template-python3-make | 2 +-
> > rules/templates/template-src-autoconf-in | 2 ++
> > rules/templates/template-src-autoconf-make | 2 +-
> > rules/templates/template-src-cmake-prog-in | 2 ++
> > rules/templates/template-src-cmake-prog-make | 2 +-
> > rules/templates/template-src-linux-driver-in | 2 ++
> > rules/templates/template-src-linux-driver-make | 2 +-
> > rules/templates/template-src-make-prog-in | 2 ++
> > rules/templates/template-src-make-prog-make | 2 +-
> > rules/templates/template-src-meson-prog-in | 2 ++
> > rules/templates/template-src-meson-prog-make | 2 +-
> > rules/templates/template-src-qmake-prog-in | 2 ++
> > rules/templates/template-src-qmake-prog-make | 2 +-
> > rules/templates/template-src-stellaris-in | 2 ++
> > rules/templates/template-src-stellaris-make | 2 +-
> > rules/templates/template-target-in | 2 ++
> > rules/templates/template-target-make | 2 +-
> > 46 files changed, 69 insertions(+), 23 deletions(-)
> >
> > diff --git a/rules/templates/template-barebox-imx-habv4-in b/rules/templates/template-barebox-imx-habv4-in
> > index 16258cbee..381435fa3 100644
> > --- a/rules/templates/template-barebox-imx-habv4-in
> > +++ b/rules/templates/template-barebox-imx-habv4-in
> > @@ -17,3 +17,5 @@ config BAREBOX_@PACKAGE@
> > Enable this to add the public keys for the FIT image:
> > CONFIG_CRYPTO_RSA_KEY="__ENV__FIT_KEY"
> > CONFIG_CRYPTO_RSA_KEY_NAME_HINT="image-kernel-fit"
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-barebox-imx-habv4-make b/rules/templates/template-barebox-imx-habv4-make
> > index d87729eff..7fdb3a535 100644
> > --- a/rules/templates/template-barebox-imx-habv4-make
> > +++ b/rules/templates/template-barebox-imx-habv4-make
> > @@ -106,4 +106,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> > $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> > @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-barebox-in b/rules/templates/template-barebox-in
> > index 44d920f4f..064c54a74 100644
> > --- a/rules/templates/template-barebox-in
> > +++ b/rules/templates/template-barebox-in
> > @@ -5,3 +5,5 @@ config BAREBOX_@PACKAGE@
> > prompt "Barebox (@package@)"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-barebox-make b/rules/templates/template-barebox-make
> > index 6821d65b9..48ed38886 100644
> > --- a/rules/templates/template-barebox-make
> > +++ b/rules/templates/template-barebox-make
> > @@ -86,4 +86,4 @@ $(STATEDIR)/barebox-@package@.targetinstall:
> > $(call ptx/kconfig-targets, barebox-@package@): $(STATEDIR)/barebox-@package@.extract
> > @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-blspec-entry-in b/rules/templates/template-blspec-entry-in
> > index c17e3ed8c..0966b4adb 100644
> > --- a/rules/templates/template-blspec-entry-in
> > +++ b/rules/templates/template-blspec-entry-in
> > @@ -3,3 +3,5 @@
> > config BLSPEC_@PACKAGE@
> > tristate
> > prompt "/loader/entries/@ENTRY@ bootloader spec entry"
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-blspec-entry-make b/rules/templates/template-blspec-entry-make
> > index 88c904666..68ef5c520 100644
> > --- a/rules/templates/template-blspec-entry-make
> > +++ b/rules/templates/template-blspec-entry-make
> > @@ -33,4 +33,4 @@ $(STATEDIR)/blspec-@package@.targetinstall:
> >
> > @$(call touch)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-class-existing-target-in b/rules/templates/template-class-existing-target-in
> > index b1c8e7102..8f11d5fbb 100644
> > --- a/rules/templates/template-class-existing-target-in
> > +++ b/rules/templates/template-class-existing-target-in
> > @@ -3,3 +3,5 @@
> > config @CLASS@@PACKAGE@
> > tristate
> > @DEFAULT@@SELECT@@PROMPT@
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-class-existing-target-make b/rules/templates/template-class-existing-target-make
> > index 752036ccc..df28632ae 100644
> > --- a/rules/templates/template-class-existing-target-make
> > +++ b/rules/templates/template-class-existing-target-make
> > @@ -66,4 +66,4 @@
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @CLASS@@PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-class-in b/rules/templates/template-class-in
> > index b1c8e7102..8f11d5fbb 100644
> > --- a/rules/templates/template-class-in
> > +++ b/rules/templates/template-class-in
> > @@ -3,3 +3,5 @@
> > config @CLASS@@PACKAGE@
> > tristate
> > @DEFAULT@@SELECT@@PROMPT@
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-class-make b/rules/templates/template-class-make
> > index 205e0a10f..2e8d459b3 100644
> > --- a/rules/templates/template-class-make
> > +++ b/rules/templates/template-class-make
> > @@ -75,4 +75,4 @@
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @CLASS@@PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-code-signing-provider-choice-in b/rules/templates/template-code-signing-provider-choice-in
> > index e2108f870..448dbf023 100644
> > --- a/rules/templates/template-code-signing-provider-choice-in
> > +++ b/rules/templates/template-code-signing-provider-choice-in
> > @@ -3,3 +3,5 @@
> > config CODE_SIGNING_PROVIDER_@PACKAGE@
> > bool
> > prompt "@package@"
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-code-signing-provider-in b/rules/templates/template-code-signing-provider-in
> > index b84ba839c..374d450af 100644
> > --- a/rules/templates/template-code-signing-provider-in
> > +++ b/rules/templates/template-code-signing-provider-in
> > @@ -12,3 +12,5 @@ config HOST_@PACKAGE@_CODE_SIGNING
> > select HOST_OPENSSL
> > select HOST_EXTRACT_CERT
> > @EXTRA_DEPENDENCIES@
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-code-signing-provider-make b/rules/templates/template-code-signing-provider-make
> > index 4cf9cac35..22e11db22 100644
> > --- a/rules/templates/template-code-signing-provider-make
> > +++ b/rules/templates/template-code-signing-provider-make
> > @@ -39,4 +39,4 @@ $(STATEDIR)/host-@package@-code-signing.install:
> > @$(call targetinfo)
> > @$(call touch)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-code-signing-provider-pre-make b/rules/templates/template-code-signing-provider-pre-make
> > index 90b58d2c2..21ad0eb85 100644
> > --- a/rules/templates/template-code-signing-provider-pre-make
> > +++ b/rules/templates/template-code-signing-provider-pre-make
> > @@ -15,4 +15,4 @@ CODE_SIGNING_ENV += \
> > #$(call ptx/online-code-signing-provider)
> > endif
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-file-in b/rules/templates/template-file-in
> > index e5cdde569..4bd575fdd 100644
> > --- a/rules/templates/template-file-in
> > +++ b/rules/templates/template-file-in
> > @@ -5,3 +5,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-file-make b/rules/templates/template-file-make
> > index 54268bdbc..ae143e3a9 100644
> > --- a/rules/templates/template-file-make
> > +++ b/rules/templates/template-file-make
> > @@ -84,4 +84,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-font-in b/rules/templates/template-font-in
> > index bf20d50bf..f38fca8ef 100644
> > --- a/rules/templates/template-font-in
> > +++ b/rules/templates/template-font-in
> > @@ -6,3 +6,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-font-make b/rules/templates/template-font-make
> > index 13a59041b..203893f92 100644
> > --- a/rules/templates/template-font-make
> > +++ b/rules/templates/template-font-make
> > @@ -66,4 +66,4 @@ $(STATEDIR)/@package@.targetinstall:
> >
> > @$(call touch)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-host-python3-in b/rules/templates/template-host-python3-in
> > index 87a8004ae..b5b82ff79 100644
> > --- a/rules/templates/template-host-python3-in
> > +++ b/rules/templates/template-host-python3-in
> > @@ -4,3 +4,5 @@ config @PREFIX@_@PACKAGE@
> > tristate
> > default y if ALLYES
> > select @PREFIX@
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-host-python3-make b/rules/templates/template-host-python3-make
> > index c3b766bab..7fa07571e 100644
> > --- a/rules/templates/template-host-python3-make
> > +++ b/rules/templates/template-host-python3-make
> > @@ -30,4 +30,4 @@ HOST_PACKAGES-$(PTXCONF_@PREFIX@_@PACKAGE@) += @prefix@-@package@
> >
> > @PREFIX@_@PACKAGE@_CONF_TOOL := python3
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-fit-in b/rules/templates/template-image-fit-in
> > index 1a89153fc..5375a7c4c 100644
> > --- a/rules/templates/template-image-fit-in
> > +++ b/rules/templates/template-image-fit-in
> > @@ -8,3 +8,5 @@ config IMAGE_@PACKAGE@
> > prompt "Generate images/@package@.fit"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-fit-make b/rules/templates/template-image-fit-make
> > index cd57d24df..8244e0ff1 100644
> > --- a/rules/templates/template-image-fit-make
> > +++ b/rules/templates/template-image-fit-make
> > @@ -31,4 +31,4 @@ $(IMAGE_@PACKAGE@_IMAGE): $(IMAGE_@PACKAGE@_KERNEL) $(IMAGE_@PACKAGE@_INITRAMFS)
> > @$(call world/image-fit, IMAGE_@PACKAGE@)
> > @$(call finish)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-genimage-in b/rules/templates/template-image-genimage-in
> > index 28a95d6d9..8d9e1781e 100644
> > --- a/rules/templates/template-image-genimage-in
> > +++ b/rules/templates/template-image-genimage-in
> > @@ -6,3 +6,5 @@ config IMAGE_@PACKAGE@
> > prompt "Generate images/@package@.@TYPE@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-genimage-make b/rules/templates/template-image-genimage-make
> > index 9ca5309d2..72c9e2cc8 100644
> > --- a/rules/templates/template-image-genimage-make
> > +++ b/rules/templates/template-image-genimage-make
> > @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_IMAGE):
> > @$(call image/genimage, IMAGE_@PACKAGE@)
> > @$(call finish)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-tgz-in b/rules/templates/template-image-tgz-in
> > index cdb0712f6..b949e2f97 100644
> > --- a/rules/templates/template-image-tgz-in
> > +++ b/rules/templates/template-image-tgz-in
> > @@ -5,3 +5,5 @@ config IMAGE_@PACKAGE@_TGZ
> > prompt "Generate images/@package@.tgz"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-image-tgz-make b/rules/templates/template-image-tgz-make
> > index 1a2cb7a07..f12fc45bf 100644
> > --- a/rules/templates/template-image-tgz-make
> > +++ b/rules/templates/template-image-tgz-make
> > @@ -29,4 +29,4 @@ $(IMAGE_@PACKAGE@_TGZ_IMAGE):
> > @$(call image/archive, IMAGE_@PACKAGE@_TGZ)
> > @$(call finish)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-kernel-in b/rules/templates/template-kernel-in
> > index cd0b4042a..a0e2f6635 100644
> > --- a/rules/templates/template-kernel-in
> > +++ b/rules/templates/template-kernel-in
> > @@ -8,3 +8,5 @@ config KERNEL_@PACKAGE@
> > #select HOST_U_BOOT_TOOLS
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-kernel-make b/rules/templates/template-kernel-make
> > index 38a953c84..0c95f415f 100644
> > --- a/rules/templates/template-kernel-make
> > +++ b/rules/templates/template-kernel-make
> > @@ -151,4 +151,4 @@ $(STATEDIR)/kernel-@package@.targetinstall:
> > $(call ptx/kconfig-targets, kernel-@package@): $(STATEDIR)/kernel-@package@.extract
> > @$(call world/kconfig, KERNEL_@PACKAGE@, $(subst kernel-@package@_,,$@))
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-python3-in b/rules/templates/template-python3-in
> > index 5f758f5bd..e8c40db88 100644
> > --- a/rules/templates/template-python3-in
> > +++ b/rules/templates/template-python3-in
> > @@ -6,3 +6,5 @@ config PYTHON3_@PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-python3-make b/rules/templates/template-python3-make
> > index 90884a2d8..ec3bd44ac 100644
> > --- a/rules/templates/template-python3-make
> > +++ b/rules/templates/template-python3-make
> > @@ -50,4 +50,4 @@ $(STATEDIR)/python3-@package@.targetinstall:
> >
> > @$(call touch)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-autoconf-in b/rules/templates/template-src-autoconf-in
> > index bd724effb..a18a8c229 100644
> > --- a/rules/templates/template-src-autoconf-in
> > +++ b/rules/templates/template-src-autoconf-in
> > @@ -5,3 +5,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-autoconf-make b/rules/templates/template-src-autoconf-make
> > index d8d61988b..d1f063915 100644
> > --- a/rules/templates/template-src-autoconf-make
> > +++ b/rules/templates/template-src-autoconf-make
> > @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-cmake-prog-in b/rules/templates/template-src-cmake-prog-in
> > index 37e6541dd..32e35b310 100644
> > --- a/rules/templates/template-src-cmake-prog-in
> > +++ b/rules/templates/template-src-cmake-prog-in
> > @@ -6,3 +6,5 @@ config @PACKAGE@
> > select HOST_CMAKE
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-cmake-prog-make b/rules/templates/template-src-cmake-prog-make
> > index 9d724f21b..b3b63e408 100644
> > --- a/rules/templates/template-src-cmake-prog-make
> > +++ b/rules/templates/template-src-cmake-prog-make
> > @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-linux-driver-in b/rules/templates/template-src-linux-driver-in
> > index 4d0463a9f..98071c9a0 100644
> > --- a/rules/templates/template-src-linux-driver-in
> > +++ b/rules/templates/template-src-linux-driver-in
> > @@ -7,3 +7,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-linux-driver-make b/rules/templates/template-src-linux-driver-make
> > index 4f4009472..a165f9d71 100644
> > --- a/rules/templates/template-src-linux-driver-make
> > +++ b/rules/templates/template-src-linux-driver-make
> > @@ -63,4 +63,4 @@ $(STATEDIR)/@package@.targetinstall:
> > @$(call compile, @PACKAGE@, $(@PACKAGE@_MAKE_OPT)_install)
> > @$(call touch)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-make-prog-in b/rules/templates/template-src-make-prog-in
> > index e5cdde569..4bd575fdd 100644
> > --- a/rules/templates/template-src-make-prog-in
> > +++ b/rules/templates/template-src-make-prog-in
> > @@ -5,3 +5,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-make-prog-make b/rules/templates/template-src-make-prog-make
> > index 9bd5c8dc5..0d81d9f2b 100644
> > --- a/rules/templates/template-src-make-prog-make
> > +++ b/rules/templates/template-src-make-prog-make
> > @@ -95,4 +95,4 @@ $(STATEDIR)/@package@.clean:
> > @-$(call execute, @PACKAGE@, $(@PACKAGE@_MAKE_ENV) $(MAKE) clean)
> > @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-meson-prog-in b/rules/templates/template-src-meson-prog-in
> > index 34dc24f9f..6142b6ba4 100644
> > --- a/rules/templates/template-src-meson-prog-in
> > +++ b/rules/templates/template-src-meson-prog-in
> > @@ -6,3 +6,5 @@ config @PACKAGE@
> > select HOST_MESON
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-meson-prog-make b/rules/templates/template-src-meson-prog-make
> > index 5396db40c..64ce2409a 100644
> > --- a/rules/templates/template-src-meson-prog-make
> > +++ b/rules/templates/template-src-meson-prog-make
> > @@ -74,4 +74,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-qmake-prog-in b/rules/templates/template-src-qmake-prog-in
> > index a20378948..6890e5983 100644
> > --- a/rules/templates/template-src-qmake-prog-in
> > +++ b/rules/templates/template-src-qmake-prog-in
> > @@ -6,3 +6,5 @@ config @PACKAGE@
> > select QT5
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-qmake-prog-make b/rules/templates/template-src-qmake-prog-make
> > index 3d9156499..5a67e23bc 100644
> > --- a/rules/templates/template-src-qmake-prog-make
> > +++ b/rules/templates/template-src-qmake-prog-make
> > @@ -77,4 +77,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-stellaris-in b/rules/templates/template-src-stellaris-in
> > index d255fec84..f7436c1fc 100644
> > --- a/rules/templates/template-src-stellaris-in
> > +++ b/rules/templates/template-src-stellaris-in
> > @@ -6,3 +6,5 @@ config @PACKAGE@
> > prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-src-stellaris-make b/rules/templates/template-src-stellaris-make
> > index 750724376..68f025a9d 100644
> > --- a/rules/templates/template-src-stellaris-make
> > +++ b/rules/templates/template-src-stellaris-make
> > @@ -102,4 +102,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call clean_pkg, @PACKAGE@)
> >
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-target-in b/rules/templates/template-target-in
> > index ac8b3aa47..cb1d6eefb 100644
> > --- a/rules/templates/template-target-in
> > +++ b/rules/templates/template-target-in
> > @@ -5,3 +5,5 @@ config @PACKAGE@
> > @SELECT@ prompt "@package@"
> > help
> > FIXME
> > +
> > +# vim: ft=kconfig noet tw=72 ts=8 sw=8
> > diff --git a/rules/templates/template-target-make b/rules/templates/template-target-make
> > index 6add94b3d..e0ebe4d34 100644
> > --- a/rules/templates/template-target-make
> > +++ b/rules/templates/template-target-make
> > @@ -94,4 +94,4 @@ $(STATEDIR)/@package@.targetinstall:
> > # @$(call targetinfo)
> > # @$(call clean_pkg, @PACKAGE@)
> >
> > -# vim: syntax=make
> > +# vim: ft=make noet tw=72 ts=8 sw=8
> >
> > base-commit: 8b4232c8d76fccd51e7338379f449add3183f0b9
> > --
> > 2.50.1
> >
> >
> >
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-23 17:03 ` Bruno Thomsen
@ 2025-07-24 7:51 ` Markus Heidelberg via ptxdist
2025-07-24 9:35 ` Bruno Thomsen
0 siblings, 1 reply; 10+ messages in thread
From: Markus Heidelberg via ptxdist @ 2025-07-24 7:51 UTC (permalink / raw)
To: ptxdist; +Cc: Markus Heidelberg, Michael Olbrich, Bruno Thomsen
On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> <m.olbrich@pengutronix.de>:
> >
> > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > Setup sane editor default using vim modeline.
> > >
> > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> >
> > tw=72 is fine for the .in files. That will give a good flow for the help
> > text. Most of the rest will be shorter anyways.
> >
> > But the makefiles have longer lines. The banner above the stage are already
> > 78 chars wide and many of the variables at the top as well.
> > And for the rest, readability really depends on the content and a defined
> > textwidth suggests a hard limit that I don't want to set.
> >
> > Maybe a soft visual limit with cc=80 instead?
>
> [...]
>
> Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> and cc=100 on makefiles?
I don't think such a visual setting should be imposed on the user and
could annoy some, myself included ;)
Is this a problem in practice that has to be tackled at all?
Markus
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-24 7:51 ` Markus Heidelberg via ptxdist
@ 2025-07-24 9:35 ` Bruno Thomsen
2025-07-25 9:42 ` Michael Olbrich
0 siblings, 1 reply; 10+ messages in thread
From: Bruno Thomsen @ 2025-07-24 9:35 UTC (permalink / raw)
To: Markus Heidelberg; +Cc: Michael Olbrich, ptxdist
Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
>
> On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > <m.olbrich@pengutronix.de>:
> > >
> > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > Setup sane editor default using vim modeline.
> > > >
> > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > >
> > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > text. Most of the rest will be shorter anyways.
> > >
> > > But the makefiles have longer lines. The banner above the stage are already
> > > 78 chars wide and many of the variables at the top as well.
> > > And for the rest, readability really depends on the content and a defined
> > > textwidth suggests a hard limit that I don't want to set.
> > >
> > > Maybe a soft visual limit with cc=80 instead?
> >
> > [...]
> >
> > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > and cc=100 on makefiles?
>
> I don't think such a visual setting should be imposed on the user and
> could annoy some, myself included ;)
>
> Is this a problem in practice that has to be tackled at all?
Indentation and file format are my primary reasons for adding modeline.
Make it much easier to work on when you switch between 5-10 formats
each day.
Personally I like to have automation tell me when lines need to be broken,
as it can generally give you a hit if you should refactor a code section for
smaller indentation so it's easier to read.
/Bruno
>
> Markus
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-24 9:35 ` Bruno Thomsen
@ 2025-07-25 9:42 ` Michael Olbrich
2025-07-25 10:07 ` Alexander Dahl via ptxdist
0 siblings, 1 reply; 10+ messages in thread
From: Michael Olbrich @ 2025-07-25 9:42 UTC (permalink / raw)
To: Bruno Thomsen; +Cc: ptxdist, Markus Heidelberg
On Thu, Jul 24, 2025 at 11:35:34AM +0200, Bruno Thomsen wrote:
> Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
> >
> > On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > > <m.olbrich@pengutronix.de>:
> > > >
> > > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > > Setup sane editor default using vim modeline.
> > > > >
> > > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > > >
> > > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > > text. Most of the rest will be shorter anyways.
> > > >
> > > > But the makefiles have longer lines. The banner above the stage are already
> > > > 78 chars wide and many of the variables at the top as well.
> > > > And for the rest, readability really depends on the content and a defined
> > > > textwidth suggests a hard limit that I don't want to set.
> > > >
> > > > Maybe a soft visual limit with cc=80 instead?
> > >
> > > [...]
> > >
> > > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > > and cc=100 on makefiles?
> >
> > I don't think such a visual setting should be imposed on the user and
> > could annoy some, myself included ;)
> >
> > Is this a problem in practice that has to be tackled at all?
I do request more line-breaks when I review patches. It's not that often
that I think we need urgent changes. But defining a good default in some
way makes sense.
> Indentation and file format are my primary reasons for adding modeline.
> Make it much easier to work on when you switch between 5-10 formats
> each day.
So vim detect the file format for kconfig without any help. But I don't
mind adding it explicitly.
For 'noet ts=8 sw=8' we could also create a editorconfig file. That would
work with more editors (with the appropriate plugins).
> Personally I like to have automation tell me when lines need to be broken,
> as it can generally give you a hit if you should refactor a code section for
> smaller indentation so it's easier to read.
Lets do tw=80 for the .in files and no width limit (for now) for the .make
files.
Michael
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-25 9:42 ` Michael Olbrich
@ 2025-07-25 10:07 ` Alexander Dahl via ptxdist
2025-07-25 14:34 ` Michael Olbrich
2025-07-25 14:42 ` Michael Olbrich
0 siblings, 2 replies; 10+ messages in thread
From: Alexander Dahl via ptxdist @ 2025-07-25 10:07 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl, Markus Heidelberg, Bruno Thomsen
Hello,
Am Fri, Jul 25, 2025 at 11:42:31AM +0200 schrieb Michael Olbrich:
> On Thu, Jul 24, 2025 at 11:35:34AM +0200, Bruno Thomsen wrote:
> > Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
> > >
> > > On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > > > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > > > <m.olbrich@pengutronix.de>:
> > > > >
> > > > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > > > Setup sane editor default using vim modeline.
> > > > > >
> > > > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > > > >
> > > > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > > > text. Most of the rest will be shorter anyways.
> > > > >
> > > > > But the makefiles have longer lines. The banner above the stage are already
> > > > > 78 chars wide and many of the variables at the top as well.
> > > > > And for the rest, readability really depends on the content and a defined
> > > > > textwidth suggests a hard limit that I don't want to set.
> > > > >
> > > > > Maybe a soft visual limit with cc=80 instead?
> > > >
> > > > [...]
> > > >
> > > > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > > > and cc=100 on makefiles?
> > >
> > > I don't think such a visual setting should be imposed on the user and
> > > could annoy some, myself included ;)
> > >
> > > Is this a problem in practice that has to be tackled at all?
>
> I do request more line-breaks when I review patches. It's not that often
> that I think we need urgent changes. But defining a good default in some
> way makes sense.
>
> > Indentation and file format are my primary reasons for adding modeline.
> > Make it much easier to work on when you switch between 5-10 formats
> > each day.
>
> So vim detect the file format for kconfig without any help. But I don't
> mind adding it explicitly.
Not on my machine(s), at least not for files named 'package.in' like in
ptxdist. It does only set ft=kconfig automatically for files named
'Kconfig' like in the linux kernel source tree.
> For 'noet ts=8 sw=8' we could also create a editorconfig file. That would
> work with more editors (with the appropriate plugins).
+1 for that.
> > Personally I like to have automation tell me when lines need to be broken,
> > as it can generally give you a hit if you should refactor a code section for
> > smaller indentation so it's easier to read.
>
> Lets do tw=80 for the .in files and no width limit (for now) for the .make
> files.
Ack.
Greets
Alex
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-25 10:07 ` Alexander Dahl via ptxdist
@ 2025-07-25 14:34 ` Michael Olbrich
2025-07-25 14:42 ` Michael Olbrich
1 sibling, 0 replies; 10+ messages in thread
From: Michael Olbrich @ 2025-07-25 14:34 UTC (permalink / raw)
To: ptxdist, Bruno Thomsen, Markus Heidelberg
On Fri, Jul 25, 2025 at 12:07:16PM +0200, Alexander Dahl via ptxdist wrote:
> Hello,
>
> Am Fri, Jul 25, 2025 at 11:42:31AM +0200 schrieb Michael Olbrich:
> > On Thu, Jul 24, 2025 at 11:35:34AM +0200, Bruno Thomsen wrote:
> > > Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
> > > >
> > > > On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > > > > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > > > > <m.olbrich@pengutronix.de>:
> > > > > >
> > > > > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > > > > Setup sane editor default using vim modeline.
> > > > > > >
> > > > > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > > > > >
> > > > > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > > > > text. Most of the rest will be shorter anyways.
> > > > > >
> > > > > > But the makefiles have longer lines. The banner above the stage are already
> > > > > > 78 chars wide and many of the variables at the top as well.
> > > > > > And for the rest, readability really depends on the content and a defined
> > > > > > textwidth suggests a hard limit that I don't want to set.
> > > > > >
> > > > > > Maybe a soft visual limit with cc=80 instead?
> > > > >
> > > > > [...]
> > > > >
> > > > > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > > > > and cc=100 on makefiles?
> > > >
> > > > I don't think such a visual setting should be imposed on the user and
> > > > could annoy some, myself included ;)
> > > >
> > > > Is this a problem in practice that has to be tackled at all?
> >
> > I do request more line-breaks when I review patches. It's not that often
> > that I think we need urgent changes. But defining a good default in some
> > way makes sense.
> >
> > > Indentation and file format are my primary reasons for adding modeline.
> > > Make it much easier to work on when you switch between 5-10 formats
> > > each day.
> >
> > So vim detect the file format for kconfig without any help. But I don't
> > mind adding it explicitly.
>
> Not on my machine(s), at least not for files named 'package.in' like in
> ptxdist. It does only set ft=kconfig automatically for files named
> 'Kconfig' like in the linux kernel source tree.
Right, I have file type detection code for that somewhere in my vim
configuration... :-)
Michael
> > For 'noet ts=8 sw=8' we could also create a editorconfig file. That would
> > work with more editors (with the appropriate plugins).
>
> +1 for that.
>
> > > Personally I like to have automation tell me when lines need to be broken,
> > > as it can generally give you a hit if you should refactor a code section for
> > > smaller indentation so it's easier to read.
> >
> > Lets do tw=80 for the .in files and no width limit (for now) for the .make
> > files.
>
> Ack.
>
> Greets
> Alex
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
2025-07-25 10:07 ` Alexander Dahl via ptxdist
2025-07-25 14:34 ` Michael Olbrich
@ 2025-07-25 14:42 ` Michael Olbrich
1 sibling, 0 replies; 10+ messages in thread
From: Michael Olbrich @ 2025-07-25 14:42 UTC (permalink / raw)
To: ptxdist, Bruno Thomsen, Markus Heidelberg
On Fri, Jul 25, 2025 at 12:07:16PM +0200, Alexander Dahl via ptxdist wrote:
> Hello,
>
> Am Fri, Jul 25, 2025 at 11:42:31AM +0200 schrieb Michael Olbrich:
> > On Thu, Jul 24, 2025 at 11:35:34AM +0200, Bruno Thomsen wrote:
> > > Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
> > > >
> > > > On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > > > > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > > > > <m.olbrich@pengutronix.de>:
> > > > > >
> > > > > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > > > > Setup sane editor default using vim modeline.
> > > > > > >
> > > > > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > > > > >
> > > > > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > > > > text. Most of the rest will be shorter anyways.
> > > > > >
> > > > > > But the makefiles have longer lines. The banner above the stage are already
> > > > > > 78 chars wide and many of the variables at the top as well.
> > > > > > And for the rest, readability really depends on the content and a defined
> > > > > > textwidth suggests a hard limit that I don't want to set.
> > > > > >
> > > > > > Maybe a soft visual limit with cc=80 instead?
> > > > >
> > > > > [...]
> > > > >
> > > > > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > > > > and cc=100 on makefiles?
> > > >
> > > > I don't think such a visual setting should be imposed on the user and
> > > > could annoy some, myself included ;)
> > > >
> > > > Is this a problem in practice that has to be tackled at all?
> >
> > I do request more line-breaks when I review patches. It's not that often
> > that I think we need urgent changes. But defining a good default in some
> > way makes sense.
> >
> > > Indentation and file format are my primary reasons for adding modeline.
> > > Make it much easier to work on when you switch between 5-10 formats
> > > each day.
> >
> > So vim detect the file format for kconfig without any help. But I don't
> > mind adding it explicitly.
>
> Not on my machine(s), at least not for files named 'package.in' like in
> ptxdist. It does only set ft=kconfig automatically for files named
> 'Kconfig' like in the linux kernel source tree.
>
> > For 'noet ts=8 sw=8' we could also create a editorconfig file. That would
> > work with more editors (with the appropriate plugins).
>
> +1 for that.
Should probably look like this:
-------------------------
root = true
[*]
indent_style = tab
tab_width = 8
indent_size = 8
insert_final_newline = true
trim_trailing_whitespace = true
[*.sh]
indent_size = 4
[*.py]
indent_style = space
tab_width = 4
indent_size = 4
-------------------------
Michael
> > > Personally I like to have automation tell me when lines need to be broken,
> > > as it can generally give you a hit if you should refactor a code section for
> > > smaller indentation so it's easier to read.
> >
> > Lets do tw=80 for the .in files and no width limit (for now) for the .make
> > files.
>
> Ack.
>
> Greets
> Alex
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-07-25 14:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-16 19:22 [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files Bruno Thomsen
2025-07-17 6:31 ` Alexander Dahl via ptxdist
2025-07-23 7:11 ` Michael Olbrich
2025-07-23 17:03 ` Bruno Thomsen
2025-07-24 7:51 ` Markus Heidelberg via ptxdist
2025-07-24 9:35 ` Bruno Thomsen
2025-07-25 9:42 ` Michael Olbrich
2025-07-25 10:07 ` Alexander Dahl via ptxdist
2025-07-25 14:34 ` Michael Olbrich
2025-07-25 14:42 ` Michael Olbrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox