annotate runtime/ftplugin/clojure.vim @ 35437:122598cc42ad default tip

runtime(kdl): fix KdlIndent and kdlComment in indent script (#15019) Commit: https://github.com/vim/vim/commit/79da22de755e28bd8d4f58fc4bf34cf94f45de63 Author: Yinzuo Jiang <jiangyinzuo@foxmail.com> Date: Sun Jun 16 14:47:47 2024 +0800 runtime(kdl): fix KdlIndent and kdlComment in indent script (https://github.com/vim/vim/issues/15019) Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jun 2024 09:00:05 +0200
parents 8ae680be2a51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
23931
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 9644
diff changeset
2 " Language: Clojure
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
3 " Maintainer: Alex Vear <alex@vear.uk>
23931
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 9644
diff changeset
4 " Former Maintainers: Sung Pae <self@sungpae.com>
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 9644
diff changeset
5 " Meikel Brandmeyer <mb@kotka.de>
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 9644
diff changeset
6 " URL: https://github.com/clojure-vim/clojure.vim
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 9644
diff changeset
7 " License: Vim (see :h license)
28246
e3d6184b89fa Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
8 " Last Change: 2022-03-24
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
9 " 2024 Jan 14 by Vim Project (browsefilter)
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 if exists("b:did_ftplugin")
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
12 finish
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 let b:did_ftplugin = 1
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 let s:cpo_save = &cpo
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 set cpo&vim
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
19 let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<'
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
20
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
21 setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$,%,&,\|
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 " There will be false positives, but this is better than missing the whole set
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 " of user-defined def* definitions.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 setlocal define=\\v[(/]def(ault)@!\\S*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
27 " Remove 't' from 'formatoptions' to avoid auto-wrapping code.
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
28 setlocal formatoptions-=t
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 " Lisp comments are routinely nested (e.g. ;;; SECTION HEADING)
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 setlocal comments=n:;
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 setlocal commentstring=;\ %s
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
34 " Specially indented symbols from clojure.core and clojure.test.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
35 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
36 " Clojure symbols are indented in the defn style when they:
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
37 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
38 " * Define vars and anonymous functions
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
39 " * Create new lexical scopes or scopes with altered environments
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
40 " * Create conditional branches from a predicate function or value
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
41 "
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
42 " The arglists for these functions are generally in the form of [x & body];
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
43 " Functions that accept a flat list of forms do not treat the first argument
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
44 " specially and hence are not indented specially.
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
45 "
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
46 " -*- LISPWORDS -*-
28246
e3d6184b89fa Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
47 " Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj
5763
c52a655d927d Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5734
diff changeset
48 setlocal 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-test
5734
657ade71d395 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
49
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 " Provide insert mode completions for special forms and clojure.core. As
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 " 'omnifunc' is set by popular Clojure REPL client plugins, we also set
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 " 'completefunc' so that the user has some form of completion available when
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 " 'omnifunc' is set and no REPL connection exists.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 for s:setting in ['omnifunc', 'completefunc']
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
55 if exists('&' . s:setting) && empty(eval('&' . s:setting))
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
56 execute 'setlocal ' . s:setting . '=clojurecomplete#Complete'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
57 let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
58 endif
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 endfor
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 " Skip brackets in ignored syntax regions when using the % command
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 if exists('loaded_matchit')
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
63 let b:match_words = &matchpairs
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
64 let b:match_skip = 's:comment\|string\|regex\|character'
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
65 let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip'
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
68 " Filter files in the browse dialog
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
69 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
70 let b:browsefilter = "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" .
28246
e3d6184b89fa Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
71 \ "EDN Files\t*.edn\n" .
e3d6184b89fa Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
72 \ "Java Files\t*.java\n"
34134
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
73 if has("win32")
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
74 let b:browsefilter .= "All Files (*.*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
75 else
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
76 let b:browsefilter .= "All Files (*)\t*\n"
8ae680be2a51 runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents: 28246
diff changeset
77 endif
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
78 let b:undo_ftplugin .= ' | unlet! b:browsefilter'
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 endif
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 let &cpo = s:cpo_save
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 unlet! s:cpo_save s:setting s:dir
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
85 " vim:sts=8:sw=8:ts=8:noet