codekingpro/portable-devtools
114k
1" Vim filetype plugin file2" Language: Clojure3" Maintainer: Alex Vear <alex@vear.uk>4" Former Maintainers: Sung Pae <self@sungpae.com>5" Meikel Brandmeyer <mb@kotka.de>6" URL: https://github.com/clojure-vim/clojure.vim7" License: Vim (see :h license)8" Last Change: 2022-03-249" 2024 Jan 14 by Vim Project (browsefilter)10 11if exists("b:did_ftplugin")12 finish13endif14let b:did_ftplugin = 115 16let s:cpo_save = &cpo17set cpo&vim18 19let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<'20 21setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$,%,&,\|22 23" There will be false positives, but this is better than missing the whole set24" of user-defined def* definitions.25setlocal define=\\v[(/]def(ault)@!\\S*26 27" Remove 't' from 'formatoptions' to avoid auto-wrapping code.28setlocal formatoptions-=t29 30" Lisp comments are routinely nested (e.g. ;;; SECTION HEADING)31setlocal comments=n:;32setlocal commentstring=;\ %s33 34" Specially indented symbols from clojure.core and clojure.test.35"36" Clojure symbols are indented in the defn style when they:37"38" * Define vars and anonymous functions39" * Create new lexical scopes or scopes with altered environments40" * Create conditional branches from a predicate function or value41"42" The arglists for these functions are generally in the form of [x & body];43" Functions that accept a flat list of forms do not treat the first argument44" specially and hence are not indented specially.45"46" -*- LISPWORDS -*-47" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj48setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test49 50" Provide insert mode completions for special forms and clojure.core. As51" 'omnifunc' is set by popular Clojure REPL client plugins, we also set52" 'completefunc' so that the user has some form of completion available when53" 'omnifunc' is set and no REPL connection exists.54for s:setting in ['omnifunc', 'completefunc']55 if exists('&' . s:setting) && empty(eval('&' . s:setting))56 execute 'setlocal ' . s:setting . '=clojurecomplete#Complete'57 let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<'58 endif59endfor60 61" Skip brackets in ignored syntax regions when using the % command62if exists('loaded_matchit')63 let b:match_words = &matchpairs64 let b:match_skip = 's:comment\|string\|regex\|character'65 let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip'66endif67 68" Filter files in the browse dialog69if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")70 let b:browsefilter = "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" .71 \ "EDN Files\t*.edn\n" .72 \ "Java Files\t*.java\n"73 if has("win32")74 let b:browsefilter .= "All Files (*.*)\t*\n"75 else76 let b:browsefilter .= "All Files (*)\t*\n"77 endif78 let b:undo_ftplugin .= ' | unlet! b:browsefilter'79endif80 81let &cpo = s:cpo_save82 83unlet! s:cpo_save s:setting s:dir84 85" vim:sts=8:sw=8:ts=8:noet86 