Skip to content

Commit

Permalink
Merge pull request #42 from russtoku/master
Browse files Browse the repository at this point in the history
- Detect `.bb` and `.clj_kondo` file extension as Clojure.
- Add XML file filter to GVim file browser.
- Moved unofficial Clojure file extension detection to an `after/ftdetect` plugin.
  - Can be turned off with `let g:clojure_detect_unofficial_exts = 0`
  - Maybe improve this at a later date.
  • Loading branch information
axvr authored Nov 15, 2024
2 parents bc3f1fa + ea53176 commit 128ccd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions after/ftdetect/clojure.vim
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ftdetect/clojure.vim
Original file line number Diff line number Diff line change
@@ -1 +1 @@
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot setlocal filetype=clojure
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
5 changes: 3 additions & 2 deletions ftplugin/clojure.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ 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"
\ "Java Files\t*.java\n" .
\ "XML Files\t*.xml\n"
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
endif

Expand Down

0 comments on commit 128ccd4

Please sign in to comment.