]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(misc): unset compiler in various ftplugins
authorKonfekt <Konfekt@users.noreply.github.com>
Sat, 5 Oct 2024 15:26:46 +0000 (17:26 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 5 Oct 2024 15:26:46 +0000 (17:26 +0200)
just to foster best practices

closes: #15798

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/ftplugin/context.vim
runtime/ftplugin/hare.vim
runtime/ftplugin/jq.vim
runtime/ftplugin/requirements.vim
runtime/ftplugin/rust.vim
runtime/ftplugin/typst.vim
runtime/ftplugin/yaml.vim
runtime/ftplugin/zig.vim

index 0070f854251641d22c57d2b449af5dfa13eb9a92..b39a306d73e60877584f8fef3532c830f3a45fab 100644 (file)
@@ -4,7 +4,7 @@ vim9script
 # Language:           ConTeXt typesetting engine
 # Maintainer:         Nicola Vitacolonna <nvitacolonna@gmail.com>
 # Former Maintainers: Nikolai Weibull <now@bitwi.se>
-# Latest Revision:    2023 Dec 26
+# Latest Revision:    2024 Oct 04
 
 if exists("b:did_ftplugin")
   finish
@@ -14,10 +14,6 @@ import autoload '../autoload/context.vim'
 
 b:did_ftplugin = 1
 
-if !exists('current_compiler')
-  compiler context
-endif
-
 b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<"
 
 setlocal comments=b:%D,b:%C,b:%M,:%
@@ -106,6 +102,12 @@ if !get(g:, 'no_context_maps', 0) && !get(g:, 'no_plugin_maps', 0)
   endfor
 endif
 
+if !exists('current_compiler')
+  b:undo_ftplugin ..= "| compiler make"
+  compiler context
+endif
+
+b:undo_ftplugin ..= "| sil! delc -buffer ConTeXt | sil! delc -buffer ConTeXtLog | sil! delc -buffer ConTeXtJobStatus | sil! delc -buffer ConTeXtStopJobs"
 # Commands for asynchronous typesetting
 command! -buffer -nargs=? -complete=buffer ConTeXt          context.Typeset(<q-args>)
 command! -buffer -nargs=0                  ConTeXtLog       context.Log('%')
index 422bb7b4e8acafcc20448c938b7aa1783913767b..6c61c818d19a34ff6871bd39200a96682970c3ee 100644 (file)
@@ -1,7 +1,7 @@
 " Vim filetype plugin.
 " Language:     Hare
 " Maintainer:   Amelia Clarke <selene@perilune.dev>
-" Last Updated: 2024-05-10
+" Last Updated: 2024 Oct 04
 " Upstream:     https://git.sr.ht/~sircmpwn/hare.vim
 
 if exists('b:did_ftplugin')
@@ -12,9 +12,6 @@ let b:did_ftplugin = 1
 let s:cpo_save = &cpo
 set cpo&vim
 
-" Set the default compiler.
-compiler hare
-
 " Formatting settings.
 setlocal comments=://
 setlocal commentstring=//\ %s
@@ -53,6 +50,11 @@ augroup hare.vim
   endif
 augroup END
 
+if !exists('current_compiler')
+  let b:undo_ftplugin .= "| compiler make"
+  compiler hare
+endif
+
 let &cpo = s:cpo_save
 unlet s:cpo_save
 
index d25883640b2374a9113abc92bb2a30db7ec38660..307fbdb62dcd1195395d022115aeb906292cfa1b 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:  Vito <vito.blog@gmail.com>
 " Last Change: 2024 Apr 29
 "              2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
+"              2024 Oct 04 by Konfekt (unset compiler)
 " Upstream: https://github.com/vito-c/jq.vim
 
 if exists('b:did_ftplugin')
@@ -12,6 +13,11 @@ let b:did_ftplugin = 1
 
 setlocal include=^\\s*\\%(import\\\|include\\)
 setlocal commentstring=#\ %s
-compiler jq
 
 let b:undo_ftplugin = 'setl commentstring< include<'
+
+if !exists('current_compiler')
+  let b:undo_ftplugin ..= "| compiler make"
+  compiler jq
+endif
+
index fcfc1ac269b51d61611192ac45d7cd59c8ad9db4..babf33795cfee97b4dcf79011a857af5c024a5a8 100644 (file)
@@ -36,7 +36,11 @@ let b:undo_ftplugin = "setl iskeyword< commentstring<"
 " pip options contain "-"
 setlocal iskeyword+=-
 setlocal commentstring=#\ %s
-compiler pip_compile
+
+if !exists('current_compiler')
+  let b:undo_ftplugin ..= "| compiler make"
+  compiler  pip_compile
+endif
 
 let &cpoptions = s:save_cpoptions
 unlet s:save_cpoptions
index c2bcdd34bc13dde48a065814db41273e901c5aaa..3e2741f919cc5e01bce7d85e9ffe0c79d9a572c4 100644 (file)
@@ -148,6 +148,7 @@ endif
 " Cleanup {{{1
 
 let b:undo_ftplugin = "
+            \ compiler make |
             \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd<
             \|if exists('b:rust_set_style')
                 \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
index fba8083717d18cc5f8804387b3bf9975ca6635c3..895fc688d9c937f88790792f6543632238df1fa2 100644 (file)
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:    Typst
 " Maintainer:  Gregory Anders
-" Last Change: 2024-07-14
+" Last Change: 2024 Oct 04
 " Based on:    https://github.com/kaarmu/typst.vim
 
 if exists('b:did_ftplugin')
@@ -9,8 +9,6 @@ if exists('b:did_ftplugin')
 endif
 let b:did_ftplugin = 1
 
-compiler typst
-
 setlocal commentstring=//\ %s
 setlocal comments=s1:/*,mb:*,ex:*/,://
 setlocal formatoptions+=croq
@@ -22,3 +20,8 @@ if get(g:, 'typst_conceal', 0)
   setlocal conceallevel=2
   let b:undo_ftplugin .= ' cole<'
 endif
+
+if !exists('current_compiler')
+  compiler typst
+  let b:undo_ftplugin ..= "| compiler make"
+endif
index 8bfc45e4c83fa05c90544c8032cd33595930ec55..4e12350c22bf90d20b86b7d2d46a7a689d3c79a0 100644 (file)
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:             YAML (YAML Ain't Markup Language)
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se> (inactive)
-" Last Change:         2020 Mar 02
+" Last Change:  2024 Oct 04
 
 if exists("b:did_ftplugin")
   finish
@@ -18,7 +18,10 @@ setlocal formatoptions-=t formatoptions+=croql
 
 " rime input method engine uses `*.custom.yaml` as its config files
 if expand('%:r:e') ==# 'custom'
-  compiler rime_deployer
+  if !exists('current_compiler')
+    compiler rime_deployer
+    let b:undo_ftplugin ..= "| compiler make"
+  endif
   setlocal include=__include:\\s*
   let b:undo_ftplugin ..= " inc<"
 endif
index ea229b6a492f972ee3346a147564a01da04f9ac7..ea584ed086c050b51756857b298fe0a6798da173 100644 (file)
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:     Zig
 " Maintainer:   Mathias Lindgren <math.lindgren@gmail.com>
-" Last Change:  2024 May 21
+" Last Change:  2024 Oct 04
 " Based on:     https://github.com/ziglang/zig.vim
 
 if exists("b:did_ftplugin")
@@ -13,8 +13,6 @@ let b:did_ftplugin = 1
 let s:cpo_save = &cpo
 set cpo&vim
 
-compiler zig_build
-
 " Match Zig builtin fns
 setlocal iskeyword+=@-@
 setlocal formatoptions-=t formatoptions+=croql
@@ -47,6 +45,11 @@ if exists('g:zig_std_dir')
     let b:undo_ftplugin .= ' | setl pa<'
 endif
 
+if !exists('current_compiler')
+    compiler zig_build
+    let b:undo_ftplugin .= "| compiler make"
+endif
+
 let &cpo = s:cpo_save
 unlet s:cpo_save
 " vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab