From e6309b84c48360fe2dd05236747477763c46f56f Mon Sep 17 00:00:00 2001 From: Russ Tokuyama Date: Fri, 8 Nov 2024 18:37:30 -1000 Subject: [PATCH 1/3] Detect .bb and .clj_kondo file extension as Clojure --- ftdetect/clojure.vim | 2 +- ftplugin/clojure.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ftdetect/clojure.vim b/ftdetect/clojure.vim index 687739d..5916835 100644 --- a/ftdetect/clojure.vim +++ b/ftdetect/clojure.vim @@ -1 +1 @@ -autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot setlocal filetype=clojure +autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot,*.bb,*.clj_kondo setlocal filetype=clojure diff --git a/ftplugin/clojure.vim b/ftplugin/clojure.vim index 009977a..d878239 100644 --- a/ftplugin/clojure.vim +++ b/ftplugin/clojure.vim @@ -67,7 +67,7 @@ endif " Filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "All Files\t*\n" . - \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . + \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx;*.bb;*.clj_kondo\n" . \ "EDN Files\t*.edn\n" . \ "Java Files\t*.java\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' From 948c70a58644c4a784a7288024996850255a4f21 Mon Sep 17 00:00:00 2001 From: Alex Vear Date: Fri, 15 Nov 2024 16:54:08 +0000 Subject: [PATCH 2/3] Add XML file filter option for GVim --- ftplugin/clojure.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ftplugin/clojure.vim b/ftplugin/clojure.vim index d878239..b4487cd 100644 --- a/ftplugin/clojure.vim +++ b/ftplugin/clojure.vim @@ -69,7 +69,8 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "All Files\t*\n" . \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx;*.bb;*.clj_kondo\n" . \ "EDN Files\t*.edn\n" . - \ "Java Files\t*.java\n" + \ "Java Files\t*.java\n" . + \ "XML Files\t*.xml\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif From ea53176a38122fdb6aa6c84f4bbc9c0036e7d5db Mon Sep 17 00:00:00 2001 From: Alex Vear Date: Fri, 15 Nov 2024 16:44:43 +0000 Subject: [PATCH 3/3] Do not detect unofficial file extensions when embedded into Vim Since BitBake already claimed the `.bb` file extension before Babashka, we cannot override it in upstream Vim, hence we register an optional `after` ftdetect plugin for various unofficial Clojure file extensions. I'm not a fan of using `after` for this, so I may change it at a later date. --- after/ftdetect/clojure.vim | 3 +++ ftdetect/clojure.vim | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 after/ftdetect/clojure.vim diff --git a/after/ftdetect/clojure.vim b/after/ftdetect/clojure.vim new file mode 100644 index 0000000..8eb51fa --- /dev/null +++ b/after/ftdetect/clojure.vim @@ -0,0 +1,3 @@ +if get(g:, 'clojure_detect_unofficial_exts', 1) + autocmd BufNewFile,BufRead {build,profile}.boot,*.bb,*.clj_kondo setlocal filetype=clojure +endif diff --git a/ftdetect/clojure.vim b/ftdetect/clojure.vim index 5916835..5db03e4 100644 --- a/ftdetect/clojure.vim +++ b/ftdetect/clojure.vim @@ -1 +1 @@ -autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot,*.bb,*.clj_kondo setlocal filetype=clojure +autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure